Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in /home/mislz28/public_html/wp-content/themes/css-faq-v2/timeweather/timeweather.php on line 19
  • CSS Faqs
  • Software
26 June 2008

CSS and IE Issues

The most common problem encountered by CSS and Internet Explorer, is th differences of explanation of the CSS box model, which causes the elements of the page to look narrower in the Internet Explorer. Each HTML element is in essence a box, the width is the summation of its margin, content area, padding and border. Look at the program below:

CSS rule:
div {
margin: 5em;
padding: 4em;
border: 1em solid green;
width: 30em
}

It means that each 50em wide in total has the amount made up of 303m wide content area, and a 4em padding, 1em border and 5em invisible margin on both the left and right sides.

In the Internet Explorer, the padding and the border are inserted in the width of the content as opposed to an add on. I.E. the measurement of the width of the content is 20em which is 30em less 5em padding and border on either side, or the summation of the width of the div is around 40em.

A model for CSS box issue can happen in IE5.x, and also in IE6, based on how the author declares the ISO value in the code of HTML. There are two varieties of ways in doing this:
• <?xml version=”1.0″ encoding=”iso-8859-1″?>
• <meta http-equiv=”content-type” content=”text/html; charset=iso-8859-1″ />

The number one command is positioned on the first line of the HTML document and the second command is put anywhere within the <head>. XHTML pages are used to validate its mandatory use of commands. W3C suggests using the first command as the second and later on it will be phased out.

Using making use of the primary command, Internet Explorer 6 will make the CSS box function incorrectly, the same with lower versions such as Internet Explorer number five (IE5). To replace the box model, the author would have to insert a a hack from CSS to send width different in values to a variety of navigators. The CSS hack used will also depend on the ISO value used and what versions of Internet Explorer that is making the box function incorrectly.

To repair only IE5.x, the following commands for CSS can help any web designer

div {
margin: 5em;
padding: 4em;
border: 1em solid green;
width/**/:/**/ 40em;
width: 30em
}

To fix up all versions of IE, use these CSS commands:
div {
margin: 5em;
padding: 4em;
border: 1em solid green;
width: 40em
}
html>body div {
width: 30em
}

Tags:

This entry was posted on 26 June 2008 at 1:52 PM and is filed under CSS Faqs, Software. You can follow any responses to this entry through the RSS 2.0 feed. You can leave a response, or trackback from your own site.

Leave a reply

Name (*)
Mail (will not be published) (*)
URI
Comment