Get the App
SLTechnology News&Howtos  ›  Development  › 

What are the three representations of Css in HTML documents?

Shulou Source: shulou.com Published: 2022-06-02 00:02:31 09月29日 Update

This article mainly introduces the Css in the HTML document in the three forms of expression of what is the relevant knowledge, the content is detailed and easy to understand, simple and fast operation, has a certain reference value, I believe you read this Css in the HTML document in the three forms of what the article will have a harvest, let's take a look at it.

1. Inline style sheet

An inline stylesheet refers to writing the CSS style code in the HTML tag, as follows:

Html

Inline CSS style.

Inline stylesheets are supported by the style of the HTML element of the HTML element, simply by separating the CSS code with a semicolon in the style= "". This is the most basic form, but it does not achieve the separation of performance from content and does not have the flexibility to control multiple pages, so we rarely use it.

two。 Internal style sheet

An internal stylesheet is similar to an inline stylesheet by writing CSS code in a HTML page, except that the former puts the stylesheet in a fixed place, as follows:

Html

Internal style sheet

H2 {font-size:16px

Color:#000FFF

}

Internal CSS style.

Internal stylesheet coding is a primary application form and cannot be used across pages, so it is not suitable for use.

3. External style sheet

External stylesheet is the best form in CSS application. It puts the CSS style code in an external file and then invokes it by web page. Multiple web pages can call a stylesheet, which maximizes the reuse of code and optimizes the configuration of Web site files, as follows:

Html

External style sheet

External CSS style.

The code in style.css is

Css

@ charset "UTF-8"

H2 {

Font-size:16px

Color:#000FFF

}

This is the end of the article on "what are the three forms of Css in HTML documents?" Thank you for reading! I believe that everyone has a certain understanding of the knowledge of "what are the three forms of Css in HTML documents". If you want to learn more knowledge, you are welcome to follow the industry information channel.

Tags: Style form code document content file knowledge page element multiple article code web page application different maximum similar medium value location Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno MariaDB Microsoft MySQL NVidia Shulou Information