css-- Profile

 

 

CSS declaration always a semicolon (;) is completed, the statement set braces ({}) enclose:

css reference: Inline 1: Add style attributes in the tag, <tag name style = "Style 1: style value 1; 2 style: style value 2">

                   </ Tag name>. 2. The embedded: Add style attribute tag in the head

      <style>                      

     Selector {1

                   Pattern 1: style value 1;

                   2 style: style value 2;

     }

      {Selector 2

                   Pattern 1: style value 1;

                   2 style: style value 2;

     }

     </style>

                            

 

 

. 3 Outreach: the establishment of a separate css file. Write tag link the introduction of head tag in html file.

           Selector {1

                   Pattern 1: style value 1; 

                   2 style: style value 2;

     }

      {Selector 2

                   Pattern 1: style value 1; 

                   2 style: style value 2;

     }

    In reference to a link tag label html file head is introduced css file

    <link  href="xxxx.css">

     Selector:

1, id selector

2, was added in the tag id attribute.

                <Label name id = "id is the value from the code name"> <>

    The format of the embedded or external css file

       CSS id selector to the "#" to define.

        #id values ​​{

                   Pattern 1: style value 1; 

                   2 style: style value 2;

     }

    

    

      Note id name is unique in the whole page

3, class attributes: Add class attribute tag can batch add style.

. "" In the CSS, the class number is displayed in a selected point:

.class values ​​{

                   Pattern 1: style value 1; 

                   2 style: style value 2;

                 

            }

     Note: The class is representative of a class (packet classification)

4, element (tag) selector: html file can be integrated to add style to one label.

The format of the embedded or external css file

Element name {

                   Pattern 1: style value 1; 

                   2 style: style value 2;

      }

     

      Identifier specification: only numbers, letters underlined. You can not begin with a number

      Which can not start with a number, and can not be keyword

 

The first character class name can not use digital!

 

     Second, the font style:

font-family: font type,

font-size: Font Size

Changing the font size h1 {font-size: 40px;}

font-weight: The font weight

                  font-style: italic font

color: color

Multiple font family is specified by a comma-separated

p{font-family:"Times New Roman", Times, serif;}

          Text styles:    

text-decoration: underline, strikethrough, the top scribing,

text- transform: text capitalization,

text-indent: paragraph first line indent    

text-align: horizontal alignment of text

 line-height: Row Height

 

Three, div border style:

border-width: the width of the border,

border-style, border appearance,

solid: solid line,

dashed: dotted line,

dotted: dotted lines,

double: double,

border-color border color border-top:; top border,

border-bottom: bottom border

border-left: left border,

border-right: the right side of the box,

background-color: background color,

background-image: background image,

background-repeat: the background image tiling,

background-attachment: background image positioning.

Guess you like

Origin www.cnblogs.com/layuechuquwan/p/11075200.html