I have the following line in my css style sheet:
div.comment_link:hover { text-decoration: underline; color: red; }This is so it simulates a link where dhtml is taking care of modifying the page. Now, when I use the the div class:
<div class="comment_link">Comments</div>I get those bloody line breaks before and after the 'Comments' text. Is there anyway to sack the line breaks or am I just going about the long way to do this? I gave google and this forum a good search through and found nothing. Thanks in advance for any help.Use <span> (which is an in-line element) instead of <div> (which is a block-level element).display: inline;display: inline;
Certainly that will make a DIV work, but I do feel that SPAN would be somewhat more semantically correct in this case as far as the HTML markup goes. But I won't lose any sleep over it if you do use DIV. A span and a div are equivalent except that a div is display:block and a span is display:inline so why change the display type on a div to make it exactly the same as you'd get with a span?inline elements also loose other properties that block level elements have, like height... width... etc, these wont be avaliable with span
div.comment_link:hover { text-decoration: underline; color: red; }This is so it simulates a link where dhtml is taking care of modifying the page. Now, when I use the the div class:
<div class="comment_link">Comments</div>I get those bloody line breaks before and after the 'Comments' text. Is there anyway to sack the line breaks or am I just going about the long way to do this? I gave google and this forum a good search through and found nothing. Thanks in advance for any help.Use <span> (which is an in-line element) instead of <div> (which is a block-level element).display: inline;display: inline;
Certainly that will make a DIV work, but I do feel that SPAN would be somewhat more semantically correct in this case as far as the HTML markup goes. But I won't lose any sleep over it if you do use DIV. A span and a div are equivalent except that a div is display:block and a span is display:inline so why change the display type on a div to make it exactly the same as you'd get with a span?inline elements also loose other properties that block level elements have, like height... width... etc, these wont be avaliable with span