CSS 背景 background屬性 8 26

2021-09-26 13:06:26 字數 728 閱讀 6401

一、background-color:   ;   背景色

1. 可以寫色相、顏色;(比如red (紅色)、blue (藍色))

2. 可以寫顏色編碼; (比如:#ffffff)

3. 可以寫rgba,a透明度的百分比(範圍0-1),0.5就是半透明 background-color:189,162,143,0.5

4. 直接寫rgb 數值;

三、 background-repeat:背景重複

四、 background-position: ;  背景定位    x軸   y軸,可以寫正負值、百分比、px和方位詞;

剛剛上面的例子就可以寫:background:pink url(02.jpg) no-repeat 200px 500px/30%;

七、:hover

當滑鼠劃過時所展現的狀態!

color:transparent;  讓文字的顏色變為透明,進而消失!

transition:all 0.5s ease;

all:是讓所有的動畫;

0.5s : 過渡時間;

ease: 規定過渡效果的時間曲線。預設是 "ease"。

七、border-radius:50%

在css3中是將4個角 角度變成50%,正方形就會變成正園!

設定行背景 CSS 背景 background

css 可以新增背景顏色和背景,以及來進行設定。background color 背景顏色 background image 背景位址 background repeat 是否平鋪 background position 背景位置 background attachment 背景固定還是滾動 背景的...

CSS背景屬性Background詳解

css背景屬性background詳解 本文詳解了css的背景屬性background,包括css3中新增的背景屬性。如果你是個css初學者,還可以檢視之前介紹的css浮動屬性和css透明屬性詳解。css2 中的背景 background css2 中有5個主要的背景 background 屬性,它...

CSS之背景設定background

1 background color的六種表示方法 background color rgb 0255,0255,0 255 rgb表示 紅 綠 藍 background color rgba 0255,0255,0255,01 rgb表示 紅 綠 藍 最後乙個表示透明度。background co...