everytime i leave notes in css it overrides my <body> background color. Why?

DotCom

New Member
for some reason the note is overriding the background color. I have the same code on other pages with the same note and it works just fine. Any ideas on why this is happening?





<!----Global Applications--->
body {
font: 100% "Modern No. 20", "Arial Black", Georgia, serif;
background-color: #000;
color: #FFFFFF;
padding: 0 0 0 0;
margin: 0 0 0 0;
}

a:link {
text-decoration: none;
/* unless you style your links to look extremely unique, it's best to provide underlines for quick visual identification */
}

a:visited {
color: #0242A4;
text-decoration: line-through;
}

a:hover, a:active, a:focus { /* this group of selectors will give a keyboard navigator the same hover experience as the person using a mouse. */
text-decoration: line-through;
color: #09BDE0;
}
 
for some reason the note is overriding the background color. I have the same code on other pages with the same note and it works just fine. Any ideas on why this is happening?

Yeah, cause you shouldn't. Notes should go OUTSIDE the selectors, not in them.
 

DotCom

New Member
Yeah, cause you shouldn't. Notes should go OUTSIDE the selectors, not in them.

i found the problem. There is nothing wrong with using notes in selectors. I was using HTML Notes (<!----Global Applications--->) instead of CSS notes (/*Global Selectors*/) hahaha its funny how its always the simplest things that cause a slip up.
 

CaldwellYSR

Member
No.. seriously... there is no reason to put them inside.. at all... realy.. there isn't.

I'm confused are you being sarcastic? Although his comments are a little useless, it's perfectly fine to put comments inside the selectors if that's what you want to do. Especially if it's talking about one specific thing inside the selector?
 

Phreaddee

Super Moderator
Staff member
you are both right.

yes comments can be in css, and therefore also within selectors, it is recommended that if you need to have a comment in css it goes before or after the rule, not inside, unless what is being commented out is in fact a selector.
still even in that instance, if it isnt needed remove it.

over commenting is worse than no comments at all.
 
Top