優(yōu)秀網(wǎng)站網(wǎng)頁設(shè)計(jì) 用css網(wǎng)頁設(shè)計(jì)代碼怎樣把下面的幾排文字放到網(wǎng)頁的右邊的白色背景中去?
用css網(wǎng)頁設(shè)計(jì)代碼怎樣把下面的幾排文字放到網(wǎng)頁的右邊的白色背景中去?html:<div class="box"> <div class="left"> 左邊
用css網(wǎng)頁設(shè)計(jì)代碼怎樣把下面的幾排文字放到網(wǎng)頁的右邊的白色背景中去?
html:<div class="box"> <div class="left"> 左邊 </div> <div class="right"> 右邊 </div></div>css:.box{ width:1000px overflow:hidden}.left{ float:left width:200px}.right{ float:right width:790px}大致就是這樣,左邊的左浮動(dòng),右邊的右浮動(dòng),父盒子清除浮動(dòng),方法不止一個(gè),具體情況具體做
在網(wǎng)頁設(shè)計(jì)中怎么讓背景圖片水平居中?
CSS使網(wǎng)頁背景圖片居中的三種方法。1、第一種:用像素設(shè)定,很多都用這種,但是也是最麻煩的:<div style="width:800pxheight:600pxbackground:url(圖片地址) no-repeat 250px 270pxborder:1px solid #cccccc"></div> 2、第二種:用50%設(shè)定,很方便。<div style="width:800pxheight:600pxbackground:url(圖片地址) no-repeat 50% 50%border:1px solid #cccccc"></div> 3、第三種:用center設(shè)定(注:第2個(gè)center可以省略,因?yàn)槟J(rèn)就是center)。<div style="width:800pxheight:600pxbackground:url(圖片地址) no-repeat center centerborder:1px solid #cccccc"></div>