這種版型要怎麼做?

https://img.mukewang.com/5befd1b10001583303910250.jpg

想問問這種版型要怎麼做呢
就是左邊一個區塊 右邊也是一個滿版的區塊
能夠隨螢幕大小自行變化(但左邊區塊不變)

補上我自己的程式碼

<div class="div_left">
</div>
<div class="div_right">
</div>.div_left{    background-color:#2E3C54; width:12%; height:100vh;    display:inline-block;
}.div_right{    background-color:#eee; width:80%; height:100vh;    display:inline-block;
}

完全不對...


慕侠2389804
浏览 475回答 1
1回答

RISEBY

<!DOCTYPE html><html><head>&nbsp; <meta charset="UTF-8">&nbsp; <meta name="viewport" content="width=device-width, initial-scale=1.0">&nbsp; <meta http-equiv="X-UA-Compatible" content="ie=edge">&nbsp; <title>Document</title>&nbsp; <style>&nbsp; &nbsp; body{&nbsp; &nbsp; &nbsp; margin: 0;&nbsp; &nbsp; }&nbsp; &nbsp; .container{&nbsp; &nbsp; &nbsp; position: absolute;&nbsp; &nbsp; &nbsp; height: 100%;&nbsp; &nbsp; &nbsp; width: 100%;&nbsp; &nbsp; &nbsp; display: flex;&nbsp; &nbsp; &nbsp; flex-wrap: nowrap;&nbsp; &nbsp; &nbsp; align-items: stretch;&nbsp; &nbsp; }&nbsp; &nbsp; .left{&nbsp; &nbsp; &nbsp; flex-basis: 200px;&nbsp; &nbsp; &nbsp; flex-grow: 0;&nbsp; &nbsp; &nbsp; flex-shrink: 0;&nbsp; &nbsp; &nbsp; background: red;&nbsp; &nbsp; }&nbsp; &nbsp; .right{&nbsp; &nbsp; &nbsp; width: 100%;&nbsp; &nbsp; &nbsp; background: pink;&nbsp; &nbsp; }&nbsp; </style></head><body>&nbsp; <div class="container">&nbsp; &nbsp; <div class="left"></div>&nbsp; &nbsp; <div class="right"></div>&nbsp; </div></body></html>
打开App,查看更多内容
随时随地看视频慕课网APP

相关分类

JavaScript