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
-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
: Before: The function of After is to insert an inline element containing the content specified by the content property before or after the specified element contents (not the element itself), with the following basic usage:#example:before { content: "#"; color: red;}#example:after { content: "$"; color: red;}This code inserts a ' # ' before the content of the #example element, and adds a ' $ ' after the content, and the inserted inline element is the child of the #example, with the
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
Addclass (class)-Add the specified class name for each matching element.Parameter: Class-names of one or more CSS classes to be added to an element. Separate them with spaces (string)Example 1:Add the 'selected' class to the matched element.HTML code:Jquery code:$ ("P"). add
CSS pseudo-ClassThe pseudo-class in CSS syntax is used to add special effects to certain selectors. Common pseudo-classes are:(1) syntaxSyntax for pseudo-classes:Selector:pseudo-class {Property:value}CSS classes can also be used in conjunction with pseudo-classes.Selector.cl
[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
About positioning in CSS using sub-parent (subclass absolute position and parent class relative position)
Foreword: Recently in learning Javaweb front-end CSS, about the positioning of CSS may sometimes be used to the sub-father, due to my limited level if there is any place to say wrong, please point out that
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
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
Because the environment to compress js,css offline, it is impossible to use the online compression function of the network,
So I want to find a PHP class to compress JS or CSS,
GitHub did not find particularly good, so want to ask everyone, hope to recommend, thank you!
Reply content:
Because the environment to compress js,
know. the Content property of the CSS is specifically applied to the before/after pseudo-element, which is used to insert the generated content. The most common application is to use pseudo-classes to clear floats.. clearfix:after { content: ".";//the content attribute Display:block is used here ; height:0; Visibility:hidden; Clear:both; }.clearfix { *zoom:1;}After pseudo-elements generate block-level elements of a point after the
Before writing a "detailed CSS properties-: Before : After" blog, then I did not distinguish between pseudo-elements and pseudo-class, so in the article to confuse the concept, fortunately @riophae brother corrected my mistake, so today intends to study the difference between the two.First, read the w3c definition of both:
CSSPseudo-classes are used to add special effects to certain selectors.
CSSPseu
The code is as follows
Copy Code
Example of upper area, let's introduce the following
The code is as follows
Copy Code
CSS part
The code is as follows
Copy Code
/*css part, pay attention to the value of border, margin, left and right.#nav_demo {Margin-top:20px;margin-left:20px;font-size:12px;font-family:micro
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.