In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-02-27 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/02 Report--
This article mainly explains "which three components of css grammar". The content of the explanation is simple and clear, and it is easy to learn and understand. Please follow the editor's train of thought to study and learn "which three components of css grammar".
Css syntax consists of three parts: selector (Selector), property (attribute), and value (value). The selector refers to the object for which the style is encoded; the attribute is the core of the CSS style control, is the attribute you want to change, and each attribute has a value; the syntax "selector {attribute: attribute value}".
The operating environment of this tutorial: windows7 system, CSS3&&HTML5 version, Dell G3 computer.
Css syntax consists of three parts: selector (Selector), property (attribute), and value (value).
Selector (Selector) refers to the object for which this set of style codes are targeted, which can be a XHTML tag, such as body,h2; or a tag that defines a specific ID or CLASS, such as # main selector for selection, that is, an object that is specified with main as id. The browser will strictly parse the css selector, and each set of styles will be applied to the corresponding object by the browser.
Property is the core of CSS style control. For every tag in XHTML, CSS provides rich style attributes, such as color, size, positioning, floating mode, and so on.
Value (value) refers to the value of the attribute, there are two forms, one is a specified range of values, such as float attribute, it is only possible to apply three values of left,right,none, such as width can use 0-9999 it, or other mathematical units to specify.
The selector is usually the HTML element or tag you want to define, the property is the attribute you want to change, and each attribute has a value. Properties and values are separated by colons and surrounded by curly braces to form a complete style declaration (declaration):
Selector {property: value} selector {attribute: attribute value}
Example:
Body {color: blue}
The purpose of the above line of code is to define the text color within the body element as blue. In the above example, the body is the selector, and the part enclosed in the curly braces is the declaration. The declaration consists of two parts: the attribute and the value, with color as the attribute and blue as the value.
Multiple statements:
Tip: if you want to define more than one declaration, you need to separate each declaration with a semicolon. The following example shows how to define a central paragraph of red text. The last rule does not require a semicolon, because a semicolon is a separator in English, not a closing symbol. However, most experienced designers put a semicolon at the end of each statement, so the advantage is that when you add or subtract statements from existing rules, you minimize the likelihood of errors. It's like this:
P {text-align:center; color:red;}
You should describe only one attribute per line to enhance the readability of the style definition, like this:
P {text-align: center;color: black;font-family: arial;}
Space and case sensitivity
Most stylesheets contain more than one rule, while most rules contain more than one declaration. The use of multiple declarations and spaces makes the stylesheet easier to edit:
Body {
Color: # 000 background: # fff;margin: 0 position padding: 0 position Font house family: Georgia, Palatino, serif;}
Whether or not to include spaces does not affect how CSS works in the browser, and again, unlike XHTML, CSS is not case-sensitive. There is one exception: class and id names are case-sensitive when it comes to working with HTML documents.
CSS Advanced Syntax: grouping of selectors
You can group selectors so that grouped selectors can share the same declaration.
Separate the selectors that need to be grouped with commas. In the following example, we group all the title elements. All the title elements are green.
Thank you for your reading. The above is the content of "which three components of css Grammar". After the study of this article, I believe you have a deeper understanding of the question of which three components of css grammar. The specific use of css grammar also needs to be verified by practice. Here is, the editor will push for you more related knowledge points of the article, welcome to follow!
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.