Dysan Posted June 12, 2008 Share Posted June 12, 2008 hi, the following code displays a div 100x100 in Internet Explorer, but not in FireFox (108x108). How do I get it to display at 100x100 in both browsers? <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <html> <head> <title>Untitled Document</title> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> <style> body { MARGIN: 18px; PADDING: 0px; } div { WIDTH: 100px; HEIGHT: 100px; BORDER: 4px solid rgb(0,0,0); } </style> </head> <body> <div></div> </body> </html> Link to comment https://forums.phpfreaks.com/topic/109887-display-div-same-size-ff-ie/ Share on other sites More sharing options...
rhodesa Posted June 12, 2008 Share Posted June 12, 2008 yeah, borders are treated differently...if only they would all follow the same box model something like this hacks it: div { WIDTH: 92px !important; /* Most browsers use this */ HEIGHT: 92px !important; /* Most browsers use this */ BORDER: 4px solid rgb(0,0,0); WIDTH: 100px; /* IE use this */ HEIGHT: 100px; /* IE use this */ } IE doesn't honor the !important Link to comment https://forums.phpfreaks.com/topic/109887-display-div-same-size-ff-ie/#findComment-563862 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.