CSS Syntax
What is CSS Syntax ?
A CSS rule has two main parts: a selector, and one or more declarations…
The syntax for CSS is different than that of (X)HTML markup.
Though it is not too confusing, once you take a look at it.
There are 3 important part of syntax or in writing to the CSS are:
Selector {property1: value1; property2:value2;}
- Selector,is an HTML tag like (div, p, div, table, td, th, and so on ..)
This tags will be given effect by the property and its value so that any format that we want can be achieved with CSS.
Try to note the example below:
<style type="text/css">
p: {color:red;}
</style>
From the example above, the selector is the Tag P, Tag P are HTML tag that make up a paragraph on a Web browser, so when Tag P given a property (color) and value (red), and then if we look on the browser, will display Text with Red color.
- Property:Value, is the essence of style that determine the effects of the selector, if you want to have a selector that background color?, background image?, underlined?, or a striped top?.
From the example above, which is color property, property should be placed amid signs that the {…} while value is red.
Among properties with values separated by a colon (:) while to obtain the property in a style definition, we use a dot coma (;) as Value.
Example:
p {color:#FFFFFF;
padding-top:10px;
font-size:12px;
}
- Welcome to CSS Syntax [dot] com
Welcome to our Website ... CSS Syntax com is a website that explains about anything related to web...
www.csssyntax.com - CSS 3 Background Color Opacity
Everyone knows what RGB stands for (red, green, blue), but what does the A stand for?
www.csssyntax.com - CSS 3 Text Shadow
Using CSS3, we can create shadow effects on text with very simple syntax
www.csssyntax.com - CSS 3 Box Shadow
Excess CSS3 is able to make something that can not be done by CSS2
www.csssyntax.com
