屬性名:background-color(bgc)
屬性值:關鍵字、rgb表示法、rgba表示法、十六進位制......
注意:背景顏色不會影響盒子大小,並且還能看清盒子大小和位置,一般佈局中會習慣先給盒子設定背景顏色。
屬性名:background-image(bgi):url('的路徑')
注意:url可以省略引號。預設是在水平和垂直方向平鋪的。僅給盒子起到裝飾效果,類似於背景顏色,不能撐開盒子。
屬性名:background-repeat(bgr
)屬性值:repeat—(預設值)水平和垂直方向都平鋪
no-repeat—不平鋪
repeat-x—沿水平方向平鋪
repeat-y—沿垂直方向平鋪
屬性名:background-position(bgp):水平方向 垂直方向;
屬性值:1、方位名詞(最多隻能表示9個位置)
水平方向:left、center、right
垂直方向:top、center、bottom
2、數字+px(座標)
正數向右/向下,負數向左/向上
單個屬性值的合寫,取值之間用空格隔開
background: color image repeat position可以按照需求省略
特殊情況:在pc端,如果盒子大小和背景一樣,可以直接寫background:url()
注意:背景圖位置如果是英文,可以顛倒順序。可若是數字,不能顛倒順序。
背景相關屬性
background origin 背景原點 起始位置 border box padding box content box background clip 背景裁剪 border box padding box content box background size 水平大小 垂直大小 背景圖大小...
css 背景屬性
背景位置 background position 值 值可以是 center top bottom right left xxpx,xxcm,xx 其中center,top,bottom,right,left 一共可以組成九個方向,單一關鍵字規則如下。可以省略center。xx 表示更復雜 百分數值...
0409 css背景屬性
背景顏色 background color blue 背景 background image url 背景圖重複方式 no repeat 不填充repeat x 水平填充 repeat y 豎直填充 background repeat no repeat 位置px 水平 垂直 right top 右...
CSS 背景屬性
屬性background color 取值合法的顏色值 注意背景顏色是從邊框的位置處開始繪製 屬性background image 取值屬性background repeat 取值repeat 預設值,橫向縱向都平鋪 repeat x 只在橫向平鋪 repeat y 只在縱向平鋪 no repeat...
css背景屬性
background image url red.jpg url blue.jpg 後在後前在前 repeat x repeat y repeat no repeat bakcground repeat space 正好的空隙平鋪 background repeat round 沒有空隙平鋪 bak...
css背景屬性
css背景 1 背景顏色 background color 顏色值 如background color f00 2 background image url 背景的路徑及全稱 如background image url image 1.jpg 在設定css背景的時候要注意css檔案與背景檔案的相對路...
CSS 背景屬性
1,背景顏色 屬性 background color 取值 合法顏色值 注意 背景顏色是從邊框的位置處開始繪製 2,背景影象 屬性 background image 取值 url 路徑 3,背景平鋪 屬性 background repeat 取值 1,repeat 預設值,橫向和縱向都平鋪 2,no...
CSS背景屬性
這個屬性為html元素設定背景顏色,相當於html中bgcolor屬性。body上面的 表示body這個html元素的背景顏色是翠綠色的。演示示例 這個屬性為html元素設定背景,相當於html中background屬性。上面的 為body這個html元素設定了一個背景。演示示例 這個屬性和back...
css3背景屬性
一 背景屬性1 background origin 背景原點 背景的起始點yoush background origin 背景原點 背景的起始點you background origin 背景原點 背景的起始點yoush background origin 背景原點 背景的起始點1 backgrou...
CSS3 相關屬性
在css3中,使用before選擇器在元素前面插入內容,使用after在元素後面插入內容,在選擇器content屬性中定義要插入的內容,比如對h2使用before選擇器在h2的前面插入文字 title 等。使用before或者after除了可以在元素前後插入文字之外還可以插入。在插入是需要使用url...