How to introduce css in head area
This article introduces the knowledge of "how to introduce css in head area". 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!
Introduction method: 1, use style tag to introduce, syntax "css code"; 2, use link to introduce, syntax "".
The operating environment of this tutorial: windows7 system, CSS3&&HTML5 version, Dell G3 computer.
There are two ways to introduce css into the head area:
Internal stylesheet-defined with style tags
External stylesheets-introduced with link tags
1. Internal stylesheet-defined with style tags
Write the css code centrally in the head header tag of the HTML document and define it with the style tag. The basic syntax format is as follows:
Css code
In syntax, the style tag is usually placed after the head tag, or you can place it anywhere in the HTML document.
General format of css code:
Css selector {attribute: value; attribute: value;.}
2. External stylesheets-- introduced with link tags
Place all styles in one or more external stylesheet files with the extension CSS, and link the external styles to the HTML document through link tags, with the basic syntax format as follows:
Rel attribute: defines the relationship between the current document and another linked document. "stylesheet" indicates that the linked document is a stylesheet file.
Href attribute: defines the URL of the linked external stylesheet file, either relative or absolute
This is the end of the introduction of how to introduce css in the head area. 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!