css| Tips
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
. warning or. Notification. The great advantage of meaningful class names is that they can be reused throughout the site. For example, you can also use the. Notification class on other types of messages to apply a completely different style depending on where they are located in the document.
The name of the difference
A good name
Red
Error
Leftcolumn
Sometimes, we can extract the common parts of multiple class selectors or ID selectors, HTML selectors, and write together, so the advantage is that we can simplify the CSS file1. Let's first look at a piece of code. CSS, as follows:@charset "Utf-8";/*CSS Document*//*Admissions Ads*/. Ad_stu{width:136px;Height:196px;Ba
Pseudo-Class selector inductionPseudo-class selectors are much more difficult to remember without classifying them. We can divide him into two categories first.
Related to the element itself, similar to the link click before the click
is related to the structure in which the element is located in the DOM structure, similar to the nth element, or an odd line.
It is related to the state of t
-origin:padding-box; Border-box: Starting from the outside frame show Padding-box: Starting from the inner margin Content-box: Start */7 from the content. Background picture clipping position background-clip:content-box;8. Composite properties for background back Ground:red URL (".. /.. /img/j.png ") no-repeat 20px 20px; It combines these four properties Background-color, Background-image, Background-repeat, background-position Two, sprite Figure 1. Entry explanation
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.
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 ID selector in the
Text text colorIf the text is a link, the text is dimmed when you move the mouse over the linked text. text-muted: Grey. Text-primary: Light Blue. Text-success: Green. Text-info: Dark blue. text-warning: Orange. Text-danger: RedText position. Text-left: Text left Justified. Text-center: Text Center alignment. text-right: Text right-alignedWrap text. text-justify: Text alignment, out of screen part text wrapping. TEXT-NOWRAP: Paragraph beyond the screen part does not wrapText case. text-lowercase
css| Skills | Web page
ID and class How to use, in the title of the use of the principles and techniques, the use of principles and techniques here is my summary of experience, not from which the book, so is not what authoritative discussion, please users in this article when you need to have assertive reading, do not be confused by my bogey.
The use principle of ID and
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
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
[Switch] CSS target pseudo Class E: target CSS3 target pseudo class has to talk about those things (implement tab switching with pure CSS)
Do you think target is a little familiar ?!
What I want to talk about todayNoThe HTML tag has a target attribute.
The target pseudo class
Difference between css style and class, cssclass
Problem description:
After clicking the export button on the webpage, the table content on the page is saved as an excel file, but the table style cannot be saved.
Analysis process:
1. Use a class instead of a style in a table. The class definition is not exported
1. Use class_name to write the class name.I used to like writing with class-name, but it seems that there is no difference between the two. However, I am opposed to writing class names using className because I have always been skeptical about Browser case sensitivity. However, I will write the id as a camper. For the reason, see the next one.
2. Style uses
First, write the class name in Class_name way.
I used to like to write with Class-name, but it seems that there is no difference between the two. But I'm more opposed to writing class names with ClassName because I'm always skeptical of browser-sensitive issues. But ID I'll write hump style, for the next one.
Second, the style is used
Class SelectorIn CSS, the class selector is displayed with a point number:
Copy Code code as follows:
. 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
(1). Link pseudo-Class useA: link {color:pink;}-----not clickedA: visited{color:skyblue;} -----already clicked on the linkA: hover{color:red;} -----The color change of the mouse move a: active{color:black;} ----The color change of the selected linkTips:In the CSS definition, a:hover must be placed after A:link and a:visited to be validIn the CSS definition, a:act
The native JS method "Document.getelementsbyclassname" is not available in IE8 and the following browsers, so it writes a method compatible with IE.The full page code is as follows:Testjsgetcssclass.htmlhtml>head>style type="Text/css">. Test_class_div {font-size : 14 px ; border : 1 px Solid #ccc ; margin : px ; padding : 5 px ; font-weight : bold ; color : red ; Span class= "Hljs-ru
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.