selector { property: value }
CSS syntax is simply composed of three parts: a selector, a property and a value.
if value contains two or more words, place quotes around the value.
p { font-family: “Times New Roman” }
If you wish to apply similar properties for different selectors, you may do so by grouping the selectors and separate each with a comma.
p, h1, h2, h3, body { color: #221133; font-size: 12px;}
color: #221133;
font-size: 12px;
}
CSS Comments
You can place comments on your css code by enclosing them with /* */. Comments are very useful for explaining and describing your css code. It may serve as a guide to others viewing your code and also for you when viewing it on later dates.
/* For Home Page paragraphs and headers */
p, h1, h2, h3 {
color: #221133;
font-size: 12px;
}
2 komente:
This is very helpful.
Thank you. I am relieved to see this spelled out so easily. Finally this code doesn't scare me. This is the best explanation I have seen so far.
Posto një koment