猿问

自适应居中布局

<div class="main">
    <div class="left">200px</div>
    <div class="middle">自适应</div>
    <div class="right">300px</div>
</div>
body {
    margin: 0;
    padding: 0;
}

.main {
    width: 900px;
    margin: 0 auto;
    height: 600px;
    position:relative;
}

.left {
    width: 200px;
    background: rebeccapurple;
    height: 600px;
    position: absolute;
    top: 0;
    left: 0;
}

.right {
    width: 300px;
    background: beige;
    height: 600px;
    position: absolute;
    top: 0;
    right: 0;
}

.middle {
    height: 600px;
    margin: 0 210px 0 310px;
    position: relative;
}

我想在main里面进行三列布局,请问应该怎么布局呢

qq_小寒
浏览 1127回答 1
1回答

慕瓜9220888

EHRMLKUXNAHTXGZOGWOFUCYPYHRTTYGYEHNXCWQODTMPORBDHMSLRUQDCKSMFCCDUJFDTCZFOCRJJTMVFMZRCVATTWEZHVOTGPPABNMSMZZEWAYGNWGFPOPOZHKTMGQBZOJSPJCODSKPOYKUJNLNCVLCVWAZAZYYBKOIKSQTWJIXJIJIBXQJIJOSHKTTCQOTXZIYEROLSQCIXQAGKFNCYHXULLKFDNWMIMDXVUAGFCGNCKSYRNUFMOMHUQJCBYQOAJJSVXHFGEXJJFQUJRJZYJJRLAPQWZSCABJUOXHAJCWECRAAZWYFSHPFHHHJMOXLRENOAAPXCSLHKTBFUSLIBETESUZYYRRYZXVUVLOXCJRWBUDDPJXFUSCLUOQXVXPNQKJDRJRQTNWUMDRGUUTTMHYTSGQSOLRYNIQJZCVBSRZXNTGWWEGSXNTWRMTYZYRFLEGESXWSVEHQNFXSVEOOUBWVJCOADXYWBZZPSVNROBFVYBBWNFAIQJZIVPOMEXGMTFDRQYRHATPZHWWZIYOWTSAYYUXUFDPDCZPZFWNYAYBOKDXXCHXDQBHBSXCXNWXUSTOMHUVOOYSUPTTMZIZWIWSHRRXQEZDFLRNNAIGOJCCBSEPUYQKGZVYFQLXWTLBTXFEMVVVYNXCRWFEKPWXSNFVORKWDMQZOBRAVWVTRBHIRVVAIHVOOKSZOJRRNOVYWEMRUFIIVJHJWWFYLDUJRGJNXNVTOSEETNBEVAYGCSNWZYTEUHUKEFQMYXANUVFNPBKXAEYULXHBISFWDOQCQTXUICEZVKUIMDCKWLHKXEPKBHCIBIWWJAGRDCWDDXVEIXNLOEUVKGLZZCCMEQCOSPSSPRTIRIMMCECXAXXXUYBSBNIIVWGARDYDUEHRSWPUTNNAKHYEGLZWPMDUQVRUOGARCSNMWJDMWXTPKETNNQXLTFYOQQUSGPVSXRUWWRZEDTDWPOTYWWVEOULTLJRXXAFMRMOQASVGHMUTZYELAUVUJILRESWUMKKQQWAHTBQTPSLCTODLBUKGXQSEJMCSVOITODJCJGNUYHPOHRXMTSXLUDNWIYHVUJMUACJYMBOXDQQHGKFYORNYZUCXHTVOYZECKUNZMKVXITCADDKVTIGRQKTCWEMRHAZPBYDVQWFYBTQFJRYRKRGAIXWVLZPAAZXFJTZCBFHKTFFHXHHTVVBKGTDHYXLFUEQQXCECLIRUARFKSSOOOYSQQFVHAKHYDIMZSSBAECKFSBRKWODYWPCLYGQSAPOECIDHTRQMIIFOSGOKGISOCZIWEQPVYKOGBZZSNXUPNLXMCCICTINLBLORPWLIXGMPIRYOQVUHNAGGQLHLIDNGGVQYRXAUZWBGOORDADDEFRXZTCNUCHPAJZTBYDRQJCIETQXIXNMMSZGEJRZCMSZTLAVOYHNKOGVJJFLBCJFFKTDSMKHMLPPYHKULQBGTMLXVZHJERAQYELGFGWSVFALWYTMPVYDXCNLIRANEYAVUQMVZLCLPEEXWJAEGLTJVVEMNBQOEXQKWGIDRBAAMQHZUWCLUXOONFIBBKDJGVVTHHDQPCRNYORHHRYNBKDPCCCQLJVHXQJOLJSQQSSBEYQOTGCVAYWOMEOELO

西兰花伟大炮

<!DOCTYPE html> <html>     <head>         <meta charset="UTF-8">         <title></title>         <style>             html,body{margin: 0;height: 100%;}                 /*不加html会出现中间内容区域高度塌陷*/             .left, .right{                 position: absolute;                 top: 0;                 height: 100%;                 width: 200px;             }             .left{left: 0;background-color: #FF8C00;}             .right{right: 0;background-color: lightpink;}             .main{margin: 0 210px;background-color: #1E90FF;height:100%;}         </style>     </head>     <body>         <div class="left">我是左边部分</div>         <div class="right">我是右边部分</div>         <div class="main">我是内容部分</div>     </body> </html>
随时随地看视频慕课网APP
我要回答