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

Where css stylesheets can be placed

2025-02-24 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

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

This article will explain in detail where css stylesheets can be placed. The editor thinks it is very practical, so I share it with you as a reference. I hope you can get something after reading this article.

Css stylesheet can be placed: 1, the use of style attributes on a single HTML element tag, syntax "; 2, put in the style tag pair, syntax" style "; 3, put in the extension" .css "in the external text file.

The operating environment of this tutorial: windows7 system, CSS3&&HTML5 version, Dell G3 computer.

Where css stylesheets can be placed:

1. Put it on the HTML tag

Use the style attribute to add directly to a single HTML element tag to control the presentation style of the HTML tag.

This way of introducing CSS is decentralized, flexible and convenient, but it is lack of integrity and planning, which is not conducive to later modification and maintenance. when you need to modify the style of the website, a same modification may involve multiple places, and the maintenance cost is high. The style effect of using the STYLE attribute is the strongest, overriding the same style effect of several other introduction methods.

2. Put it in the label pair

Write the style code on the page. In the label

Bdoy {font-size:14px;}

The tag structure can be anywhere in the page tag, or it can appear multiple times. Usually the whole. The structure is written in the section of the page. The characteristic of this way of introducing CSS is that the CSS code of each page may have unity and planning, and it is easy to reuse and maintain within one page, but the reuse of CSS code between multiple pages is still not enough.

3. Put it in an external .CSS file

If a CSS style is placed in a file outside a web page document, it is called an external style sheet, and an CSS style sheet document represents an external style sheet.

In fact, an external stylesheet is just a text file with a .css extension. When the CSS style code is copied into a text file and saved as a .css file, it is an external style sheet. As shown below:

External stylesheets must be imported into a web page document before they can be recognized and parsed by the browser. External stylesheet files can be imported into HTML documents through "" tags "or" @ import "rules

This is the end of the article on "where css stylesheets can be placed". I hope the above content can be helpful to you, so that you can learn more knowledge. if you think the article is good, please share it for more people to see.

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