Monday 28 September 2009

3.6 CSS

The success of the Internet lead to more visually and semantically complicated web documents. As a consequence the HTML code describing a web page was being cluttered by styling information and this had an adverse effect on the quality of the code. Additionally the need to maintain common aesthetics for related web pages lead the W3C to create the DOM(Document Object Model) and the CSS(Cascading Style Sheets) standards to encourage a better and more efficient web design.

DOM is a concept that takes advantage of the XML structure of the XHTML markup and provides ways to traverse, access, extract and apply properties of the elements included in an HTML page.
It considers every HTML document as a tree with hierarchically arranged elements as its nodes which in turn can have more nodes as children or can contain text (REF). Different web technologies (like JavaScript) are implementing the DOM model in different ways, but the premises are the same.

CSS uses special syntax to access and apply visual styles to any elements inside an HTML page and instructs the web browser on how to display those. It helps separating style from content by allowing single CSS files to be used by multiple web pages on the site, allowing changes of the look of those at the same time. This additionally benefits network traffic, as the browser cashes the files and doesn’t need to download them all the time.(REF)

Not all web browsers interpret CSS tags the same way. Older versions of Internet Explorer have a very limited support which resulted in scrambled page styling. Web developers have found and implement workarounds to bypass browser specific limitations, however this sometimes leads to cryptic and intelligible CSS code, violating the separation of style from content principles.

On my personal web space I’ve used CSS to provide a consistent look and feel, and there are examples of CSS inheritance and override via the class and id attributes.

No comments:

Post a Comment