How to introduce CSS style into html
This article mainly shows you "html how to introduce CSS style", the content is easy to understand, clear, hope to help you solve doubts, the following let the editor lead you to study and learn "html how to introduce CSS style" this article.
Introduce CSS style
CSS is very flexible to use, either embedded in an HTML document or a separate file, which must have a .css extension if it is a separate file. There are three common ways to combine CSS and HTML:
(1) inline style
Inline style sets the style of the element through the style attribute of the tag.
Small gray
Inline style controls the style through the attributes of the tag, which does not separate the structure from the presentation (HTML display structure, CSS display effect), which are rarely used. The learning phase is sometimes used occasionally in order to program quickly.
(2) Internal style
The internal style, also known as embedded style, unloads the header tag body of the HTML document from the CSS code set and uses the tag definition.
Styles multiple tags in the current html file.
Use tags in html tags to define CSS
Body {background-color: # ddd;}
(3) external style
External styles, also known as chained styles, place all styles in one or more external stylesheet files with a .css extension and connect styles to HTML documents through tags.
The biggest advantage of chaining is that the same CSS stylesheet can be linked by different HTML pages, while a HTML page can also link multiple CSS stylesheets through multiple tags.
The above is all the content of the article "how to introduce CSS style into html". Thank you for reading! I believe we all have a certain understanding, hope to share the content to help you, if you want to learn more knowledge, welcome to follow the industry information channel!