HTML+CSS Note--2

Source: Internet
Author: User

1, the list of small Pictures small logo, we can use <s></s> to achieve, S is the inline block label,

. top-page-2 ul Li s {    display: inline-block/*S is inline label */    width:14px ;     height: 12px;      background: url (... /image/sprite.png);     vertical-align: Middle; /* Let the picture center the display */}

For background s background pictures do not use padding to set the spacing of the list, because this will change the position of the picture, can be converted to use margin to set the same effect

2. A tag cannot inherit the color of the parent tag

3, valign: Vertical alignment of the way, the value is: Bottom Top middle sub (subscript) super (superscript).

4, H1+p said to look for the H1 label after a P tag,

5. First:letter This is a pseudo-class that is used to modify the style of the first word of the list.

6, the offset of the background,

. Top. H-top li:nth-child (1) S {    vertical-align: Middle;     background: url (... /images/icon.gif) -5px-8px;}

Some of the smaller pictures can be combined with a sprite to a graph, and then use the offset of the background image to achieve different areas of the background.

7, the role of the cursor, to achieve the position of the pointer to display the style: The value is:default/small white, pointer/the past is a small hand style, text/input cursor, crosshair/10 style, move/cross arrow

8. Pre, strictly control the style of the text, such as how many spaces inside, there will be how many spaces display spaces.

9, the size of the right of the background background-size:auto/ cover----scale, until exactly cover to the defined background, contain-----Scale scale, until the width or height to adapt to the background. -px-px; custom values

HTML+CSS Note--2

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.