使用HTML語言和CSS開發商業網站(4)

來源:互聯網
上載者:User

標籤:class類   port   font   使用   http   mil   不能   height   import   

選取器:

標籤選取器

p{
  background-color:purple;
}

類別選取器

.one{
  color:red;
}

ID選取器

#a{
  font-size:25px;
}

 

行內樣式:

<p style="color:blue;"> </p>

 

連結外部樣式表,地址為one.css。
<link rel="stylesheet" type="text/css" href="one.css" />

 

匯入外部樣式表,地址為one.css。
<style>
  @import url("one.css");
</style>

 

後代選取器:

ol li{
}

 

並集選取器:

p,input,h1{
}

 

常用字型屬性(設定字型類型、 大小、        風格、        粗細)。
                  font-family     font-size   font-style font-weight

 

常用文字屬性(設定文本顏色、設定元素水平對齊、設定首行文本的縮排、設定文本的行高、設定文本的裝飾)
                     color              text-align                text-indent          line-height        text-decoration

 

標籤選取器:頁面中的xx標籤採用。。樣式

class類別選取器:不同標籤可以使用同一個class值

id選取器:必須唯一 id號不能重複

優先順序:id選取器 > class類別選取器 > 標籤選取器

 

優先順序:行內樣式 > 內部樣式 > 外部樣式

 

font-style:italic;/*斜體*/
font-weight:bold;/*加粗*/

text-align:center;/*文本水平置中*/

text-decoration:none;/*沒有底線*/

text-decoration:underline;/*有底線*/

text-indent:20px;/*首行縮排20像素*/

 

使用HTML語言和CSS開發商業網站(4)

相關文章

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.