CSS Base Essence

Source: Internet
Author: User

CSS hand hard to beat, hope you cherish. CSS Fixed format selector {property: property value;} text-related properties font-syle:normalitalicfont-weight:bold;bolederlighterfont-size:px;font-family: "Microsoft Jas Black" If there is English, first put the English in front with a comma separated. Comments/* */Shorthand italic bold px Family Text property Text-decoration:underlineline-throughoverlinenonetext-algin: Leftrighttopbottomtext-indent:em color RGB (225,225,225) After you can put a 0, 0 to 1, display transparency. Selector Tag Selector p{} class selector. class1{}<div class= "Class1" ></div> can only use math English word underline, cannot start with a number. ID selector top{}<div></div> Enterprise cautious with descendant selector ul li{}<li></li><ul><li></li><li> </li></ul><li></li> spaces separate descendant selector div>p{}<p></p><div><p></p ><p></p><ol><p></p></ol></div><p></p> intersection selector selector 1 selector 2{} <div><p></p><p class= "Selector 1" ></p><p class= "Selector 2" ></p></div> Brother Selector 1.1 adjacent sibling selector followed by a tag div+p{}<div><p></p><p>p/></div><div><p> </p></div> General Brotherhood Selector div~p{}{<div><p></p><p>p/></div><div><p></p></div> Sequencer Selector 1.1 Same level: First-child:last-child: Nth-child:nth-last-child:nth-odtype (odd) 1.2 same class type: First-of-type:last-of-type: Nth-of-typenth-last-of-typenth-od-type (even) property selector p[id]<p id= "1" ></p>[attribute value]p[class=cc]< P class= "CC" ></p> properties begin with what [attribute1= value] C2 differentiate [attribute^= value] c3 What img<alt=^jsd> 1.3 property ends with [attribute$= value] c31.4 contains what scene [attribute~= value] C2 differentiate [attribute*= value] C3   Wildcard selector *{} Enterprise few priority!imoortant can only elevate priority, others are invalid. Id>class> wildcard > Inheritance > Default weight Problem ID The higher the priority, the higher the Id+class priority, the more the same. Inheritance can only inherit the font tetx COLR line,a tag underline h is invalid.  div and SPANDIV are block-level spans that are inline disiplay:inline do not occupy a single row of blocks that can be set to a wide height inlne-block background color line-height:1.875; " >background-image:url (); Background-repeat:no-repeat;:repeat-x:repeat-ybackground-position:left top/right Top specific pixel sprite figure width:pxheight:pxbackground-image:url (); background-position:px px; background: background color background picture tiling wayPositioning mode background can erase any one of the attribute associations Background-attachmet:scroll The difference between the scrollbar background picture and the inserted picture insert the picture of the occupied place want to search for the background image with the positioning attribute semantic words strong background picture must be the same width box model   Border Properties boreder-topbottomleftrightborder:px Solid/ Dashed color ligatures border-width:px px px pxborder-style:style style style Styleborder-color: On the left or right, set a calculated global.   Inner margin padding: upper right lower left width height will change toprightleft margin margin-upper right bottom left toprightleft margin merge default layout vertical direction, margin does not overlap, who listens to whom.   Box added border increases the size of the box box-sizing:border-box; The box size is guaranteed to be the same. Note that if two boxes are nested, the outside box will be topped down by the box inside. Adding a border property will not top down. The enterprise development needs to control the nesting relation, must consider padding. margin:0px Auto. Only valid for level. Text-algin: Only valid for text images. margin:0px Auto; Clears the default margin *{margin:0px;padding:0px;} row high line-height:px; can only be applied to a row of multiple lines with the padding to set the horizontal center the box in the enterprise development is that the text is usually prepared on the left.   Standard popular inner element floating flow float:left;right; margin:0px AUTP can not be used in a floating stream, and a block-level element can be set to a wide height without distinguishing between inline elements in a floating stream. Floating elements of the first floating float to find floating, left floating to find left floating, right floating to find the right floating. Snapping phenomenon, word circumference phenomenon standard flow content height can prop up the height of the box, floating flow can not   clear floating overflow:hidden1.1 can clear floating Adding 1.2 to the first box does not allow content 1.12 to set the first margin-bottom the second margin-topi6 need to set *zoom:1; Nest relationship, set overflow:hidden  positioning flow to the outside box 1.1 relative positioning position:relative;top:px; The element is not separated from the standard flow in the District branchPosition 1.2 Absolute positioning out of standard flow by default, the body is the reference point Position:absolutetop:xp; the nearest ancestor to him is the reference point. Static positioning is invalid in the row, block-level sub-parent Sanchi Door Technique Center left=50% Backgrpund-attachment:fixed with rolling 1.3 fixed positioning does not occupy space not in the branch position:fixed                                                           

CSS Base essence

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.