In the Web front-end development has been in touch with HTML, CSS, JavaScript.In this process, you often use the span, div element, and CSS selectors in HTML.To make it easy to find the basics of these things, record them here.First, HTML HTML The If used with CSS, the,Another common use of the HTML HTML The When used with CS
In jquery, you can easily use CSS class names and IDs to get elements.
For example:
1 ID: #id
$ (' #ida ')-selects all elements with an ID of IDA, regardless of the tag name of the element.
$ (' Div#ida ')-Select all div tag elements with id Ida.
2 Class:.classname
$ ('. ClassA ')-Select the class name to have a class
, the parent element contains only one child element, and the child element matches E.11:e:only-of-type, the selection parent element contains only one child element of the same type, and the child element matches the E12:e:empty: Selects an element that has no child elements and does not contain a text node.
Negation pseudo-Class selector:E:not (f), matches all E elements except F.
Property selector:1.E[ATTR]: Select match E element with attr att
CSS size: Allows you to control the height and width of the element. Again, you are allowed to increase the line spacing.
CSS classification: Allows you to control how elements are displayed, where the image is displayed in another element, position the element relative to its normal position, use absolute values to position the element, and the visibility of the element.
Core tips: Class can be reused and IDs can only be used once in a page. It is possible that using the same ID repeatedly in a large number of browsers will not cause problems, but it is definitely wrong to use on the standard and is likely to lead to some real-world problems with browsers.
Class can be reused and IDs can only be used once in a page. It is possible that using the same ID repeatedly in a lar
css| Specification | A normalized web developer can identify the div and other formatting page elements by creating the class and ID names of the CSS and using those names. For developers, when naming CSS selectors for redefining XHTML tags (tags), you must ensure that they match exactly the predefined tags, but in ter
In CSS, the class selector is preceded by the class name with a dot number, if the multi-class is not to hit more than one point number and the. Important.urgent this form.
Class SelectorIn CSS, the
Define a style for a linkA:link indicates that the link has not been visited, the mouse has not been crossed and clickedA:visited represents a link that has been visitedA:hover represents a link to the mouse strokeA:active means the active link, that is, the moment the mouse clicks on the linkNote that the above four linked pseudo classes in the use of a certain order, that is the order listed above, otherwise do not see the effect. It can be simply written as Love (contains link and visited ini
The word "CSS" is so strange that it seems to me more like a label that identifies a particular state.
And the classes in the program.
Pseudo-Class with: Following the selector, identifies some states
:: Indicates CSS3 some new pseudo class, the suggestion all uses::. I don't support CSS3 's browser this year.
Examples of these pseudo classes:
Link links are
CSS Id and Class selectorIf you want to set CSS styles in HTML elements, you need to set the "id" and "class" selectors in the element.One, ID selectorThe ID selector can specify a specific style for an HTML element that is labeled with a specific ID.The HTML element sets the ID selector with the id attribute, and the
, so it is a pseudo element that has been preceded by a two colon in the CSS3 selector. Please see: w3cselect
Here's the problem, so why do we usually use before and a colon before?
When you look at the CSS2 selector, you know, in the old specification, the pseudo class and pseudo element all use a colon, the new specification in order to differentiate, the pseudo element unifies uses two "::", therefore, everybody notices, later writes the CSS3, fo
element*/abbr,acronym{Border:None;font-variant:Normal;}/*consistent del style*/del{text-decoration:Line-through;}Address,caption,cite,code,dfn,em,th,var{Font-style:Normal;Font-weight: -;}/*Remove the identification before the list, and Li will inherit*/Ol,ul{List-style:None;}/*alignment is the most important factor in typography, so don't let anything get centered.*/caption,th{text-align: Left;}/*from Yahoo, let the title be customized, adapt to multiple system applications*/
inserted after the title content. This is the pseudo-element: the role of After.: The content of after pseudo-class can also be followed by other parameters,One: String for example:1Styletype= "Text/css" >.test:after{: "test Code" }; 3 style>4 div class= "test" > Test div: div> The result of the operation is shown as: Test div: Test codeTwo: attr (x), attr is
The jquery support method is used to manipulate CSS properties of HTML elementsThe following method provides a CSS action method for jquery:
AddClass () – adds one or more CSS classes to the specified element.
Removeclass () – Deletes one or more CSS classes for the specified element.
Toggleclass () – Toggles betwee
In CSS, the class selector is displayed with a point number:. Center {Text-align:center}In the above example, all HTML elements that have the center class are centered.In the following HTML code, the H1 and P elements all have the center class. This means that both will comp
9. Class of CSS and ID selectorThe difference between ID and class is that the same ID can only be used once for a page, and class can be unrestricted.Similarly, you can use a selector after the HTML selector to specify special HTML elements, such as the p.jam{value}, to act on the paragraph with the ' Jam '
A pseudo class can be viewed as a special class selector, a special selector that can be automatically recognized by browsers that support CSS. Its greatest use is that you can define different style effects on links in different states.
1. Grammar
The syntax of a pseudo class is to add a pseudo
Summary: Pseudo-Class (Pseudo classes) is a bolt of a selector that specifies the state of one or its associated selectors. They are in the form of Selector:pseudo class {Property:value;}, and simply use a half-width colon (:) to separate the selectors from the pseudo-class. CSS Many of the suggestions are not supporte
Although the CSS code has been written to use the class name to mark the elements, but this is more of their own habits, today to do a summary of the problem.Here are the specific reasons why this is doneOne: The class class name of the element can have many, and the ID name only has one. By adding multiple
Css id selector and CLASS selectorIn CSS, a selector is a pattern used to select elements that require adding styles.The attribute selector can select an element based on its attributes and attribute values.
Three basic selector types: Tag name selector, class selector, and ID Selector
The syntax is as follows:
1. Tag
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.