Tips for HTML and CSS

Source: Internet
Author: User
Tags dashed line

1: Label don't forget to bring some

Whether the 2:div appeared in pairs.

3.body Front can not add

4. When writing CSS, remember to take the class name so that there is no duplication.

5. When there is an underscore or a dashed line when the text appears, use the padding to open the distance picture distance frame is also used padding

6. When there is a padding, remember to subtract the value of padding with width padding is the distance between the edge and the edge when the height is also to use light minus the padding value padding can also be used on the four sides of the distance

7. The best way to write a block in a Web page is to make a module in a pair of div, which speeds up the load.

8.span to row height is no use must be first add block in the Give high (Display:block)

9.A tags in no matter how the settings are not used when the use of display:block;

It is sometimes used in the background . top{width:1349px; Background:url (..      /images/box_background_image.png) no-repeat Center top; height:266px;} The gray one is the center of the background.

11. The outside is Div , which is the padding between the box and the box.

12.The vertical bar on the right side of the navigation is centered: The entire row is highulin usePadding-top; and then inLiin useLine-heightand theHeightis the same, and the vertical bar isLiSetBorderor, inain Canadapadding:0px 10px;Border:

The last vertical row in the navigation resolves border:None or in class A . Div. a2{border:none}

Picture: Below the picture there is a line removed: borderin the row:None

in Navigation a is to give a block and center Text-align

in p mark, let the word and the word have a distance between letter-spacing

between blocks and blocks with margin

In the middle of the picture and text:margin-top:-5px; vertical-align:middle;

First, background-position background positioning

    1. Position Word:background-position: Horizontal alignment vertical background-position:Center Center
    2. Percentage:background-position:50% 50%
    3. Fixed positioning:background-position:5px 10px;

Abbreviated form

Format: background: background image address, whether to tile image positioning

<div class= "Zhang" >

<ul>

<li><a href= "#" >ssssssss</a></li>

</ul>

</div>

body,h2,ul,li,a{margin:0px;padding:0px;}

body{font-size:12px;}

A:link,a:visited{color: #000ff; text-decoration:none;}

A:hover{color: #ff0000;}

. zhang{width:600px;}

Ul,li{list-style:none;}

. Zhang H2{font-size:12px; padding:10px 0px;}

. Zhang li{padding:5px 0px; Background:url () no-repeat left center; padding-left:10px;}

19.padding is the internal margin, the distance from the edge to the content;

20.box > H1 meaning is the son change grandson, refers to a div in a large box below There are two H1 one H1 in a different Div in

21. class= " Span style= "Font-family:tahoma;" >v A.V: link,a.v:visited{} class= V a link add style;

22.div.box{color: The meaning of the #ffffff}//div.box : to class=box <alert (" welcome to java ");> element Add style

the floating block element must have a width

Tips for HTML and CSS

Related Article

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.