View Full Version : 1px height div tag
Okay, I used css to style a div tag, making it 1px in height, and it comes out great, in fact almost everything I code comes out excellent in firefox, but not in ie7, which is the browser client that most people use. Anyways, the div tag shows up in regular height. Anyone no why or how to code it alternatively?
01-24-2007, 11:57 PM
Try font-size: 0; if that doesn’t work, try line-height: 0. I know that Internet Explorer has a bug that forces a minimum height equal to that of one line of text unless you use one or both of the previous declarations anyway. I think you need to add a (pixel) unit or something to the second one (if used) despite the value being zero though.
Thanks! The font-size worked, i didn't try line height though. I still like firefox 2 better than ie7.
01-25-2007, 02:55 AM
No need to specify width:100%; as divs by default unless they are floated, set to display:inline, or position:absolute will take up the full width of its containing element.
Powered by vBulletin® Version 4.2.2 Copyright © 2017 vBulletin Solutions, Inc. All rights reserved.