Syntax / CSS sentence consists of multiple sets of rules that have: 1 selector, 1 property, 1 value.
The format of writing sentences CSS :
selector { property: value }The selector to indicate which part is going to be set / formatted.
Property for show, part of ( property ) of the selector to be set.
Value is the value of the setting.
Syntax example :
h1 { color: red }The above example shows
Selector: h1If translated into Indonesian phrase roughly like this: Set the color of the h1 color to red (red).
Property: color
Value: red
Grouping Selectors
You can write the CSS code for the various selector by using commas. Suppose you want to set the tags h1, h2 and h3 all use red, then its CSS code becomes :
h1,h2,h3 { color: red }Consider writing h1, h2, h3, separated by commas.
Use of Lots Properties
To set more than one separator properties use a semicolon (;).
example :
h1,h2,h3 {color:red; font-family:arial; font-size:150%;}In the example above, the tag h1, h2 and h3 be set to use the color red, with arial font type, and font size to 150%.
How Good Writing
Highly recommended to write a few lines of CSS code using the settings in which property and its values in the indent. Yes let's just neat and easy to read aja, ga should really.
h1,h2,h3 {Now that you understand the basic rules of writing sentences CSS. The next lesson will teach you to apply the CSS code to your pages.
color:red;
font-family:arial;
font-size:150%;
}
CSS Comment
Sometimes, it helps you write comments into your CSS code for reminder notes.
You can use the syntax opening / * and closing * / to write a comment. All text that is between the tags / * and * / will not be read as a code, but just as a note for yourself.
/* Write your comment here */
p
{
text-align: justify;
/* Write your comment here */
color: blue;
font-family: arial;
}

Post a Comment