Style code trouble!

I have two pages that I recently validated through W3C and had the validator clean up the errors for me. Those two pages were uploaded again to the main site but the background color became black instead of the original color of purple. I tried inserting just regular bg color code but that didn’t work.

<style type=“text/css”>
body.c8 {background-color:#37007b}
p.c7 {margin-left:-325px;}
div.c6 {margin-top:-50px; margin-left:-50px;}
img.c5 {margin-top:-301px; margin-right:15px;}
img.c4 {margin-left:-324px;}
p.c3 {float: right; width: 50%; text-align: center;}
p.c2 {float: left; width: 50%; text-align: center;}
img.c1 {margin-right:330px}

This is the style type that contains the error. Note that the bg color is set to the custom value. This is the other style for the other page I happened to correct( I attempted copy and paste but had no luck either):

<style type=“text/css”>
body {background-color:#37007b}
p.c5 {margin-left:-325px;}
div.c4 {margin-top:-50px; margin-left:-50px;}
div.c3 {text-align: center}
p.c2 {font-size: 144%}
img.c1 {margin-right:330px}

If anyone has an idea of what could be wrong, I would greatly apprecitate the help!

Could you clarify which block of code is working and which isn’t?

Try comparing the selectors in each blog. For example, the first one has styles for


which means they will apply to the body tag only if you have

<body class="c8">

in the HTML. In the second block, the selector is just “body”, meaning that it will apply
to the body tag regardless of its classes.

If you compare the selectors as well as the classes used in the HTML itself, that might explain the results you’re getting.

Did you miss the semi-colon? eg

body.c8 {background-color:#37007b**[size=];[/size]**}

Normally, you don’t need the semicolon for the last one. You only need it if you are separating multiple styles for the same thing.

i would say add semi colons to everything and remove the /<![CDATA[/ & /]]>/ (What is that stuff even for?)

Yup, the CDATA stuff is not needed–but in this case, both lines are /* commented out */ so they won’t impact the CSS.

And Cecil is correct; the last semicolon in each block is optional.