Jump to content

Display DIV Same Size (FF & IE)


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">
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
  MARGIN: 18px;
  PADDING: 0px;

  WIDTH: 100px;
  HEIGHT: 100px;
  BORDER: 4px solid rgb(0,0,0);


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:


  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. Are you sure you have something important to add to it?

Join the conversation

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

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.