if "IE 7" ?

ok, got up and started to think.<br /><br />I want my website to be able to run in all browsers, right? well I actually don't know what that peace of code is;<br /><br />if "IE7" use "ie7-default.css" thats><img src='http://www.webdesignerforum.co.uk/style_images/1/post_snapback.gif' alt='*' border='0' /></div><div class='quotemain'><!--quotec-->you mean this<br /><!--[if IE 7]><br /><link rel="stylesheet" type="text/css" href=http://www.webdesignerforum.co.uk/lofiversion/index.php/"ie7.css" /><br /><![endif]--><!--QuoteEnd--></div><!--QuoteEEnd--><br /><br /><br />yes yes yes! Thanks so much dizi! I owe you><img src='http://www.webdesignerforum.co.uk/style_images/1/post_snapback.gif' alt='*' border='0' /></div><div class='quotemain'><!--quotec-->you mean this<br /><!--[if IE 7]><br /><link rel="stylesheet" type="text/css" href=http://www.webdesignerforum.co.uk/lofiversion/index.php/"ie7.css" /><br /><![endif]--><!--QuoteEnd--></div><!--QuoteEEnd--><br /><br /><br />actually what I want is for a part of css that works if it's IE 7.<br /><br />e.g.<br /><br />.part { // for any browser //<br /> margin: auto;<br /> height: 100px;<br /> width: 100px;<br />} <br /><br />and for ie<br /><br />.part { /*if IE 7*/ // just for IE 7 //<br /> margin: auto;<br /> height: 90px;<br /> width: 90px;<br />}<!--content-->
There's no conditional comments to be used in CSS. You'll have to use a IE7 specific hack then. Though I'd really recommend against hacks.<!--content-->
with php try this<br /><br /><?php<br />if (ereg("MSIE", $_SERVER['HTTP_USER_AGENT'])) {<br />echo "<link rel=\"stylesheet\" type=\"text/css\" href=http://www.webdesignerforum.co.uk/lofiversion/index.php/\"ie.css\" />";<br />}<br />else {<br />echo "<link rel=\"stylesheet\" type=\"text/css\"href=http://www.webdesignerforum.co.uk/lofiversion/index.php/\"non_ie.css\" />";<br />}<br />?><br /><br /> <img src="http://www.webdesignerforum.co.uk/style_emoticons/default/wink.gif" style="vertical-align:middle" emoid=";)" border="0" alt="wink.gif" /><!--content-->
<!--quoteo(post=16711:date=Nov 16 2007, 11:24:name=kufela)--><div class='quotetop'>QUOTE(kufela @ Nov 16 2007, 11:24) <img src='http://www.webdesignerforum.co.uk/style_images/1/post_snapback.gif' alt='*' border='0' /></div><div class='quotemain'><!--quotec-->with php try this<br /><br /><?php<br />if (ereg("MSIE", $_SERVER['HTTP_USER_AGENT'])) {<br />echo "<link rel=\"stylesheet\" type=\"text/css\" href=http://www.webdesignerforum.co.uk/lofiversion/index.php/\"ie.css\" />";<br />}<br />else {<br />echo "<link rel=\"stylesheet\" type=\"text/css\"href=http://www.webdesignerforum.co.uk/lofiversion/index.php/\"non_ie.css\" />";<br />}<br />?><br /><br /> <img src="http://www.webdesignerforum.co.uk/style_emoticons/default/wink.gif" style="vertical-align:middle" emoid=";)" border="0" alt="wink.gif" /><!--QuoteEnd--></div><!--QuoteEEnd--><br /><br /><br /> UserAgent string sniffing is not a reliable method. It'll most likely come back and haunt you. To target IE specifically, conditional comments is the target="_blank">http://mezzoblue.com/archives/2007/11/12/detect_this/<!--content-->
If your site relies heavily style="vertical-align:middle" emoid=":diablo:" border="0" alt="diablo.gif" /><!--content-->
This failsafe stylesheet would be a minimal layout avoiding positioned elements?<br />So you'd have a cutting edge stylesheet as default, and a blunt edge as backup?<!--content-->
<!--quoteo(post=18626:date=Dec 5 2007, 17:25:name=Thomas Thomassen)--><div class='quotetop'>QUOTE(Thomas Thomassen @ Dec 5 2007, 17:25) <img src='http://www.webdesignerforum.co.uk/style_images/1/post_snapback.gif' alt='*' border='0' /></div><div class='quotemain'><!--quotec-->This failsafe stylesheet would be a minimal layout avoiding positioned elements?<br />So you'd have a cutting edge stylesheet as default, and a blunt edge as backup?<!--QuoteEnd--></div><!--QuoteEEnd--><br /><br />Not 'blunt' edge, but minimal. And compliant.<br /><br />Especially if certain aspects of the site relied><img src='http://www.webdesignerforum.co.uk/style_images/1/post_snapback.gif' alt='*' border='0' /></div><div class='quotemain'><!--quotec-->with php try this<br /><br /><?php<br />if (ereg("MSIE", $_SERVER['HTTP_USER_AGENT'])) {<br />echo "<link rel=\"stylesheet\" type=\"text/css\" href=http://www.webdesignerforum.co.uk/lofiversion/index.php/\"ie.css\" />";<br />}<br />else {<br />echo "<link rel=\"stylesheet\" type=\"text/css\"href=http://www.webdesignerforum.co.uk/lofiversion/index.php/\"non_ie.css\" />";<br />}<br />?><br /><br /> <img src="http://www.webdesignerforum.co.uk/style_emoticons/default/wink.gif" style="vertical-align:middle" emoid=";)" border="0" alt="wink.gif" /><!--QuoteEnd--></div><!--QuoteEEnd--><br /><br />Thast what I was going to reccomend, but you beat me to it kufela <img src="http://www.webdesignerforum.co.uk/style_emoticons/default/laugh.gif" style="vertical-align:middle" emoid=":lol:" border="0" alt="laugh.gif" /><!--content-->
 
Top