and therefore it is easy to understand. HakonWium Lie CSS was invented by HakonWium Lie on October , and maintained through a group of people within the W3C called the CSS Working Group. CSS – Style definition rules The body of the style sheet consists of a series of rules. HTML Tag { Properties : Values; } Selector Declaration Chapter Pages CSS style declaration consists of two major parts; Selector and Declaration.
The Selector refers an HTML tag in which you want to apply styles. The Declaration is a block of code contains style definition. It should be surrounded by curly braces. You can include any number of properties for each selector, and they must be separated by semicolons.
The property name and its value should be separated by a colon. Each declaration should be terminated by a semicolon ( ; ). Example: P { Font-size : 16pt; color : red; font-weight : bold; } Selector Declaration of properties and values In the above example, the style properties are defined to <p> tag. Hereafter, whenever you use the <p>, the contents will be displayed with modified properties.
If you want to use the above style definition as an internal style then it should be specified within <style> …… ,</style> block in head section. If you want store the above definition for using all your web pages, you should save the above code as a separate file with extension .css CSS – Frequently using Text formatting Properties and Values Table: . Formatting Properties Values Example Text Colour Color P { color:pink; } H1 { color : MediumSeaGreen; } Text Alignment Text-align Center / Left / Right / Justify P { Text-align : center; } Font type Font-family P { Font-family : “Times New Roman”; } Font Style Font-style Normal / Italic P { Font-family : “Times New Roman”; Font-style : Italic; } Chapter Pages Formatting Properties Values Example Font Style (Bold) Font-weight Normal / Bold P { Font-family : “Times New Roman”; Font-style :