Cascading Style Sheets
Cascading Style Sheets (CSS) is a style sheet language used for describing the presentation of a document written in a markup language such as HTML. CSS is a cornerstone technology of the World Wide Web, alongside HTML and JavaScript.
CSS is designed to enable the separation of presentation and content, including layout, colors, and fonts. This separation can improve content accessibility, provide more flexibility and control in the specification of presentation characteristics, enable multiple web pages to share formatting by specifying the relevant CSS in a separate .css file, and reduce complexity and repetition in the structural content.
CSS can also allow the same markup page to be presented in different styles for different rendering methods, such as on-screen, in print, by voice (when read out by a speech-based browser or screen reader) and on Braille-based tactile devices. CSS specifies how elements must be rendered on screen, on paper, or in other media.
CSS has various levels of specificity: from simple global rules that apply to all elements on a page to complex rules that apply only to specific elements. The most common type of CSS rule is an element selector which identifies particular elements within an HTML document based on their element name or id attribute value. Other types of selectors include class selectors which identify elements based on their class attribute value; pseudo-class selectors which identify elements based on their state; attribute selectors which identify elements based on their attributes; and universal selectors which match any element type.
In addition to these basic selector types, CSS also supports various pseudo-elements that are used to style specific parts of documents such as quotes or formatting attributed to a particular element within it. Pseudo-elements are often used to create visual effects such as underlines or drop shadows.
CSS also provides various properties that allow authors to specify how fonts should be rendered (such as whether they should be italicized or bolded), how colors should be displayed (such as whether they should be displayed with full saturation or muted tones), how text should be aligned (such as left-, right-, center-, or justified alignment), how margins should be applied (such as whether they should have uniform spacing around them), how borders should be drawn (such as whether they should have rounded corners), and many other aspects of document presentation.
Finally, CSS provides various mechanisms for applying styles across multiple documents at once through linking documents together using @import statements or through using cascading rulesets that apply styles based upon certain conditions being met within the document tree structure. These mechanisms allow authors to create complex styling systems without having to manually apply each individual style rule throughout an entire website’s worth of documents.