CSS allows users to control the form and positions of fonts, colours, spacing and visual images in HTML document. One of the significant advantages of using Style Sheets is that a number of documents which contents are controlled by a single CSS document can be modified at the same time. This is an effective and efficient solution when manage a web site which consists of a series of pages. In order to apply Style Sheet to HTML documents, we need to reference the location of .CSS file between head tags in HTML document.
Basically, CSS consists of two main parts, which are Selectors and Declarations, which can be separated to Properties and Values. By specifying them, users can control presentation of web pages any how they want. For example:
P { color:#FF0000 }
This makes color of a text in paragraph tags red. In addition to this CSS has additional features which are Class and ID. Both of them allow users to add original values to specific part of the content in HTML document.
Block elements and Inline elements are important concept as well. Paragraphs and headings are considered as block elements whereas text itself is defined as inline elements. While block elements can contain other block elements and inline elements, inline elements can’t contain any other elements.
Although CSS is useful and effective to display contents, it can be said that it requires experience and professional knowledge to use as there are some problems such as margin collapse and interpretation is depends on each browsers.
This is a example of 3 different CSSs adopted to a HTML code in my web space.
JavaScript programming called CSS switcher is used to demonstrate 3 different CSSs.
No comments:
Post a Comment