CSS字型樣式,背景樣式,列表樣式

2021-10-08 19:10:17 字數 2443 閱讀 7512

1.color:字型顏色

2.font-size:字型大小

盡量用偶數

3.font-family:字型型號

可以設定多個字型,用,隔開,優先使用第乙個字型,如果沒有使用下乙個。

中文字型加引號,英文本型如果有空格、$、#則也要加引號

線上字型

@font-face

;

4.font-style:字型樣式(斜體等)

normal正常

italic斜體

5.font-weight:設定實體粗細

屬性值:normal ,bold加粗,bolder比父元素更粗,lighter比父元素更細,數值(100-900)

字型的綜合設定        選擇器

h1font-size font-family不能省略

6.text-decoration:

屬性值underline下劃線 / overline上劃線 / none預設 定義標準的文字/ blink字型閃爍

7.text-align:水平居中

8.text-indent:首行縮排 1em-乙個字的寬度

9.text-shadow:text-shadow:水平位置 垂直位置 模糊距離 陰影顏色 前兩個引數必須寫

text-shadow:1px 2px 3px rgba(0,0,0,0.4)

10.line-height:行高 行高 一般比字型大7.8個畫素

(標籤的行高等於標籤的height可以設定文字垂直居中)

11.text-transform:變換字型

uppercase 轉化為大寫

lowercase 轉換為小寫

capitalize 首字母大寫

12.letter-spacing:字型間距

word-spacing :2px 單詞間距 對中文無效

1.background-color:背景顏色

2.background-image:背景url()

3.background-repeat:背景是否平鋪 repeat-x水平平鋪 repeat-y縱向平鋪 repeat no-repeat不平鋪

4.background-size:w h; 設定背景大小 可以改變乙個值會等比例進行縮放 可以設定百分比 100% 100% 佔滿

設定為contain時會自動調整縮放比例,保證始終填充滿背景區域,溢位的部分會被隱藏

cover會自動調整縮放比例,保證始終完整顯示在背景區域

5.background-position:背景定位

background-position背景位置 top center bottom left right 預設為left top 方位名詞沒有順序

background-position:10px 10px;(x,y)

background-position:10px center;混搭

6.background-attachment:設定背景不會隨內容滾動而滾動

scroll;預設為滾動 fixed固定背景 不隨著內容滾動而滾動

7.background-clip 設定背景的覆蓋範圍

border-box : 背景位於邊框以內

padding-box : 背景位於內邊距以內

content-box : 背景位於內容區

8.background-origin 設定背景的起始覆蓋點

border-box : 背景從邊框的外邊緣開始繪製

padding-box : 背景從內邊距的外邊緣開始繪製

content-box : 背景繪製在內容區

**clip和origin配合使用**
簡寫:background: #000(背景顏色) url()(背景) no-repeat(背景平鋪) fixed(背景固定) 背景位置;

1.list-style-type:設定列表標誌型別

cricle 空心圓

square 正方形

decimal 數字

lower-roman 小寫羅馬字型

upper-roman 大寫羅馬字型

2.list-style-position:outsize/insize設定列表標誌出現的位置

outside

標誌在列表外

inside

在列表內

如果type 和image都存在 image會生效
outline

環繞線在border外面

outline-width: 3px;

outline-style: solid;

outline-color: red;

outline-offset: 3px;

常用於清除input邊框

outline

:none;

css背景樣式css背景樣式

css背景樣式 css背景樣式 序號中文說明 標記語法 1背景顏色2背景 3背景重複 4背景固定 5背景定位 6背影樣式 1 背景顏色 background color 語法 說明 引數取值和顏色屬性一樣 注意 在 html當中,要為某個物件加上背景色只有一種辦法,那就是先做乙個 在 中設定完背景色...

CSS 背景樣式

目錄 背景色 background color 背景影象 background image 背景重複 平鋪 background repeat 背景定位 background position 關鍵字百分數值 長度值 背景關聯 background attachment div注 定義沒有先後之分。...

css 背景樣式

樣式屬性 樣式名描述 background color 設定背景顏色 background image 設定背景 background repeat 設定背景重複 background position 設定背景影象定位 background attachment 設定背景影象滾動 backgrou...