Get the App
SLTechnology News&Howtos  ›  Development  › 

What does the css style consist of

Shulou Source: shulou.com Published: 2022-06-01 06:12:05 10月02日 Update

Most people do not understand the knowledge points of this article "what the css style consists of", so the editor summarizes the following content, detailed content, clear steps, and has a certain reference value. I hope you can get something after reading this article. Let's take a look at this "what constitutes the css style" article.

Recognize the css style

CSS, known as "cascading style sheet (Cascading Style Sheets)", is mainly used to define the display style of HTML content in the browser, such as text size, color, font bold and so on.

Such as the following code:

P {

Font-size:12px

Color:red

Font-weight:bold

}

One of the advantages of using CSS style is that by defining a style, you can make text in different web page locations have a uniform font, font size, color, and so on.

CSS code syntax

The css style consists of selectors and declarations, which in turn consist of attributes and values

Selector {attribute: value}

P {color:red;}

Selector: also known as selector, indicates the elements in the page to which style rules are applied, for example, in this case, the text of all paragraphs (p) in the page will turn blue, while other elements (such as ol) will not be affected.

Declaration: what is in the English curly braces "{}" is the declaration, separated by the English colon ":" between the attribute and the value. When there are multiple declarations, the middle can be separated by an English semicolon, as follows:

P {font-size:12px;color:red;}

The above is about the content of this article on "what the css style consists of". I believe we all have a certain understanding. I hope the content shared by the editor will be helpful to you. If you want to know more about the relevant knowledge, please follow the industry information channel.

Tags: Style content selection attribute text web page English code element font that is article knowledge article color difference value location full name Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Apple macOS MariaDB Redmi MySQL