css屬性標籤小結

2021-09-29 15:51:47 字數 1165 閱讀 9774

css樣式的寫法格式

四種基礎選擇器:

復合選擇器

偽類選擇器

文字樣式

屬性名稱

值font-family

字型中文字型需要巢狀在引號內,多字型使用英文逗號

font-size

字型大小number

font-weight

字型粗細

normal/bold/100-900

font-variant

小型大寫字母

normal/small-caps

lin-height

行高number

text-transform

大小寫轉換

lowercase/capitalize

text-deciration

文字修飾

none /underline/overline/line-through

文字區塊

屬性名稱

值letter-spacing

字母間距

number

text-indent

文字的縮排

number

text-align

水平對齊

left/center/right

vertical-align

垂直對齊

baseline/sub/super/top/middle/bottom

display

顯示型別

none/block/inline/inline-block

背景樣式

盒子模型內邊距padding

外邊距margin同上

邊框:屬性名稱值

boder-width

錶框寬度

number

border-color

邊框顏色

顏色值/transparent

boder-style

邊框樣式

solid/dotted/dashed

簡寫 border:1px solid red; 單獨某一條線 border-top: 1px solid red;新增浮動:

清除浮動:

border-radius格式:

box-shadow

text-shadow

子元素選擇器

css屬性簡介 小結

原文章 it技術擎 裡面有更豐富的資料 1 background 背景顏色 background color 基本語法 background color transparent color 背景影象 background image 基本語法 background image none url ur...

CSS 字型屬性小結

font size 1 可使用css所有尺寸單位 px,em,rem,2 瀏覽器預設大小為16px font family 1 在行內設定樣式使用 單引號 引住 2 用選擇器設定樣式使用 雙引號 引住 3 預設字型為微軟雅黑 根據系統不同可能會出現偏差 4 當設定的字型沒有生效,則顯示預設字型,也可...

css特殊屬性標籤

background transparent 消除預設背景色 outline none 消除邊框 1.css 背景屬性 background background 在乙個宣告中設定所有的背景屬性。background attachment 設定背景影象是否固定或者隨著頁面的其餘部分滾動。backgr...