In our CSS code ,you probably noticed that we
were altering the BODY and P HTML tags.
CSS is known as intuitive language. You are pretty much set once you understand the
general format for CSS code.
General CSS Format:
- "HTML tag" { "CSS Property" : "Value" ;
}
Back in our code example, we manipulated <p> and <body>, both
well known HTML tags. To clarify, here is a step-by-step process
of what is going on in that first line of CSS code where we
played around with "p".
- We chose the HTML element we wanted to manipulate. -
p{ : ; }
- Then we chose the CSS attribute color. - p { color:
; }
- Next we chose the font color to be white. - p { color:
white; }
Now all text within a paragraph tag will show up as white!
Now an explanation of the CSS code that altered the <body>'s
background.
- We choose the HTML element Body - body { : ; }
- Then we chose the CSS attribute. - body {
background-color: ; }
- Next we chose the background color to be black. - body {
background-color: black; }
You will probably find your CSS code not working as you expected until you become accustomed to using CSS code .
A leading cause of this might be an out of place :, ;,
{, or } or it might be that you forgot to use a
:, ;, {, or } when it was required.If you ever have issues with the correct
format for CSS , be sure to check back here
|