CSS教程:背景background屬性應(yīng)用
互聯(lián)網(wǎng) 發(fā)布時間:2009-04-02 19:33:31 作者:佚名
我要評論

網(wǎng)頁制作Webjx文章簡介:背景background:background-image:url("圖片的網(wǎng)址");背景圖background: url(" 圖片的網(wǎng)址 "); 背景.background-color:#色碼;背景色彩.
背景background
css說明
background-image:url("圖片的網(wǎng)址&
背景background:background-image:url("圖片的網(wǎng)址");背景圖background: url(" 圖片的網(wǎng)址 "); 背景.background-color:#色碼;背景色彩. 背景background
css說明
background-image:url("圖片的網(wǎng)址");背景圖
background:url("圖片的網(wǎng)址");背景
background-color:#色碼;背景色彩
Exp:
background-image:url(背景圖案.jpg,gif,bmp);
background-color:#FFFFFF;
background-color:transparent;<--設(shè)定背景為透明色
--------------------------------------------------------------------------------
background-repeat改變背景圖片的重復(fù)并排的設(shè)定
css
說明
repeat背景圖片并排
repeat-x背景圖片以X方向并排
repeat-y背景圖片以Y方向并排
no-repeat背景圖片不以并排的方式處理
Exp:
background-image:url("http://www.dbjr.com.cn/xx.gif");
background-repeat:no-repeat;
以http://www.dbjr.com.cn/xx.gif這張圖片為背景,當(dāng)圖片大小不夠的時候,不并排重復(fù)
--------------------------------------------------------------------------------
background-attachment是否固定圖片位置
css
說明
scroll拉動卷軸時,背景圖片會跟著移動(缺省值)
fixed拉動卷軸時,背景圖片不會跟著移動
Exp:
background-image:url("http://www.dbjr.com.cn/xx.gif");
background-repeat:no-repeat;
background-attachment:fixed;
以http://www.dbjr.com.cn/xx.gif背景圖片不重復(fù)并列,且不隨卷軸移動
--------------------------------------------------------------------------------
以長度定位background-position:xy
使用百分比定位background-position:x%y%
css
說明
x%往右移
y%往下移
backgroud-position:0%0%;左邊上方
backgroud-position:0P%;左邊中間
backgroud-position:50%0%;中間上方
backgroud-position:50P%;正中間
backgroud-position:100%0%;右邊上方
backgroud-position:00%;左邊下方
backgroud-position:100P%;右邊中間
backgroud-position:500%;中間下方
backgroud-position:1000%;右邊下方
以關(guān)鍵字定位
關(guān)鍵字說明
top上(y=0)
center中(x=50,y=50)
bottom下(y=100)
left左(x=0)
Exp:
background-position:center;
圖片在指定背景中央X=50%Y=50%位置
background-position:200px30px
相關(guān)文章
div背景定位background設(shè)置元素的背景參數(shù)
DIV背景定義參數(shù):background 設(shè)置元素的背景參數(shù),div+css的廣泛使用,也改變了這一使用習(xí)慣,變成了將N多小圖標(biāo)集于一個大圖上,再通過div來定位需要用到的圖片部分,大大2013-02-02對背景圖定位中background-position屬性的自我理解
最近在項(xiàng)目中需要大量的用到很多標(biāo)簽按鈕什么的零碎圖片,加上一直沒機(jī)會使用Css中的”精靈技術(shù)“,這里把我對background-position的理解寫成文檔供更多人使用學(xué)習(xí);如果有2013-01-15css 中的background:transparent到底是什么意思有什么作用
css 中的 transparent到底是什么意思? 一直覺得很奇怪,到底有什么用的啊?,本文將詳細(xì)說明,需要的朋友可以參考下2012-12-12background-postion定位與圖片結(jié)合實(shí)現(xiàn)圓角效果
background-postion 背景默認(rèn)鋪設(shè)位置的起點(diǎn)為:元素的左上角.2011-07-27CSS中背景background-position負(fù)值定位深入理解[圖文]
CSS中背景定位background-position負(fù)值一直是不好理解的難點(diǎn),一方面用的比較少,另一方面的理解的不夠深入,今天花了點(diǎn)時間認(rèn)真的思考了,把我的心得寫出來2011-03-21- 背景屬性是給網(wǎng)頁添加背景色或者背景圖所用的CSS樣式,它的能力遠(yuǎn)遠(yuǎn)超于html之上。2011-01-05
利用CSS定位背景圖片 background-position
我們在研究其他的網(wǎng)站的樣式的時候經(jīng)常會發(fā)現(xiàn)一種情況,就是在很多background屬性里都調(diào)用同一張圖片,來滿足網(wǎng)頁各個部分的使用。打開這種圖片看一下,會發(fā)現(xiàn)這張圖片上包2009-12-17CSS background-position的使用說明詳解
設(shè)置或檢索對象的背景圖像位置。必須先指定 background-image 屬性。該屬性定位不受對象的補(bǔ)丁屬性( padding )設(shè)置影響2009-12-17CSS background-position 屬性 定位圖片
看別人代碼發(fā)現(xiàn)一個背景圖中有很多圖片,大家可以參考下原理2009-11-20CSS3教程(10):CSS3 HSL聲明設(shè)置顏色
網(wǎng)頁制作Webjx文章簡介:使用CSS3 HSL聲明同樣是用來設(shè)置顏色的。下一個呢? HSLA? 是的,這個和RGBA的效果是一樣的。 使用CSS3 HSL聲明同樣是用來設(shè)置顏2009-04-02