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 style types of CSS

2025-01-16 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)05/31 Report--

This article mainly talks about "what are the three style types of CSS". Interested friends may wish to have a look. The method introduced in this paper is simple, fast and practical. Let's let the editor take you to learn "what are the three styles of CSS?"

Where can the CSS style be written? From the form of CSS style code insertion, it can be divided into the following three types: inline, embedded and external.

(1) inline style

Inline css stylesheets write css code directly into existing HTML tags, such as the following code:

The text here is red.

And css style code should be written in style= "" double quotation marks, if there are multiple css style code settings can be written together, separated by semicolons. The code is as follows:

The text here is red.

(2) embedded style

Embedded css style, that is, you can write css style code between tags. As in the following code, the text in the three tags is set to red:

Span {

Color:red

}

Embedded css styles must be written in between, and generally embedded css styles must be written in between.

(3) external connection style

External css style (also known as external style) is to write css code into a separate external file. The css style file has the extension ".css" and links the css style file to the HTML file using tags (not within tags), as shown in the following code:

Note:

1. The name of the css style file is named with meaningful English letters, such as main.css.

2. Rel= "stylesheet" type= "text/css" is fixed and cannot be modified.

3. The location of the label is generally written in the label.

Priority of the three methods

Priority: inline > embedded > external

At this point, I believe you have a deeper understanding of "what are the three style types of CSS". You might as well do it in practice. Here is the website, more related content can enter the relevant channels to inquire, follow us, continue to learn!

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

Servers

Wechat

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

12
Report