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
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

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.