Today encountered mobile phone side of the CSS in a tag active does not work, originally wanted to loop a tag, to the current a tag to add class to solve, can feel a little trouble, after checking the information to understand to solve this problem, only need to add a touchstart empty event can be.Examples are as follows:Mobile-side CSS implements active Pseudo-
Css pseudo-class selector creates a login box form, Selector
When a pseudo-class selector is used to make the mouse hover, the text box appears orange dotted line border. When the mouse is activated, the background color becomes pale orange.
Use css to create a rectangle with rounded corner of the text box, and create
DOCTYPE HTML>HTMLLang= "en">Head> MetaCharSet= "UTF-8"> title>Documenttitle> styletype= "Text/css">A:link/*link the color of the natural state*/ {Color:Red; }a:visited/*already visited the link discoloration*/ {Color:Green; }a:hover/*The mouse is placed on the link color*/ {Background-color:Grey;Color:Black; }a:active/*change color when clicking on a link*/ {Color:Yellow; }A:focus{font-
The pseudo-class selector for CSS is really love and hate, each time is very perfect to be confused, or to do a summary.
: Last-of-type Select last element
Divclass= "box"> P>1 always believe in good thingsP> a>2 is about to happena> P>3 always believe in good thingsP> P>4 always believe in good thingsP> a>5 is about to happena> a>6 is about to happena>Div>P:last-of-type { ba
Web page Production WEBJX article introduction: : Nth-child () working principle.
This is a CSS selector, a real pseudo class selector, which is nth-child (), and here's an example of using it.UL Li:nth-child (3n+3) {Color: #ccc;}
The above CSS is what to use, it is in the unordered list of the selection is 3 times times the number of columns. That's
inserting content into the web, in the CSS2.1 era, relies on javascript for implementation. But after entering the CSS3 we can achieve by CSS3 pseudo-class ": Before", ": After" and CSS3 pseudo-element ":: Before", ":: After", the key is to rely on the "content" property in CSS3. This property, however, does not work for the img and input elements.
Content with CSS pseudo-
The css class overlays the value of the same attribute.
If an element uses multiple classes and one attribute value has different values in multiple classes, what is the final value of this element?
Of course, the coverage with a higher priority is lower.
Consider a css link file box and an html file.
In css:
. Fo
pseudo-classes and pseudo-elements are independent of the document structure. The way they get the elements is not based on the element characteristics of the ID, class, attribute, but on the element that is in a special state (pseudo-Class), or the element's special content (pseudo-element). The difference is summarized as follows:
CSS pseudo-
Unlike the general CSS syntax, there are two types of syntax for CSS pseudo classes.
First type:
Selector:pseudo-class {Property:value}
You can also use the HTML class attribute to set pseudo classes.
Example:
a:link {color:red}
The second type:
Selector.class:pseudo-class
Difference between SPAN and DIV
The difference between SPAN and DIV is that division is a block-level element that can contain paragraphs, titles, tables, and even chapters, summaries, and remarks. While SPAN is an element in the row, it does not wrap the line before and after the SPAN. It has no structural meaning and is purely an application style. When other elements in the row are not appropriate, you can use SPAN.
------------------------------------------------------------Differences
Understanding the Pseudo class of CSS
A pseudo class (Pseudo classes) is a bolt of a selector that specifies the state of a selector that is or is related to it. They are in the form of Selector:pseudo class {Property:value}, simply separating the selectors and pseudo classes with a half-width English colon (:).
Many o
Body { margin:0; padding:0; background:#000 url (' images/backgrounds/star.png ') no-repeat fixed; Font: 12px sans-serif;}Here the body is the selector, where CSS attributes such as margin, padding, background, and font are applied to the BODY element,To use CSS to implement one-to-one, two-to-many or more-to-many controls on elements in an HTML page, you need a
This is an article about CSS hack, this article refers to the CSS hack is for class, id the attributes of the hack, the order of arrangement are required. Today to talk to you about class, id do CSS HACK.
The code is as follows
Copy Code
. test
The 2d conversion of CSS is very powerful, it can realize more dynamic interaction between the elements of the page and the user without using JS, and enhance the user experience. One of the most used is the hover pseudo-class.1. Create a DIV element for a page:DOCTYPE HTML>HTML> Head> MetaCharSet= "Utf-8"> title>2d Conversion Testtitle> Head> Body> DivID= "FR">
Because now 99.99% of the CMS is to use DIV+CSS to build the Web page template, was forced helpless, a lot of age to learn CSS, to tell the truth did not feel the layout with div better than table where! But by force, first bite the bullet to see, can learn how much is how much.
According to the principle of separating the data from the structure, CSS is better t
If 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 CSS is defined as "#".The following style rules a
CSS selector: both class and id can make the "single selector" have different styles.A1: What are the main differences between the two?Id. You can only define a single element. The page does not have any problems, but W3 detects that your page does not conform to the standard. class is a class, and the same
There are two types of Pseudo-classes: UI Pseudo-class and structured pseudo -classUI pseudo-class: a:link{} a:hover{} a:active{} a:visited{}Input[type= ' text ']:focus{} #title-one:target{}Structured pseudo-class: Table Tr:nth-child (even) {}//even sub-element labeled as even---Table Tr:nth-child (odd) {}//odd---subscript as an odd child elementTable tr:first-ch
CSS: hover pseudo class selection definition and usage, hover pseudoDefinition and usage of the pseudo-class selector E: hover:
Sets the style of an element when it is hovering over it.The E element can be selected using other selectors, such as class selector, id selector, and type selector.Note: IE6 does not support
versions not supported
: Root
Point to the root element, which is the HTML element
IE8 and earlier versions not supported
three, common pseudo-elements
Pseudo element
Description
Compatible
:: First-line
Select the first row of an element
Mainstream browsers support
:: First-letter
Select the first letter of a text block
Mainstream browsers support
:: Before
Insert
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.