Home >Web Front-end >Front-end Q&A >What are the characteristics of css style sheet

What are the characteristics of css style sheet

青灯夜游
青灯夜游Original
2021-11-18 17:25:457917browse

Features of css style sheets: 1. Rich style definitions; 2. Easy to use and modify, CSS style sheets can store all style statements in a unified manner and conduct unified management; 3. Multi-page applications can be implemented Unification of multiple page styles; 4. Cascading; 5. Page compression to reduce download time.

What are the characteristics of css style sheet

The operating environment of this tutorial: Windows 7 system, CSS3 version, Dell G3 computer.

What is CSS

CSS is the abbreviation of Cascading Style Sheet, which is translated into Chinese as "cascading style sheet". It is used to control web pages. Styles, a markup language that allows you to separate style code from web content.

Simply put, the introduction of CSS is to make the HTML language better adapt to the art design of the page.

CSS was reviewed and recommended by the W3C in 1996. The introduction of CSS immediately triggered new climaxes in web design, and excellent pages designed using CSS emerged one after another.

W3C is the abbreviation of World Wide Web Consortium, which is translated as "World Wide Web Alliance" in Chinese. It is a Web standardization organization. In addition to developing CSS standards, W3C has also developed more than 200 web technology standards such as HTML and XML.

CSS is based on HTML language and provides rich formatting functions, such as fonts, colors, backgrounds and overall layout, etc., and web designers can set different styles for various visual browsers Styles, including monitors, printers, tablets, phones and other mobile devices.

Features of css style sheet:

1. Rich style definition

CSS provides It provides a rich document style appearance and the ability to set text and background properties; allows the creation of a border for any element, as well as the distance between the element border and other elements, and the distance between the element border and the element content; allows the text case to be changed at will methods, modifications, and other page effects.

2. Easy to use and modify

CSS can define the style in the style attribute of the HTML element, or in the header part of the HTML document, or Styles can be declared in a special CSS file for reference by HTML pages. In short, CSS style sheets can store and manage all style declarations in a unified manner.

In addition, elements of the same style can be classified and defined using the same style, you can also apply a certain style to all HTML tags with the same name, or you can assign a CSS style to a certain in page elements. If we want to modify the style, we only need to find the corresponding style statement in the style list and modify it.

3. Multi-page application

CSS style sheet can be stored in a separate CSS file, so that we can use the same CSS style sheet in multiple pages . Theoretically, CSS style sheets do not belong to any page file and can be referenced in any page file. In this way, the styles of multiple pages can be unified.

4. Cascading

Simply put, cascading is to set the same style multiple times on an element, which will use the last attribute value set. For example, if you use the same set of CSS style sheets for multiple pages in a site, and if you want to use other styles for some elements in some pages, you can define a separate style sheet for these styles and apply them to the page. These styles defined later will override the previous style settings, and what you see in the browser will be the style effect set last.

5. Page compression

In websites that use HTML to define page effects, a large number or repeated tables and font elements are often required to form text styles of various specifications. The consequence of this is that a large number of HTML tags will be generated, thereby increasing the size of the page file. Putting the style declaration separately in the CSS style sheet can greatly reduce the size of the page, so the time spent loading the page will also be greatly reduced.

In addition, the reuse of CSS style sheets reduces the size of the page to a greater extent and reduces the download time.

(Learning video sharing: css video tutorial)

The above is the detailed content of What are the characteristics of css style sheet. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn