Jump to content

css not validating


Recommended Posts

This is my html. and the css.with which I keep getting "parse error " and "unrecognized" with and it normaly shows the #header or in this case #banner.Thank you Colin.

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"        "http://www.w3.org/TR/html4/loose.dtd"><html> <head>	<meta http-equiv="content-type" content="text/html; charset=iso-8859-1">	<title>growing aroids</title>	<style type="text/css"> 		body		{			margin: 0;			padding: 0;			font-family:"comic sans ms",sans- serif;			color: #000000;			background-color:#f5deb3;		}				#container		{     width:750px;                     			background-color:#d2b48c ;			margin-left:auto;                                                 margin-right:auto;  			border: 1px solid #ff0000;		}				#banner		{			background-color: #8b4513;			border-bottom: 1px solid #ff0000;                                                text-align:center;		}				#banner h1		{			margin: 0;			padding: .5em;                                                color:#ffff00;		}				#nav  {padding:5px;                                             background-color:#8b4513;                                            border-right:solid 1px #ff0000;		             height:800px;			float: left;			width: 135px;}												#nav p { margin-top: 0; }				#content  {height:800px;					padding-top: 0.5em;			margin-left:150px;		}				#content h2 { color:#ffff00;                                                    margin-top: 0;                                                    text-align:center; }				#footer{ height:35px;                                              line-height:35px;                         					clear: both;			background-color:#8b4513;			padding-left:10px;                     			text-align: right;			border-top: 1px solid #FF0000; }		</style></head><body><div id="container">	<div id="banner">		<h1>GROWING AROID'S</h1>	</div>	<div id="nav">		<p>	</div>	<div id="content">		<h2>			welcome		</h2>		<p>				</div>	<div id="footer"> <p>    <a href="http://validator.w3.org/check?uri=referer"><img        src="http://www.w3.org/Icons/valid-html401"        alt="Valid HTML 4.01 Transitional" height="31" width="88"></a>  </p>  			</div></div></body></html>

Edited by Jonas
Link to post
Share on other sites
This is my html. and the css.with which I keep getting "parse error " and "unrecognized" with and it normaly shows theĀ  #header or in this case #banner.Thank you Colin.

1. there is two unexpected p-tags (remove them):line 81 column 1 - Warning: trimming empty <p>line 88 column 1 - Warning: trimming empty <p>2. there is small (space) typo in fonts:font-family: "comic sans ms", sans- serif; sans- serif; must be as sans-serif;3 if You are using background-color You must use color too.I mean, there must be both, color and background-color all cases if other is:background-color: #FFFFFF;color: #C0C0C0;Very handy is inherit value with background (or with color):color: #C0C0C0;background-color: inherit;4. #container background-color:#d2b48c ;there is one space at the end of string, should bebackground-color:#d2b48c;No errors or warnings anymore. :)
Link to post
Share on other sites
I just ran it through the validator at validator.w3.org with no problems... no parse error or unrecognized... just a few warnings about the css...what validator were you using colin?

Hi sbrownii, thanks for your help with my validating problem.I've been using the w3c validator for my html and css. I've taught myself using their tutorial's. I tried it again but no luck it seems that the Gods have deserted me,I'll persevere though I refuse to be beat. Thanks Colin.
Link to post
Share on other sites
1. there is two unexpected p-tags (remove them):line 81 column 1 - Warning: trimming empty <p>line 88 column 1 - Warning: trimming empty <p>2. there is small (space) typo in fonts:font-family: "comic sans ms", sans- serif; sans- serif; must be as sans-serif;3 if You are using background-color You must use color too.I mean, there must be both, color and background-color all cases if other is:background-color: #FFFFFF;color: #C0C0C0;Very handy is inherit value with background (or with color):color: #C0C0C0;background-color: inherit;4. #container background-color:#d2b48c ;there is one space at the end of string, should bebackground-color:#d2b48c;No errors or warnings anymore. :)

Thanks for your help raimo, I'll give your suggestions a try and see how I get on. I never realised how much of a problem seemingly minor things could be. Thanks again , Colin.
Link to post
Share on other sites

I checked my css on w3c and I have no errors but only warnings. Most of them are because there is no background-color specified. Is that normal to have all those warnings?For instance I have: .red { color: #FF0000; }It gives a warning because no background color to .red

Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...