In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-02-28 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/01 Report--
This article introduces the relevant knowledge of "CSS Grammar and Selector instance Analysis". 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 to CSS
The full name of css is Cascading Style Sheets in English and cascading style sheets in Chinese. It is a computer language used to express the style of HTML files. It can not only modify the web page statically, but also format the elements of the web page dynamically with various scripting languages.
The characteristic of CSS is that it provides a style description for HTML markup language and defines the display mode of the elements in it. It can modify a small style to update all the page elements associated with it.
CSS syntax
The structure of a css consists of a selector and one or more declarations. Each declaration is made up of attributes and attribute values. Style attribute is the style property you want to set (style). Each property has a value. Properties and values are separated by colons. The declaration is separated by a semicolon.
Selector {property:value}
Give you a chestnut and add a red font to h4:
The css style is as follows:
H4 {color:#f00;}
For children's boots, look at the chestnuts above. H4 is the selector, color is the set style attribute, and # f00 is the attribute value.
If you want to add styles to h4, just write after the semicolon, for example, set the font size to 24px
H4 {color:#f00;font-size:24px;}
Grouping of selectors
In a web page, it is inevitable that many elements have the same style, so we can group selectors so that the grouped elements share the same set of styles.
P,h4 {color:#f00;}
In the above example, all p and h4 elements are set to red font colors.
Inherit
In CSS, child elements can inherit parent element attributes.
The two child elements in body are h4 and p, which add attributes to the body element and set the font color to red.
Add a color attribute to body
Display in the browser:
Child elements inherit parent element attributes
Through CSS inheritance, the h4 and p elements inherit the attributes of the parent element body.
This is the end of "CSS Grammar and Selector instance Analysis". 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!
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.