Code won't work CSS styling


#1

This is my code for the CSS styling of a webpage, but it says that the color: #5a5a5a; is incorrect. I've checked the whole code but I can't find anything wrong. I have also re written it many times.

< !DOCTYPE html >
< html>
< head>
< link href="main.css" rel="stylesheet">
.nav a {
color: #5a5a5a;
font-size: 11px;
font-weight: bold;
padding-bottom: 14px;
padding-left: 10px;
padding-right: 10px;
padding-top: 14px;
text-transform: uppercase;
}
< /head>


#2

@lenagalbreath It looks like you have both HTML and CSS code in one file. If this is just the CSS, then take out anything between the <> brackets.


#3

@lenagalbreath,
If you want to place CSS-definitions in between the head-Tag's
you will have to encapsulate the CSS definition in style-Tags
like

< !DOCTYPE html >
< html> 
  < head>
    < link href="main.css" rel="stylesheet">
    <style>
       .nav a {
        color: #5a5a5a;
        font-size: 11px;
        font-weight: bold;
        padding-bottom: 14px;
        padding-left: 10px;
        padding-right: 10px;
        padding-top: 14px;
        text-transform: uppercase;
        }
   </style>
 < /head>

Generally speaking we can say that all the styles will "cascade" into a new "virtual" style sheet by the following rules, where number four has the highest priority:
The styling of an HTML-Element can be defined by

1. Browser default 
2. External style sheet 
3. Internal style sheet (in the head section) 
4. Inline style (inside an HTML element)

= http://stackoverflow.com/questions/1795438/load-and-execution-sequence-of-a-web-page


#4

cool, didn't know this was another way of doing it, thanks