• CSS Faqs
29 June 2008

The CSS Frenzy

HTML tags serve to define a document’s content as if to say “This is a header” or “This is a paragraph” or “This is a table” using tags such as <h1>, <p>, <table>, etc. The browser is expected to configure an HTML document’s layout without the use of formatting tags.

However, it has become more complicated ever since major browsers like Netscape and Internet Explorer introduced new HTML tags and attributes, such as the <font> tag and the color attribute, on top of the original HTML specifications. Styling websites using HTML is now more complex, especially if the content of HTML files is separated from the document’s main layout.

Non-profit, standard-setting World Wide Web Consortium (W3C), which standardizes HTML, addressed this problem by coming up with STYLES in HTML 4.0.

Cascading Style Sheets are recognized by all major browsers. They exist to define how HTML elements, including the font tag and the color attribute, must be displayed in HTML 3.2. Styles are usually saved in an external CSS file, which when edited, could control the style of all web pages’ layout and appearance.

CSS is, therefore, a very significant phenomenon in the web design industry. It empowers designers in managing the style and design of several web pages through a single file. Thanks to CSS, web developers can now affix a style for a specific HTML element to be automatically applied to an unlimited number of pages. All it would take to carry out a major website overhaul is by simply altering the style and all other elements in the web.

Using style sheets allows various methods to specify style information. Styles can be designated within a single HTML element, such as the <head> element of an HTML page, or on an external CSS file. Multiple external style sheets could also be directed from one HTML document.

Overall, it could be said that all styles will “cascade” into a virtual style sheet if the following rules are followed (note that the fourth item should be given the highest priority):
1. Browser default
2. External style sheet
3. Internal style sheet (inside the tag)
4. Inline style (inside an HTML element)

Therefore, an inline style, which could be found inside an HTML element, will take prevalence over a style that was declared inside the <head> tag in either the external style sheet or in a browser.

Tags:

This entry was posted on 29 June 2008 at 3:53 PM and is filed under CSS Faqs. You can follow any responses to this entry through the RSS 2.0 feed. You can leave a response, or trackback from your own site.

Leave a reply

Name (*)
Mail (will not be published) (*)
URI
Comment