The shortcut input method in HTML

Source: Internet
Author: User

Quick Input Method:

    1. Lorem+tab key: The text that comes with it
    2. Format: lorem+n (number of words to appear)
    3. Format: P>lorem10+tab
      Output 10 words together with P output

    4. (Element) P+tab: auto-replenish end tag
    5. Note: Ctrl +?
      Note: Which line of the mouse is deleted together

    6. Ctrl+d: copying when moving forward
    7. Ctrl+f: Find
    8. Ctrl+r replacement
    9. Multi-Line Input:
    10. Div>p>span{xuanzi$$}*5 $: Represent numbers, two are 01,02,03.04,05

In the HTML selector:

First, the basic selector

1. Wildcard selector: *{} changed all styles

2. Element selector: element {}

3. Combination selector/Set selector: element 1, Element 2, class, Pseudo class, Element. Class {}

4. Class Selector

HTML:<H2 class= "F46" >Css:. f46{}
Characteristics
1, in the CSS must start with the dot (English)
2. Include letters, numbers, hyphens (-), underscores (__) in HTML
3, after the HTML dot number must be the beginning of the letter
4. Case-sensitive in HTML
5. A class selector can be applied to multiple tags in html
Example:
Html:

Css:. f45{}
This is the case for precise settings such as: in Div>ul>li

5. ID Selector
HTML:<H2 id= "F46" >CSS: #F46 {}

Second, level selector
1. Descendant Selector
Format: Ancestor descendant selector {}

Html:
<div><p><em></em></p></div>

Css:

div P em{}

2, sub-level selectors
Format: Parent element > child element {}

Html:<div><p><em></em></p></div>

Css:

Div> p> em{}

3. Brother Selector
Format: Sibling element A + sibling element b{}
Select the B element after the a element, and AB must be adjacent, that is, there is no other element between AB
Html:

<div><p><em></em><i></i></p></div>

Css:

em+i{}

4. Universal Selector
Format: Sibling element a~ sibling element b{}
Select the matched B element, which is all B elements following the A element
Html:

<div><p><em></em><span></span><i></i></p></div>

Css:

em~i{}

Third, pseudo-class selector
1. Dynamic pseudo-Class selector
(1), dynamic
Element: Link
Element: Visited
(2), static
element: hover
Element: Active
Element: Focus
2. Style when the focus (tab) key is triggered
Note: A tag uses the most
Get a picture in what position to display
4, Structure class selector

Format (for multiple identical elements under a div) the element to be modified: first-child{} (change the first element) the element to be modified: last-child{} (change the last element) the element to be modified: Nth-child (n) {} ( n the element to be changed in the number of elements to be modified: Nth-last-child (n) {} (modifies the penultimate element) the element to be modified: Nth-child (ODD) {} (when the element position is modified at odd digits: odd represents an odd number or is written as 2n+ 1y element to modify: Nth-child (even) {} (when the element position is modified at odd digits: even represents an even number, or is written as 2n
Div>p (element 1): Nth-of-type (n) {} (modifies the style of the second p in a div with type P (element 1)

Empty element: empty{} (element style that changes element to empty (no content))
There is only one element: Only-child (there is only one element in the div (which can be other elements) and only one can change the style
5, negative pseudo-class selector
Format: element: Not (: Nth-child (4)) {} Except for the fourth one does not change the style other changes, {} write the corresponding style
6. Pseudo Element Selector
Manipulate a piece of text
The rules of selection
Only Color,background-color (background) two properties
Format

:: Selection{color:red;background-color:bule;}
:: first-letter{} Select the first letter to change the style:: first-line{} Select the first row to change the style

Add content before/after tags (try to select labels with line wrapping)

I::before{content: "Hello"}

Add "Hello" to the I tag and display it in the Web page

Em::after{content: "Mr. Wang"}

Add "Mr. Wang" after the EM tag and display it in the Web page

Iv. attribute selector (typically used in input)
Html

<input type= "Text"/>

As1

Input[type= "text"]{color:red}html;<input type= "number-rfdbx"/>css:input[type vertical bar 1= "number"]{color:red} selected to " number-"Start input label Vertical line =

Html

<input type= "number-rfdbx text"/>css:input[type$= "number"]{color:red select the input tag with "text Start" $=

Html

<input type= "number-rfdbx dgsb f46 dgd"/>css:input[type*= "number"]{color:red} Select the input tag with "include F46" *=

Html

<input type= "number DGSB text Gav"/>css:input[type~= "#"]{color:red} selected with "text" input label, and multiple attributes are separated by spaces ~=

Html

<input type= "Text-rfdbxvs gsvx"/>css:input[type^= "number"]{color:red} Select Start with "text" or write "TE" input tag ^=

The shortcut input method in HTML

Contact Us

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.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.