css基礎-Background&Text

來源:互聯網
上載者:User

標籤: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

聯繫我們

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