WHY STYLE.CSS DOES NOT WORK in Google Chroom ?

+3 Jasmina Savic · September 8, 2014
Why my style.css does not work in Google Chroom (but the same is with other browser) ?

When I open HTML in Google it is OK but when I insert something in style.css (Saved) and open Google Chrom again there is NOTHING ! Why ? if someone knows...


Here is in HTML and in Google it is OK:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN""http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">

<html lang="en">

<head>
    <meta charset="utf-8" />
    <title>Jasnin sajt</title>
    <link real="stylesheet" href="styles.css" />
</head>
<body>
<h1> Welcome ! </h1>
<hr />
    <div id="mommy">
  <p class="bucky">tuna and backon!</p>
       <p class="bucky">tuna and backon!</p> 
       <p class="bucky">tuna and backon!</p>
       <p class="bucky">tuna and backon!</p>
       <p class="bucky">tuna and backon!</p>
</div>

</body>


</html>


Here is (example) in styles.css:


p:nth-child (odd) {color:yellow;}
p:nth-child (even) {color:red;}



Then when open Google Chrom or other browser (Firefox, IE...) I got only text without any color changes ??? This=>


Welcome !
______________
tuna and backon!
tuna and backon!
tuna and backon!
tuna and backon!
tuna and backon!


But ALL IS BLACK NO CHANGES IN YELLOW AND RED ?
What is the problem ?





Post a Reply

Replies

Oldest  Newest  Rating
+4 Franz Schmidt · September 8, 2014
Your first problem is you named the relationship attribute real instead of rel (at the link to the stylesheet in the header)
And the main problem that your color doesn't change is that you put a space after p:nth-child and before the brackets (odd)

change this:
p:nth-child (odd){color: yellow;}
p:nth-child (even){color: red;}

to this:
p:nth-child(odd){color: yellow;}
p:nth-child(even){color: red;}
0 Jasmina Savic · September 9, 2014
Dear Franz Thank you very much !!!:)
You have right it was my mistake all this time:blush:
Now I will continue my work and with more attention.

I wish you best regards :)
  • 1

HTML / CSS / Web Design

106,969 followers
About

Discuss, share, ask, learn and teach HTML5 and CSS3.

Links
Moderators