標籤:style blog io color os ar for sp strong
css基礎-Background&Text
以下筆記為複習css的一些基礎,每一節我都做了一個簡單的總結案例,以便參考:
1 /*CSS 屬性定義背影效果: 2 3 background-color 定義了元素的背景顏色. 4 background-image 定義了元素的背景映像. 5 background-repeat 定義是否重複 6 background-attachment 背景映像是否固定或者隨著頁面的其餘部分滾動 7 background-position 改變映像在背景中的位置 8 */ 9 10 body{11 width:200px;12 height:200px;13 background-color:#b0c4de;14 background-image:url(img.png);15 background-repeat:no-repeat;/*repeat-x,repeat-y*/16 background-attachment:fixed;/*固定不動*/17 /*scroll 背景圖片隨頁面的其餘部分滾動。這是預設18 fixed 背景映像是固定的19 inherit 指定background-attachment的設定應該從父元素繼承*/20 background-position:top center;21 22 }23 24 /*簡寫*/25 body{26 width:200px;27 height:200px;28 background:url(img,png) no-repeat fixed top center;29 }30 31 32 /*文字格式設定33 text-align:center left rifht justify(左靠右對齊);34 text-decoration:none overline(上邊一橫線) line-through(中間一橫線) underline;35 文本轉換36 text-transform:uppercase(全為大寫) lowercase(全為小寫) capitalize(每個字的首字母大寫);37 文本縮排38 text-indent:50px;首行縮排50px39 字間距40 word-spacing:30px;41 文字方向42 direction:ltr; left to right43 字母間距44 letter-spacing:1px;45 行高46 line-height:30px;47 */48 p{49 width:200px;50 height:300px;51 margin:0;52 padding:0;53 text-align: center;54 text-decoration: underline;55 text-indent: 10px;56 word-spacing: 5px;57 letter-spacing:2px;58 line-height: 20px;59 direction: ltr;60 text-transform: capitalize;61 }
css基礎-Background&Text