I'm simulating an explorer-style interface where there are nodes with plus signs or minus signs next to them, and vertical dotted lines joining everything. I need there to be no space between each line of text.
If I have the following:
<DIV><A HREF="#" onclick="blah();"><IMG src="plug.png"></A></DIV>
<DIV><A HREF="E" onclick="blah();"<IMG src="plus.png"></A></DIV>
these two images (21 wide by 16 high) will touch each other.
But the moment I put a text node after them inside the DIVs (or other element, could be a P for example) they become separated from each other by 2 or 3 pixels (IE or firefox). I can make the font 5px high and it makes no difference. Line-height appears to do nothing at all in IE or firefox (I have to be doing something wrong). If I adjust the height of the image to less than actual, each line does become closer together, making it seem like the height of the line is coming from the image but the spacing is coming from the text.
First, could you help me understand why text nodes are doing this and second, how do I fix it? I'm about to experiment with more DIVs inside the outer one, but why is that even necessary?
I've found Dave's Inline Box Model helpful in understanding how fonts are laid out in browsers, but I haven't figured this one out yet.
Putting a negative bottom margin on the text doesn't help.
I have the following css declarations in my document:
html {
font-family:Tahoma, sans-serif;
font-size:12px;
}
html, div, form, img, table, td, th, p {
border:none;
margin:0px;
padding:0px;
}
body {
padding:4px;
}
A secondary item is that the text is aligned incorrectly (too low) and I can fiddle around with correcting that, but I need to solve the other thing first.
If I have the following:
<DIV><A HREF="#" onclick="blah();"><IMG src="plug.png"></A></DIV>
<DIV><A HREF="E" onclick="blah();"<IMG src="plus.png"></A></DIV>
these two images (21 wide by 16 high) will touch each other.
But the moment I put a text node after them inside the DIVs (or other element, could be a P for example) they become separated from each other by 2 or 3 pixels (IE or firefox). I can make the font 5px high and it makes no difference. Line-height appears to do nothing at all in IE or firefox (I have to be doing something wrong). If I adjust the height of the image to less than actual, each line does become closer together, making it seem like the height of the line is coming from the image but the spacing is coming from the text.
First, could you help me understand why text nodes are doing this and second, how do I fix it? I'm about to experiment with more DIVs inside the outer one, but why is that even necessary?
I've found Dave's Inline Box Model helpful in understanding how fonts are laid out in browsers, but I haven't figured this one out yet.
Putting a negative bottom margin on the text doesn't help.
I have the following css declarations in my document:
html {
font-family:Tahoma, sans-serif;
font-size:12px;
}
html, div, form, img, table, td, th, p {
border:none;
margin:0px;
padding:0px;
}
body {
padding:4px;
}
A secondary item is that the text is aligned incorrectly (too low) and I can fiddle around with correcting that, but I need to solve the other thing first.