Hi Can anyone help?
I decided to experiment with conditional statements and stylesheets.
My conditional statement regarding IE stylesheets doesnt seem to work.
Please take a look at my code:
Here are my two stylesheets: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>Conditional Statement Test Page</title> <!--[if IE]> <link rel="stylesheet" type="text/css" href="stylesheet_ie.css" /> <![endif]--> <link href="stylesheet_ff.css" rel="stylesheet" type="text/css" media="screen" /> </head> <body> <div id="wrapper"></div> </body> </html>
Firefox:
IE:Code:body { margin: 0px auto; padding: 0px; position: relative; left: auto; right: auto; background-color: #ff0000; } #wrapper { background-repeat: no-repeat; left: auto; right: auto; margin-top: 0px; margin-right: auto; margin-bottom: 0px; margin-left: auto; height: 600px; width: 800px; position: relative; z-index: 1; background-color: #0066cc; }
However in IE the pages are the same colour and width as Firefox.Code:body { margin: 0px auto; padding: 0px; position: relative; left: auto; right: auto; background-color: #ff0000; } #wrapper { background-repeat: no-repeat; left: auto; right: auto; margin-top: 0px; margin-right: auto; margin-bottom: 0px; margin-left: auto; height: 600px; width: 900px; position: relative; z-index: 1; background-color: #0000ff; }
Here is the page:
Conditional Statement Test Page
Can any one tell me where Im going wrong?
Thanks, Alan.



Reply With Quote



Bookmarks