CSS學習基礎(一)

來源:互聯網
上載者:User

標籤:

一、CSS外框(Border)

1、樣本

1 /*CSS文檔*/2 3 #d14 {5     width:100px;6     height:100px;7     border:solid 1px red;8 }
 1 /*HTML文檔*/ 2  3 <!DOCTYPE html> 4 <html> 5 <head> 6     <title>demo</title> 7     <link href="css/demo.css" rel="stylesheet" /> 8 </head> 9 <body>10     <div id="d1"></div>11 </body>12 </html>

2、效果

3、CSS邊框組合

#d1{       border:solid 1px red;} 

內容相當於三個屬性的組合。

#d1{      border-style:solid;      border-width:1px;      border-color:red;} 

 4、CSS邊框border分四個屬性邊框

#d1{       border:solid 1px red;}

border = border-top   +    border-left   +   border-right    +   border-bottom屬性

#d1{       border-top:solid 1px red;       border-left:solid 1px red;       border-right:solid 1px red;       border-bottom:solid 1px red;}

二、設定網頁背景(背景顏色)

Background-color

#d1{        background-color:#FF9;        background-image:url(../image/12.jpg);        background-repeat:no-repeat;        background-position:10px 20px;  }        

 

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.