Definition of CSS (Style Sheets)
Miscellanea / / July 04, 2021
By Guillem Alsina González, in Sep. 2017
The style in which the texts and components of a Web page, as well as the set of several pages, can be marked from each and every one independently, or depend on an external element (another file in which styles are defined) that can be reused. This external element is what is called a CSS style sheet.
A CSS style sheet (cascading stylesheets, cascading style sheets) is nothing more than a computer file that contains information to model the visual style adopted by web pages when rendered by the browser.
For this to be the case, there must be a call to the CSS style sheet from within the HTML file, through a instruction.
Thanks to the separation of the content from what the aspect is, we obtain an abstraction that allows us various angles of Liberty.
The first is that if we want to change the aesthetics of a complete website, we will only have to retouch the worksheet files CSS style, so that if there are calls to these files in the HTML pages, the aesthetic change of form will occur automatic.
Another advantage is that the Author of the contents you will be able to focus on them without having to be aware of their layout, since this is given by the CSS files.
The style sheet is built from a design language with a specific and standardized structure, of form that the style sheet is independent of the technology that the web page serves and of which it is used to render it.
This is so due to the need for the web to be device independent, allowing any server serve the same contents, and that these are rendered with the same final result by any browser, regardless of whether some tools can do it more quickly than others and, therefore, offer better performance to the Username.
the same language definition can also be used in any XML document (after all, HTML can still be interpreted as a subset of XML).
The structure of the language is simple, with a series of reserved keywords that refer to properties of the style of a page, and several rules for each of these properties.
A simple example of a CSS style sheet would be the following:
body {
h1 {font-family: Helvetica, Geneva, Arial,
SunSans-Regular, sans-serif}
}
In it we simply define how the H1 header of the HTML documents that we write and are subject to this style sheet should be. For this, the HTML pages must have this sentence in the section HEAD:
In which
We can also include the layout instructions for the style in the same HTML file that we use for the page, thus saving us an extra file, but then we lose the versatility of changing the appearance of all the pages having only to manipulate a file, since we would have to modify all the HTML exactly the same.
The language in which the CSS style sheets are written already existed before their approval by the W3C, an entity that is in charge of regulating the standards used on the Web at a technical level.
It was approved in the mid-1990s and has since become a standard. indispensable for use on large websites.
Photo: Fotolia - Stringer
Themes in CSS (Style Sheets)