Lack of height solution in ie6

I am using an empty div to display a row by setting height to 3px . it works fine in all browsers, but in ie6 div height is displayed with 20px height . It remains the same even for height: 0px. But changes in other properties reflect, but not height, and there is no duplicate css record and inherited value from another div. Can anyone please help

<div id="line"></div> 

CSS:

 #line { border: none; background-color: #134c7c; height: 3px; margin-bottom: 20px; } 
+4
source share
4 answers

Internet Explorer has the strange idea that the content of each element must be at least one character. You can get around this using the overflow attribute, so the content can remain high, but it does not affect the height of the element itself:

 .line { height: 3px; overflow: hidden; } 
+13
source

Try:

 line-height:0 
+3
source

Just a wild hunch.

Check if there is any space inside the element. If yes, install

 font-size: 1px; 

item properties.

+2
source

try with space in a div or just guess

0
source

All Articles