In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-04-13 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/03 Report--
This article is to share with you what are the three methods of applying CSS in HTML. The editor thinks it is very practical, so I share it with you to learn. I hope you can get something after reading this article.
Do you understand the method of applying CSS to HTML? here to share with you, there are mainly inline, internal and external three ways to apply CSS to Html, the internal style serves the entire current page, the external style serves multiple pages of the entire site, and the inline style goes directly into the HTML through the style attribute. I believe that the introduction of this article will give you a harvest.
Three methods of applying CSS in HTML
There are three ways to apply CSS to HTML.
Inline
Inline styles are nested directly into HTML through the style attribute.
It looks like this:
Sample code
Text
This will be the specified paragraph turns red.
Our suggestion is that HTML should be independent, style-free documents, so inline styles should be avoided in any case.
Inside
The internal style serves the entire current page. In the header tag head, the style tag style contains all the styles of the current page.
It looks like this:
Sample code
CSSExample p {color:red;} a {color:blue;}
This will make all paragraphs of the page red and all links blue. The inline style is similar, you should separate HTML documents from CSS documents.
External
External styles serve multiple pages of the entire site. This is a separate CSS document, and a simple example is as follows:
Sample code
P {color:red;} a {color:blue;}
If the document is saved as "web.css", it can be connected to the HTML document like this:
Sample code
CSSExample
Save the HTML document, now that HTML and CSS are connected, you can use the css tags you defined in the css file in your html.
These are the three methods of applying CSS in HTML. The editor believes that there are some knowledge points that we may see or use in our daily work. I hope you can learn more from this article. For more details, please follow the industry information channel.
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.