Jump to content

using if wiht css


bos32178

Recommended Posts

ok I look up the if statements in books and at the web pages that was lested in this forum. I don't know what could be wrong.. here is the code that i am working on. please let me know if you know what i am doing wrong.<!DOCTYPE htmlPUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html> <head> <title> Desk Pets </title> <!--compliance patch for microsoft browsers--> <!--[if lt IE 7]> <script src="ie7/ie7-standard-p.js" type="text/javascript"> </script> <![endif]--> <link rel='stylesheet' type='text/css' href='sheets/body.css' media='screen'/> <link rel='stylesheet' type='text/css' href='sheets/menu.css' media='screen'/> <link rel='stylesheet' type='text/css' href='sheets/heading.css' media='screen'/> <!--[if lt IE 7]> <link rel='stylesheet' type='text/css' href='sheets/ie6.css' media='screen'/> <![endif]--> <!--[if lt IE 6]> <link rel='stylesheet' type='text/css' href='sheets/ie5-5.css' media='screen'/> <![endif]--> </head>

Link to comment
Share on other sites

Two things:1.) place the IE 7 conditional after the standard CSS links.2.) the top IE7 conditional should be re-written to be equal to IE7???

<link rel='stylesheet' type='text/css'href='sheets/body.css' media='screen'/><link rel='stylesheet' type='text/css'href='sheets/menu.css' media='screen'/><link rel='stylesheet' type='text/css'href='sheets/heading.css' media='screen'/><!--compliance patch for microsoft browsers--><!--[if  IE 7]><script src="ie7/ie7-standard-p.js" type="text/javascript"></script><![endif]--><!--[if lt IE 7]><link rel='stylesheet' type='text/css'href='sheets/ie6.css' media='screen'/><![endif]--><!--[if lt IE 6]><link rel='stylesheet' type='text/css'href='sheets/ie5-5.css' media='screen'/><![endif]-->

Try that...

Link to comment
Share on other sites

You are over-writting yourself.You are saying "If anything later than IE7 use this"But right below that you are saying "If anything later than IE6 use this"The browser doesn't know what to do.Just use

<!--[if  IE 7]>

Link to comment
Share on other sites

thank you for your help but that did not work. the two if are for inter net exp less then ver 7. and the other is for ie that is less then ver 6. i have the end if for each and if i don't use if then in ver ie 7 it won't look right. I don't know why they wont work. if you have any other ideals let me know.

Link to comment
Share on other sites

<!DOCTYPE html PUBLIC "-/pp/w3c//DTD XHTML 1.0 Strict//EN""xhtml1-strict.dtd"><html>      <head>		<title>		Desk Pets	</title>	<!--compliance patch for microsoft browsers-->	<!--[if lt IE 7]>	<script src="ie7/ie7-standard-p.js" type="text/javascript">	</script>	<![endif]-->	<link rel='stylesheet' type='text/css'	      href='sheets/body.css' media='screen'/>	<link rel='stylesheet' type='text/css'	      href='sheets/menu.css' media='screen'/>	<link rel='stylesheet' type='text/css'	      href='sheets/heading.css' media='screen'/>	<!--[if lt IE 7]>	<link rel='stylesheet' type='text/css'	      href='sheets/ie6.css' media='screen'/>	<![endif]-->	<!--[if lt IE 6]>	<link rel='stylesheet' type='text/css'	      href='sheets/ie5-5.css' media='screen'/>	<![endif]-->           </head>   <body>   <center><div id='nav'>	    <div>		<ul id='Desk'>		     <li id='leftedge'>		    	<span>Desk Pets</span>		    	<ul class='menu'>		    		<li><a href='cat1.html'>Cats</a></li>		   	 				<li><a href='dog1.html'>Dogs</a></li>		   	 				<li><a href='forest.html'>Forest</a></li>		       					<li><a href='Farm.html'>Farm</a></li>		   					<li><a href='Africa.html'>Africa</a></li>		   	 				<li><a href='Pond.html'>Pond</a></li>		    					<li><a href='pole.html'>North Pole</a></li>				<li><a href='misc.html'>Miscellaneous</a></li>		   	 </ul>		     </li>		     <li>			<span>Cell Pets</span>		    	<ul class='menu'>		    		<li><a href='ccat.html'>Cats</a></li>		   					<li><a href='cdog.html'>Dogs</a></li>		   	 				<li><a href='cforest.html'>Forest</a></li>		    					<li><a href='cFarm.html'>Farm</a></li>		   					<li><a href='cAfrica.html'>Africa</a></li>		   					<li><a href='cPond.html'>Pond</a></li>		    				<li><a href='cpole.html'>North Pole</a></li>		   	 </ul>		     </li>		   </ul>		   <a href='index.html'>			<img src='deskpets.gif'			     alt='Desk pets sign'			     title='Home'/>		   </a>		   <ul id='About'>			<li id='rightedge'>				   <span>About Desk Pets</span>		    	<ul class='menu'>		    		<li><a href='bio.html'>Creator</a></li>		   					<li><a href='making.html'>Making Of</a></li>		   	 </ul>		     </li>		     <li>		     		  	<form target="paypal" action="https://www.paypal.com/cgi-bin/webscr" method="post">			<input type="hidden" name="cmd" value="_cart">			<input type="hidden" name="business" value="judiattaway@hotmail.com">			<input type="image" src="button/cart.gif" border="0" name="submit" alt="View Cart">			<input type="hidden" name="display" value="1">		     </ul>		   </li>		<ul>	   </div>	</div>	<div id='body'>	     <h1>		A pet you can have anywhere	     </h1>	     <div id='content'>		<img src='Judia.jpg'		     id='judia'		     alt='Judia Attaway'/>		<h3>Judi Attaway</h3>	     <p>Judi Attaway is the creater of Desk Pets.To know more about her go to 		Creator under the About Desk pets tab.	     </p>	     <p>At any point you need to come back to the home page just click on the 		Desk Pets name plate.	     </p>	     <p>Welcome to desk pets! All of these pets listed need good places to go, 		places that will put them to use. Each of the desk pets want the simple 		job of holding your cell phone, your spare change, or even your loose 		paperclips. Coming soon there will even be desk pets to hold your pens 		and pencils. So go ahead and browse, see who catches your eye. Guaranteed 		that one of the desk pets is the right pet for you. 	     </p>	     <!--E-mail-->	      <h4>Email me at <A HREF="mailto:judiattaway@hotmail.com">Desk Pets</a> 		if you have any questions.	      </h4>	  		<h6>		© copyright 2007-2008	</h6>   </center>	</div>    </body></html>		

that is the web page i am working onthe first if is a javascript patchthe next if is to fix IE 6. a css patchthe last if is to fix IE 5 a css patch

Link to comment
Share on other sites

This is what I use, and IMO, it's all you need.

<link rel="stylesheet" type="text/css" media="screen, projection" href="style.css" /><!--[if lte IE 6]><link rel="stylesheet" type="text/css" media="screen, projection" href="style_IE.css" /><![endif]--><!--[if IE 7]><link rel="stylesheet" type="text/css" media="screen, projection" href="style_IE7.css" /><![endif]-->

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...