Introduction to CSSCSS (cascading style sheet, cascading style sheets) defines how HTML elements are displayed.When the browser reads the style sheet, it formats (renders) the document according to this style.CSS Syntax CSS instanceEach CSS style consists of two parts: selectors and declarations. Declarations include attributes and property values. End with a semicolon after each declaration.Several ways to
CSS Selector
Selector,selector,selector {Property:value;property:value ...} CSS Selectors can be divided into two main categories: (signature, attribute) A. basic selector: Wildca
CSS, also known as style overlap table, today's web page style is basically div+css written out, the function is very powerful, want to introduce a CSS file in the HTML file need to enter a line in the Some basic CSS styles are not introduced, this in the manual and some of the learning site will have, you can check th
-of-type (1)
E:empty
Matches an element that does not contain any child elements, and the text node is also considered a child element
E:not (selector)
Matches any element that does not conform to the current selector
(vi) pseudo element selector
Selector
Css|select
The CSS selector selector is the basis for our CSS page layouts. CSS selector In the end what, how to use it rationally? Selectors can be divided into three categories, excep
not very good. jquery is much better than it in this field, providing many methods to obtain the IDS.
1. Basic selector (mainly including tag selector, id selector, class selector, General selector, and group selector)
$ ("# DivI
# # #CSS选择器的分类# # # #标签选择器Just use the tag name as a selector.Syntax: Tag Selector {CSS property name: CSS property value;}Weight: 1``````# # # #类选择器Using the class tag attribute value of an HTML element as a selector, you need to precede the value of the Tag property with "
I. CSS Selector overview 1.1, CSS FeaturesThe CSS language has two basic functions: match and renderWhen the browser parses a CSS style, it should first determine which elements need to be rendered, that is, which HTML elements to match, which is identified by the
Now IE7 has been launched for a period of time and penetrated into users. We don't have to wait too long to use more advanced CSS on the page. The two most useful items will be the Child and Adjacent Sibling selector. It is now time to use them to create web pages and study them in depth.Note that the selector includes the current symbol, ">", "
as imported as the first page without style, and then display the style of the page, which is the advantage of linking.Selector for two CSS (Selector)The selector indicates the object of the style in {}, which elements in the Web page the style acts on1 Base selector:*: Universal element
#https://www.crummy.com/software/beautifulsoup/bs4/doc/index.zh.html#find-all#beautifulSoup可以解析HTML, download the installation using PIP install BEAUTIFULSOUP4, the module is imported using BS4.Import BS4NOSTARCHSOUP=BS4. BeautifulSoup (Res.text)#bs4. The BeautifulSoup () function returns a BeautifulSoup object.#也可以像BeautifulSoup () passes a file object.Examplefile=open (' usepythondownloadhtml.html ')EXAMPLESOUP=BS4. BeautifulSoup (Examplefile.read ())#CSS
Compared to the XPath selector, it's easier to feel a CSS selector, which is basically the same as writing. CSS, which is different from XPath when getting content.
Here's how to extract data from an article with a CSS selectorThe extracted data is the same as the XPath ar
The original name can be like this
Some time ago, at a site to see this content:
"Is that okay?" Is my first impression of this. However, a little investigation to know, this writing is indeed effective. In addition, the sign expression of this _, does it look like there is a sense of existence? And then look at the matching CSS properties, Display:none!important; that is, the definition element must not be shown, is it also very consist
of the specified value.
[attribute*=value]
Matches each element of the property value that contains the specified value.
CSS ID Selector Detailed
CSS class Selector detailed
CSS Property Selec
normal
set content, if specified, normal, default is "None" (that is nothing)
Td>
set counter contents
counter
attr (attribute)
set content as one of the properties of the selector.
string
set content to text you specify
open-quote
Settings conte NT is an open quote
close-quote
set content is closed
1. Tag Selector style > a { font-size : 10px ; color : red ; Span style= "color: #800000;" >style > 2. *Represents wildcards, matches any label, even the body tag, and if you set the *, the body is also applied.3. #Represents the ID selector, the ID must be unique4,. (point)Representing class selectors, classes can be not unique, repeatable, and often can be seen in bootstrap, but there is on
A full HTML page is made up of a number of different tags, and the tag selector determines which tags take the appropriate CSS style. This article to the code farm introduced CSS tag/element selector and in fact, the need for code farmers can refer to."Tag Selector"A full HT
CSS selector records
Selector
Example
Example description
CSS
.Class
. Intro
Select all the elements of class = "intro.
1
#Id
# Firstname
Select all the elements of id = "firstname.
1
*
*
Select all elements.
2
Element
P
Select all
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.