Aviva Directory » Computers & Internet » Data Formats & File Extensions » CSS

CSS stands for Cascading Style Sheets. CSS is used to describe how HTML elements are to be displayed on the screen or in other media. As the layout of multiple web pages can be controlled through CSS, it has the potential of reducing the amount of time involved in creating and maintaining a website, and enhancing the continuity of its look and feel.

Developed for the World Wide Web Consortium in 1996, CSS has become an integral part of web pages, along with HTML, JavaScript, and PHP.

Before the introduction and widespread acceptance of CSS, web designers and developers were using HTML for formatting purposes, and web sites were becoming unwieldy. CSS was designed to separate styling from structural markup, or presentation from content. Through CSS, presentation instructions are stored in a separate file, which could be included in the document through the use of a link tag, and the presentational HTML elements were replaced by CSS to provide for improved versatility and accessibility. CSS allows web designers to define or modify the look of a webpage by making changes in the stylesheet without manipulating the HTML code.

CSS can be incorporated in HTML through the use of inline styles, internal styles, external stylesheets, or by using the import command.

Inline styles are not often used because they complicate the code, placing it back into the HTML document. Internal styles are used when the designer wants to define the styling for the entire page. CSS is embedded into the HTML code using the style tag, generally placing it between the head tags.

The preferred practice for incorporating CSS into HTML code is through the use of external stylesheets, which is maintained as a standalone document. A code snippet is included in the head section of the HTML code to invoke the CSS stylesheet.

The import command might be used to supplement the external stylesheet when a new requirement comes up for, let's say, a font color to be changed to blue on one specific page, when it is defined as black in the main stylesheet. A new stylesheet can be created and given a unique name, then the change can be invoked using the import command. In that way, only the one page is affected, while all the others remain the same.

Most commonly, then, the external stylesheet is the preferred method of incorporated CSS into a web site, while the import command might be used if one particular page has need of a unique style.

Cascading Style Sheets are designed to separate presentation features, such as layout, colors, and fonts, from the HTML document. This can allow for better content accessibility, more flexibility, and improved control over the characteristics of the presentation, allowing multiple web pages to share the same format specifications through the relevant CSS in an external stylesheet. Separating the formatting from the content allows the designer to present the same markup page in different styles for different rendering methods, such as on-screen or in print, removing the need for a separate print version. There are also CSS rules for alternate formatting if the content is accessed through a tablet computer or mobile device.

CSS specifications are maintained by the World Wide Web Consortium, which maintains a free CSS validation service for CSS documents. Plain XML, XHTML, SVG, and XUL markup languages also support Cascading Style Sheets.

The focus of this category is on Cascading Style Sheets, more commonly known as CSS. Topics relating primarily to CSS are appropriate for this category.

 

 

Recommended Resources


Search for CSS on Google or Bing