How to Read and Write CSS
Watch this video to learn how to write CSS.
But basically, we write CSS like this..
Sometimes we will see a CSS like this..
But basically, we write CSS like this..
name { property: value; }
For example: This will make ALL Paragraphs 14px in size.
p { font-size: 14px; }
We write a Class like this: This will make all elements with the Class of .class blue in colour
.class { color: blue; }
We write an ID like this: This will make any element with the ID of #id red in colour
#id { color: red; }
Sometimes we will see a CSS like this..
div { margin: 25px 10px 25px 10px; }
Do not panic, this is the same as..
div {
margin-top: 25px;
margin-right: 10px;
margin-bottom: 25px;
margin-left: 10px;
}
This is called CSS Shortcuts. Read more about it here.
Leave a comment