標籤:連結 網頁 字型大小 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部分---樣式屬性;