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 styles of CSS

2025-03-30 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

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

This article introduces the relevant knowledge of "what are the three styles of CSS". In the operation of actual cases, many people will encounter such a dilemma, so let the editor lead you to learn how to deal with these situations. I hope you can read it carefully and be able to achieve something!

Inline css style

Inline css stylesheets write css code directly into existing HTML tags:

This is a paragraph mark.

one

Take the style attribute. The range applies only to this label.

This method is more flexible, but it is troublesome to define the same style for multiple identical tags, so it is suitable for local modification.

Embedded css style

The use of tags in HTML documents is called embedded.

/ * selector {attribute: attribute value; attribute: attribute value;} * /

A {color:#FF0000;}

# img1 {width:800px;} / * id selector * /

.img2 {width:800px;} / * Class Selector * /

Hyperlink

Add tags to the head tags to uniformly modify multiple tags for this page.

This method can uniformly set the style of a single page, but it is not flexible enough for the part.

External css style

Use the label. For example:

The code for a.css is as follows

/ * selector {attribute: attribute value; attribute: attribute value;} * /

A {color:#FF0000;}

# img1 {width:800px;} / * id selector * /

.img2 {width:800px;} / * Class Selector * /

Introducing css into html

Hyperlink

External css style (also known as external style) is to write css code in a separate external file, this css style file with the extension ".css" (can also be used to call other Web sites CSS).

This is the end of the content of "what are the three styles of CSS". Thank you for reading. If you want to know more about the industry, you can follow the website, the editor will output more high-quality practical articles for you!

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