html部分---樣式屬性;

來源:互聯網
上載者:User

標籤:連結   網頁   字型大小   url   center   1.5   高度   ati   no-repeat   

<!--大小-->

width:寬度

height:高度

 

<!--背景與前景-->

"background-color:#0F0;   背景顏色background-image:url(../%E6%96%B0%E5%BB%BA%E6%96%87%E4%BB%B6%E5%A4%B9/psb.jpg);  背景圖片background-attachment:fixed; 背景不隨字型滾動,是固定的;background-attachment:scroll; 背景隨字型滾動;
background-size:300px 300px;背景圖片的大小;
 
background-repeat: no-repeat; 背景圖片的平鋪;一般為norepeat


背景圖片的位置

background-position:center;  置中background-position:top left  居上居左background-position:top 200px left 200px;居上200像素 居左200像素

 

 

 

<!--字型-->

style="font-family:微軟雅黑;  字型類型font-size:12px; 字型大小font-weight: bold; 文字加粗font-style:italic; 文字傾斜color:red;  文字顏色text-decoration:underline; 底線text-decoration:overline;上劃線text-decoration:line-through;刪除線text-decoration:none  去掉底線text-align:center; text-align:left; text-align:right; 水平置中,水平居左,水平居右vertical-align:middle; line-height:40px;垂直置中,設定行高,兩個一般同時出現text-indent:20px;首行縮排20px;

 

 

 

超連結的樣式:

<style>#d1{width:100px; height:30px;background-color:red; color:#FFF; text-decoration:none}</style></head><body><a id="d1" href="http://www.baidu.com">百度一下</a></body>

 按鈕效果:

<style>#anniu{    width:104px; height:40px; background-color:#0CF;    color:#FFF; font-size:16px; text-align:center; vertical-align:middle; line-height:40px;}</style></head><body><div id="anniu">百度一下</div></body>

 

 

 邊距 間距:margin與padding

<style>/* *{ margin:0px auto; padding:0px}網頁都需要寫,把每個元素的邊距和間距都去掉,auto是把所以網頁中的<div>置中。*/#wai{    width:300px;    height:300px;    background-color:red}#nei{    float:left;    width:200px;    height:200px;    background-color:blue;    margin:10px 20px 30px 40px;/*距wai的邊距*/    padding: 10px 20px 30px 40px;/*距li的邊距*/}#li{        width:100px;        height:100px;        background-color:#FF0}</style></head><body><div id="wai"><div id="nei"><div id="li"></div></div></div></body>

 

html部分---樣式屬性;

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在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.