Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

What are the three representations of Css in HTML documents?

2025-01-19 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

Shulou(Shulou.com)06/02 Report--

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.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Development

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report