If you want to understand CSS, there are a few basics that you should start with, and one of them is a firm grasp of html markup. I will have to assume that you have at least a basic understanding of html, or else you probably wouldn’t be here in the first place. If you don’t, then a good place to start is with the w3schools html tutorial.
Now that we’ve got that out of the way, the best place to begin with CSS is the syntax. CSS syntax is basically made up of three parts: the selector, the property, and the value.
p {font-size: 12px}
in this example, p = the selector (for paragraph), font-size = the property you want to style, and 12px = the value. So far, so good, right?
The property and the value are separated from the selector by those curly brackets, and from each other by a colon. The above example is telling the browser that in every instance of ‘p’ on the web page, the font size will be 12 pixels.
You can use this syntax to style everything on a web page, from font properties to backgrounds to positioning. This will replace <p style=”font-size: 12px”>this is your paragraph</p> in your html. If you have 30 paragraphs, each with the same font size, you can see how this would make writing markup a little easier!
That’s all there really is to it…the basics, anyway. Of course things get much more complicated, as they usually do, once you get into styling more than just your p’s and q’s, but as long as you understand the syntax of CSS, you’ll be able to understand the rest of it when you really get into it.
