WHAT IS LANGUAGE CSS |FULL DETAIL ITS EXTRA KNOWLEDGE

CSS
Cascading Style Sheets (CSS) is a style sheet language used to specify the presentation and style of a document written in a markup language such as HTML or XML (including XML dialects like SVG, MathML, or XHTML). [2] Along with HTML and JavaScript, CSS is a cornerstone technology of the World Wide Web. [3]
[4] This separation can improve content accessibility, as content can be written without concern for its presentation; provides greater flexibility and control in the specification of presentation attributes; enables multiple web pages to share formatting by specifying related CSS in a separate .css file, which reduces complexity and duplication in structural content; and It enables the caching of CSS files, thereby improving page load speeds across pages that share the same file and formatting.
The separation of formatting and content makes it possible to render a single markup page in different styles for various presentation methods—such as on a screen, in print, via audio (through speech-based browsers or screen readers), and on Braille-based tactile devices. There are also rules for alternative formatting when content is accessed. [5]
When multiple declarations for a single property match a specific element, the name ‘cascading’ is derived from the specific priority scheme used to determine which declaration takes precedence. This cascading priority scheme is predictable.
The CSS specifications are maintained by the World Wide Web Consortium (W3C). The Internet media type (MIME type) has been registered for use with CSS by RFC 2318 (March 1998). The W3C operates a free CSS validation service for CSS documents. [6]
In addition to HTML, other markup languages also use CSS, including XHTML, plain XML, SVG, and XUL. CSS is also used in the GTK widget toolkit.
Syntax
CSS syntax is simple, and it uses various English keywords to specify the names of different style properties.
Style Sheets
Main article: Style sheet (web development)
A style sheet consists of a list of rules. Each rule or rule-group comprises one or more selectors and a declaration block.
Selectors
“CSS Class” redirects here. For the element classes that form part of the HTML content model—upon which the CSS class selector syntax relies—see the class attribute (HTML).
In CSS, selectors specify which part of the markup a style applies to by matching the tags and attributes of the markup.
Selector Types
Selectors can apply to the following:
All elements of a specific type—for example, a second-level heading (h2).
Elements specified by an attribute—specifically:
ID: A unique identifier within the document, represented in the selector language by a hash prefix—for example:
Class:
An identifier capable of annotating multiple elements within a document, denoted by a dot prefix (.classname) (for instance, while the phrase “CSS class” is sometimes used, it is a misnomer, as an element class—specified via the HTML class attribute—is a markup attribute distinct from a browser’s CSS subsystems, and the relevant W3C/WHATWG standards documents pertain to styles; for the origins of the web content model’s “class” system, refer to RDF and Microformats).
Elements are positioned relative to other elements within the document tree.
Classes and IDs are case-sensitive; they must begin with a letter and may contain alphanumeric characters, hyphens, and underscores. A class can be applied to any number of instances of an element, whereas an ID can be applied to only a single element.
Pseudo-classes are used in CSS selectors to enable formatting based on information that is not present in the document tree.
A widely used example of a pseudo-class is one that identifies content only when the user “points” to a visible element—typically by hovering the mouse cursor over it. It is appended to a selector.
A pseudo-class classifies document elements—such as :—whereas a pseudo-element selects a portion of an element—such as [ 7 ] Note the distinction between the double-colon notation used for pseudo-elements and the single-colon notation used for pseudo-classes. :link :visited ::first-line ::first-letter
Combinators
Multiple simple selectors can be combined using combinators to target elements based on their position, element type, ID, class, or any combination thereof. The order of selectors is significant. For instance, this applies to all elements of the class that are situated inside div elements, whereas this applies to all div elements located inside elements of the class .
This should not be confused with combined identifiers—such as —which apply specifically to div elements belonging to the class .
Summary of Selector Syntax

The following table provides a summary of selector syntax, indicating its usage and the version of CSS that introduced it. [ 9 ]
Declaration Block
{} A declaration block consists of two curly braces ( ) enclosing a list of semicolon-separated declarations. [ 10 ]
Declaration
Each declaration consists of a property, a colon (:), and a value. [ 11 ]
Property
Properties are specified in the CSS standard. Each property has a set of possible values. Some properties can affect any type of element, while others apply only to specific groups of elements. [12] [13]
Values
Values can be keywords—such as “center” or “inherit”—or numerical values, such as 200px (200 pixels), 50vw (50 percent of the viewport width), or 80% (80 percent of the parent element’s width).
LET AS LEARN
Color values can be specified using keywords (such as “red”), hexadecimal values (such as), which can also be written in shorthand as #F00), RGB values on a scale of 0 to 255 (such as), RGBA values that specify both color and alpha transparency (such as), or HSL or HSLA values (such as. [14]
Non-zero numerical values representing linear measurements must include a length unit, which may be either an alphabetic code or an abbreviation—such as 200px or 50vw—or a percentage sign, such as 80%. Some units—cm (centimeters), in (inches), mm (millimeters), pc (picas), and pt (points)—are absolute, meaning that the displayed dimension does not depend on the page’s structure; others—em, ex, and px (pixels) [clarification needed]—are relative.
This means that factors such as the font size of the parent element can influence the displayed measurement. These eight units were a feature of CSS 1 [15] and were retained in all subsequent revisions. The proposed CSS Values and Units Module Level 3—if adopted as a W3C Recommendation—will introduce seven additional length units:
Uses
Before CSS, almost all presentational properties of HTML documents were contained within the HTML markup.
That is, all font colors, background styles, element alignments, borders, and sizes had to be explicitly described (often repeatedly) in the HTML. CSS allows authors to move much of that information into another file, the style sheet, resulting in significantly simpler HTML.
Furthermore, As an increasing number of devices become capable of accessing responsive web pages, a variety of screen sizes and layouts have begun to emerge. Optimizing a website for every device size is becoming both expensive and increasingly difficult. The modular nature of CSS means that styles can be reused across different parts of a site—or even across multiple sites—thereby fostering consistency and efficiency.
BE CONTINOU
For example, titles (h1 elements), subheadings (h2), sub-subheadings (h3), etc., are structurally defined using HTML. On print and screen, the selection of font, size, color, and emphasis for these elements depends on the presentation.
Before CSS, document authors—for instance, to apply specific typographic attributes to all headings—had to repeat HTML presentation markup for every single heading. This made documents more complex, larger, and prone to errors, and rendered them difficult to maintain. CSS allows for the separation of presentation from structure. CSS can define colors, fonts, text alignment, sizing, borders, spacing, layout, and numerous other typographic characteristics.
And it can do so independently for both on-screen and printed views. CSS also defines non-visual styles, such as reading speed and emphasis for audio text readers. The W3C has now deprecated the use of all presentational HTML markup. [ 17 ]
Sources
CSS, or Cascading Style Sheets, provides a flexible way to style web content. Styles are determined by browser default settings, user preferences, or web designers. These styles can be applied directly to an HTML document or through external .
css files for greater uniformity. This not only simplifies web development by promoting reusability and maintainability, Site performance is also improved because styles can be moved into dedicated .
css files that browsers can cache. Furthermore, this separation maintains the accessibility and readability of the content even if styles fail to load or are disabled, ensuring the site remains usable by all users, including those with disabilities. Its multi-pronged approach, This process—which involves considerations regarding selector specificity, rule order, and media types—ensures that websites remain visually consistent and adaptable across various devices and user requirements, thereby maintaining a balance between design objectives and user accessibility.
Multiple Style Sheets
Multiple style sheets can be imported. Different styles can be applied depending on the output device being used; for example, the screen version may differ significantly from the printed version, so authors can adapt the presentation appropriately for each medium.
Comprehensive
The style sheet with the highest priority controls the content display. Declarations that are not set in the highest priority source are They are deferred to lower-priority sources, such as user agent styles. This process is known as cascading.
One objective of CSS is to provide users with greater control over presentation. Those who find it difficult to read red, italicized headings can use a different stylesheet. Depending on the browser and the website, users can choose from various stylesheets provided by the designers.
You can either view the site using the browser’s default styling by removing all additional styles, or override only the red, italic heading style without altering other attributes. Browser extensions such as Stylish and Stylus have been developed to simplify the management of such user stylesheets. In the case of large projects, cascading can be used to determine…
It helps developers determine which styles should be given higher priority when integrating third-party styles with conflicting priorities, and it can also be utilized to resolve such conflicts. Furthermore, it can assist in creating designs with cascading themes, enabling designers to refine specific aspects of a design without compromising the overall layout.
Specificity
Specificity refers to the relative weight of various rules. [18] It determines which styles are applied to an element when more than one rule could apply. Based on the specification, a simple selector (such as H1) has a specificity of 1, class selectors have a specificity of 1,0, and ID selectors have a specificity of 1,0,0.
Inheritance

Inheritance is a key feature in CSS; it relies on an ancestor-descendant relationship. Inheritance is the mechanism by which properties apply not only to a specific element but also to its descendants.[18] Inheritance depends on the document tree, which is the hierarchy of XHTML elements in a page based on nesting. Descendant elements can inherit CSS property values from any ancestor element within them. Generally, descendant elements inherit text-related properties. However, their box-related properties are not inherited.
The properties that can be inherited are color, font, letter-spacing, line-height, list-style, text-align, text-indent, text-transform, visibility, white-space, and word-spacing. Properties that cannot be inherited include background, border, display, float and clear, height and width, margin, min- and max-height and width, outline, overflow, padding, position, text-decoration, vertical-align, and z-index.
