In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-04-07 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/01 Report--
Most people do not understand the knowledge points of this article "how to embed CSS code in html", so the editor summarizes the following contents, detailed contents, clear steps, and has a certain reference value. I hope you can get something after reading this article. Let's take a look at this "how to embed CSS code in html" article.
I. get to know CSS
CSS is the abbreviation of the English word Cascading Style Sheets, which is translated into "style sheet", also known as "CSS style sheet". Popular CSS is to control the page content color, font, text size, width, border, background, floating and other styles to achieve a variety of web page styles (CSS manual to learn more about control style attributes). Such as what a university is, there are computer, teachers, physics, chemistry, English and other professional departments and colleges in the university to form a university, this is the university.
II. CSS principle
Knowing the CSS principle is equivalent to finding the entrance to CSS's learning and entering the CSS world.
Let's get to the point, CSS principle model example: we know that both sides of the walkie-talkie must talk within a certain distance (walkie-talkie signal coverage area). Like CSS, CSS must be introduced correctly in order to be effective (recommend style and link, embedded CSS code and introduce embedded CSS) Both sides of the walkie-talkie can only talk within the range of the signal, and the most important thing is that the channel frequencies (FM frequencies) of both sides are the same, as is the case with CSS. For CSS to be effective, the CSS selector name of the CSS code needs to be the same as the CSS selector name referenced by the class value or id value in the HTML. In this way, after the CSS selector name is the same as the html application CSS class (class) value name, different style attributes are written in the CSS selector, and the html corresponding part of the web content style changes as you set different CSS attribute styles in the CSS selector.
HTML and CSS themselves are indispensable, and the style expressed by CSS code requires that the value of class or ID in html is the same as the name of the CSS selector.
Third, DIVCSS5 example-style html embedded CSS code method
CSS code (the code is put into the head start and end tags of html):
.yangshi {color:#F00;} / * defines the content as red * /
# abc {color:#0F0;} / * define the content as green * /
Corresponding to the html call (this code is placed in the body area):
I'm red.
I'm green.
The principle of CSS and the illustration of CSS examples.
1. The css attribute selector should have the same name as the name that uses CLASS or ID to introduce CSS into the DIV tag in html. (as in the example above, .yangshi {...} in CSS corresponds to HTML)
2. Where to write the CSS code (example above: using style to embed CSS code in html, of course, you can import CSS files outside of LINK)
3. The CSS attribute selector can be named by itself, while the CSS style attribute is fixed, for example, the width corresponds to width.
Pay attention to "yangshi" and "abc", corresponding to using class and ID in HTML, we need to understand the difference between CLASS and ID and CLASS ID usage.
From the CSS principle, we mainly learn the relationship between CSS and HTML.
You will come into contact with-you must learn and understand knowledge.
CSS height: learn to control the content and layout height of web pages
CSS width: learn to use CSS to control the width of web pages and layouts
CSS comments: learn to annotate and comment in CSS
Class id: be sure to figure out ID and CLASS
Css id: be sure to understand the role of ID
Css class: be sure to understand the usage and function of CLASS and the difference between CLASS and ID
CSS center: content center, layout center, vertical center, up and down, left and right center
CSS background: in-depth application of CSS background control method and CSS background
CSS fonts: learn to control text and fonts
CSS tools: learn and understand common CSS tools
CSS manual: be sure to collect CSS problems or words can provide online CS manual quick check
Fundamentals of html: necessary lessons before learning CSS
The above is about the content of this article on "how to embed CSS code in html". I believe we all have some understanding. I hope the content shared by the editor will be helpful to you. If you want to know more about the relevant knowledge, please pay attention to 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: 259
*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.