Jump to content

Display DIV Same Size (FF & IE)


Dysan

Recommended Posts

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

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

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.