CSS的常見屬性

來源:互聯網
上載者:User

標籤:十六進位   英語   背景   標準   選取器   文本   str   屬性   ack   

1.

css是cascading style sheet 層疊式樣式表的簡寫。“層疊式”的意思,我們將慢慢的去理解。

 

1                <style type="text/css">

2                         p{

3                                 color:red;

4                                 font-size: 30px;

5                                 text-decoration: underline;

6                                 font-weight: bold;

7                                 text-align: center;

8                                 font-style: italic;

9                         }

10                       h1{

11                               color:blue;

12                               font-size: 50px;

13                               font-weight: bold;

14                               background-color: pink;

15                       }

16              </style>

 

2.

1        <style type=”text/css”>

2        </style>

type表示“類型” , text就是“純文字”。css也是純文字的。

 

 

3.

css對換行不敏感,對空格也不敏感。但是一定要有標準的文法。冒號,分號都不能省略。

文法:

1        選取器{

2                k:v;

3                k:v;

4                k:v;

5                k:v;

6        }

7        選取器{

8                k:v;

9                k:v;

10              k:v;

11              k:v;

12      }

 

 

 

 

 

4.

字元顏色:

1        color:red;

color屬性的值,可以是英語單詞,比如red、blue、yellow等等;也可以是rgb、十六進位,不要著急,後幾天講。

sublime中的快速鍵是c,然後tab

 

字型大小大小:

1        font-size:40px;

font就是“字型”,size就是“尺寸”。px是“像素”。

單位必須加,不加不行。

sublime中的快速鍵是fos,然後tab

 

背景顏色:

1        background-color: blue;

background就是“背景”。

sublime中的快速鍵是bgc,然後tab

 

加粗:

1        font-weight: bold;

font是“字型” weight是“重量”的意思,bold粗。

sublime中的快速鍵是fwb,然後tab

不加粗:

1        font-weight: normal;

normal就是正常的意思

sublime中的快速鍵是fwn,然後tab

 

 

斜體:

1        font-style: italic;

italic就是“斜體”

sublime中的快速鍵是fsi,然後tab

不斜體:

1        font-style: normal;

sublime中的快速鍵是fsn,然後tab

 

底線:

1        text-decoration: underline;

decoration就是“裝飾”的意思。

sublime中的快速鍵是tdu,然後tab

 

沒有底線:

1        text-decoration:none;

sublime中的快速鍵是tdn,然後tab

CSS的常見屬性

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

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.