css ie6 fix

why not

New Member
hi ! this code worked with firefox ! opera ! but not work in ie6 -
Code:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Test</title>
</head>
<body >
<div align="center">
<div style="width:100%; height:10px; background-color:#000000;"></div>
</div>
</body>
</html>
NOTE Error in IE6 : height Div over 10px ! and space div with top is long
SORRY For Bad English Grammer
 

jnjc

New Member
IE applies a default margin and padding to things, FF doesn't.

Try this:

Code:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Test</title>
</head>
<body style="[B]padding:0;margin:0[/B]" >
<div align="center">
<div style="width:100%; height:10px; background-color:#000000"></div>
</div>
</body>
</html>


If you are using a style sheet just add this to the top of the sheet:

Code:
* {margin:0; padding:0;}

HTH,
JC
 

sheanhoxie

New Member
JNJC is right except that using the * is a hack and you should really be using a separate stylesheet for IE

You can do so by using:

<!--[if IE]>
<link rel="stylesheet" type="text/css" href="ie_stylesheet.css">
<![endif]-->

Post this right after you post your normal stylesheet.

Sorry, this is like the 2nd or 3rd time Ive posted this, I dont mean to sound like a broken record....:)
 

jnjc

New Member
For this particular issue you could just put it into the .body and not have a separate .css for IE....
 

why not

New Member
IE applies a default margin and padding to things, FF doesn't.

Try this:

Code:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Test</title>
</head>
<body style="[B]padding:0;margin:0[/B]" >
<div align="center">
<div style="width:100%; height:10px; background-color:#000000"></div>
</div>
</body>
</html>


If you are using a style sheet just add this to the top of the sheet:

Code:
* {margin:0; padding:0;}

HTH,
JC

hi . thanks ! i know with {margin:0; padding:0;} fix space !
How to fix height div ! example : height:10px; but show div height over 10px ! or div height in ie6 not even div height in FF or opera . how to fix this ?
thanks
File attach : 1- ie 2-ff
 

Attachments

  • ie.JPG
    ie.JPG
    5.6 KB · Views: 959
  • ff.JPG
    ff.JPG
    5.8 KB · Views: 962
Last edited:
Top