In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-20 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)05/31 Report--
This article mainly introduces "which label is used to introduce css style". In daily operation, I believe many people have doubts about which label is used to introduce css style. Xiaobian consulted all kinds of materials and sorted out simple and easy to use operation methods. I hope to answer your doubts about "which label is used to introduce css style"! Next, please follow the small series to learn together!
The label used to introduce CSS styles is "". The link tag is used to define the relationship between a document and an external resource. The most common use is to link to an external CSS style sheet. The syntax is "". When the page loads, css styles introduced by the link tag are loaded at the same time.
Operating environment of this tutorial: Windows 7 system, CSS3 && HTML5 version, Dell G3 computer.
The label used to introduce CSS styles is "".
CSS external stylesheets must be imported into a web document in order to be recognized and parsed by browsers. External style sheet files can be imported into HTML documents in two ways.
Introduction using labels
introduced using the @import keyword
The following article will take you to talk about labels in detail.
Tags define a document's relationship to external resources. Its most common use is linking style sheets.
Note:
In HTML, tags do not end with tags.
In XHTML, tags must be closed correctly.
Use the link tag to introduce css-style syntax
Description of each attribute:
The href property sets the address of the external style sheet file, either relative or absolute.
The rel attribute defines the associated document, which means the associated stylesheet.
The type attribute defines the type of the imported file. Like the style element, text/css indicates CSS text files.
Description:
Generally, when defining labels, the above three basic attributes should be defined, where href is the attribute that must be set.
You can also add a title attribute to the link element to set the title of the optional style sheet, that is, when a web page document imports multiple style sheets, you can select the style sheet file to be applied by the title attribute value.
The title attribute is associated with the rel attribute, and the W3C organization plans for future web documents to import different external files using multiple elements, such as style sheet files, script files, theme files, and even other supplemental files customized by individuals. After importing so many files of different types and names, you can use the title attribute to select them. At this time, the role of the rel attribute appears. It can specify the imported file type applied when the web page file is initially displayed. Currently, only CSS style sheet types can be associated.
External styles are the best way to apply CSS. A style sheet file can be referenced by multiple web files, and a web file can import multiple style sheets by repeatedly using the link element to import different style sheet files.
Extended knowledge: Difference between link and @import
1. Difference in subordination
@import is CSS syntax rules, only import style sheet role;link is HTML provided tags, not only can load CSS files, but also can define RSS, rel connection properties.
2, loading order difference
CSS introduced by the link tag is loaded when the page loads; CSS introduced by @import is loaded after the page loads.
3. Compatibility distinction
@import is CSS2.1 syntax, so it can only be recognized in IE5+;link tag as HTML element, there is no compatibility problem.
4. DOM Controllability Difference
You can change styles by manipulating DOM with JS and inserting link tags; since DOM methods are document-based, you can't insert styles using @import.
At this point, the study of "which label is used to introduce css style" is over, hoping to solve everyone's doubts. Theory and practice can better match to help everyone learn, go and try it! If you want to continue learning more relevant knowledge, please continue to pay attention to the website, Xiaobian will continue to strive to bring more practical articles for everyone!
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.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.