CSS Position(定位)
position 屬性指定了元素的定位類型。
position 屬性的五個值:
元素可以使用的頂部,底部,左側(cè)和右側(cè)屬性定位。然而,這些屬性無法工作,除非是先設(shè)定position屬性。他們也有不同的工作方式,這取決于定位方法。
<!DOCTYPE html> <html> <head> <meta charset="utf-8"> <title></title> <style> .box{ width: 1400px; height: 1500px; margin: 0 auto; } .box1{ border: 1px solid #000000; height: 200px; width: 200px; display: inline-block; position: fixed; } .box02{ border: 1px solid #006400; height: 1500px; width: 800px; display: inline-block; margin: 0 20px; margin-left: 250px; } .box03{ border: 1px solid #006400; height: 200px; width: 200px; display: inline-block; position: fixed; } </style> </head> <body> <div class="box"> <div class="box1">123</div> <div class="box02">456</div> <div class="box03">789</div> </div> </body> </html>
到此這篇關(guān)于css position fixed 左右雙定位的實(shí)現(xiàn)代碼的文章就介紹到這了,更多相關(guān)css position fixed定位內(nèi)容請搜索腳本之家以前的文章或繼續(xù)瀏覽下面的相關(guān)文章,希望大家以后多多支持腳本之家!
標(biāo)簽:咸陽 文山 紅河 甘南 惠州 萍鄉(xiāng) 蘇州 營口
巨人網(wǎng)絡(luò)通訊聲明:本文標(biāo)題《css position fixed 左右雙定位的實(shí)現(xiàn)代碼》,本文關(guān)鍵詞 css,position,fixed,左右,雙,;如發(fā)現(xiàn)本文內(nèi)容存在版權(quán)問題,煩請?zhí)峁┫嚓P(guān)信息告之我們,我們將及時溝通與處理。本站內(nèi)容系統(tǒng)采集于網(wǎng)絡(luò),涉及言論、版權(quán)與本站無關(guān)。