CSS study Note 1

Source: Internet
Author: User

1. Functions of CSS

Separate documents from formats; better control of web page layout; smaller web page size

CSS uses the rule control page. The rule is divided into two parts: Selection and description. You can select any HTML Tag. The description includes attributes and attribute values. The description is contained by the symbol.

2. Use CSS

2.1 product placement

Add the style sheet directly before the <body> page.

<Style type = "text/CSS">

<--

Style rules

-->

2.2 link type

Link the external CSS file to the document

<LINK rel = stylesheet url = "mycss.css" type = "text/CSS">

2.3 input type

Similar to the link type, but can be used with other methods

<Style type = "text/CSS">

<--

@ Import URL ("mycss.css ");

Other style rules

-->

2.4 inline

<P style = "font-family:">

 

 

<--

@ Import URL ("mycss.css ");

Other style rules

-->

2.4 inline

<P style = "font-family:">

 

 

<--

@ Import URL ("mycss.css ");

Other style rules

-->

2.4 inline

<P style = "font-family:">

3. CSS skills

Category: You can divide an option into different categories and control different categories. For example:

P. First {color: Green}

P. Second {color: Red}

P. Third {color: Gray}

<P class = first> This is the first class </P>

Or directly use the category name:. First {color: Green}. In this case, all the content colors of this category are green, not limited to the <p> label.

4.css Positioning Control

4.1 Absolute Positioning

P <position: absolute; left: 100px; top: 40px>

4.2 relative positioning

P <position: relative; left: 100px; top: 40px>

Positioning Relative to the position where the element should appear

4.3 visibility

P <visibility: hidden>

4.4 overlapping elements

P <z-index: 1>

When multiple elements share the same region, the largest element of the Z-index value is at the top, and the smallest element is at the bottom.

5.css font Control

5.1 font family: font name is the font-family value.

5.2 font size: the font-size value of the attribute.

Font size unit: Points (PT), EMS (EM), pixels (PX)

In(INCHES)Cm(Cm)Mm(Mm)

PC(Typewriter font size unit)Ex(X-height)

Font size Keyword:

  • XX-small
  • X-small
  • Small
  • Medium
  • Large
  • X-large
  • XX-large
  • 5.3 Font Style: font-style

    Parameter Value: italic oblique normal

    5.4 words: font-weight

    Parameter Value: bold normal

    Or 100 200... 900


    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.