-
Feb2
Why use a style sheet?
Filed under: Frequently Asked Questions, Technology; Tagged as: Frequently-Asked-Questions, TechnologyWhy use a style sheet? In the past, formatting instructions were embedded in HTML. So a block of text to be shown in 16 point red Times Roman ended up being surrounded by the tags <FONT FACE=”Times”> <FONT COLOR=”red” > <FONT SIZE=”16pt”> (before the text) and </FONT></FONT></FONT> (after it). This takes a lot of effort, tags have to be frequently opened and closed. It is easy to put a closing tag in the wrong place or forget to add one, with unintended effects on the page display. It is difficult to read and edit the page text when there is a forest of embedded layout tags. It is very difficult to change the appearance of a page, as you need to edit huge numbers of separate tags. This becomes really important in dynamic webpages, where content is supplied from a database on request. It’s also very important where you want to keep a consistent look throughout several, even hundreds of pages.
For several reasons, people who care about the structure of webpages prefer to see more elegant code, with layout tags kept separate from structure identifiers. Hence, style sheets are the preferred mechanism for creating modern webpages. It’s a good general principle to use css, wherever practicable.
Tags: CSS Design Web Design Style Sheets Compuskill FAQ Frequently Asked Questions

Comments