gpt4 book ai didi

html - 如何将div扩展到填充中间列的任意大小的宽度?

转载 作者:太空宇宙 更新时间:2023-11-04 05:01:49 24 4
gpt4 key购买 nike

Demo jsFiddle 我有 div color azure 我想填充中间列的宽度区域,没有米大小。有没有 css3/css 没有 jQuery 的解决方案?

我需要这样的图片: enter image description here

ststus 当前是这样的:

非常感谢。

enter image description here Demo jsFiddle

html代码:

<div id="frame">
<div id="inside_window">
<div id="Yellow"></div>
<div id="Green"></div>
<div id="Blue"></div>
<div id="Red"></div>
<div id="ver"></div>
<div id="hor"></div>
<div id="ver2"></div>
</div>
</div>

代码 CSS:

  html, body{
height:100%;
background-color: azure;
}
#frame
{
position: relative;
background-color: black;
height: 100%;
width: 100%;
margin: auto;
padding:0;
border: 1px solid black;
}

#Yellow
{
position: absolute;
height: 100%;
width: 150px;
-webkit-border-radius: 0px;
margin: 0 ;

background-color: Yellow;
z-index:10;
display:table;

left:0px;
top:0;
}

#Green
{
position: absolute;
height: 100%;
width: 150px;
-webkit-border-radius: 0px;
margin: 0 ;

background-color: green;
z-index:10;



right:0px;
top:0;
}

#Blue
{
position: relative;
height:100%;
min-width:65.8%;
-webkit-border-radius: 0px;
margin: 0 auto;

background-color: #62A9FF;
z-index:10;
display:table;
font-size:220%;


left:0px;
top:0px;
}

#Red
{
position: absolute;
height: 150px;
width: 100%;
-webkit-border-radius: 0px;
margin: 0 ;

background-color: red;
z-index:10;
border: 1px solid black;

left:0px;
bottom:0px;
}

#inside_window
{

width:100%;
height:100%;
margin:0 auto;
position: relative;
border: 1px solid black;

background-color: brown;
-webkit-transform: rotate(0deg);
-webkit-transform-origin:50% 50%;
}
#ver
{
position: absolute;
height: 100%;
width: 5px;
margin: 0;
background-color: white;
left:150px;
top:0px;
z-index:1;
}
#hor
{
position: absolute;
height: 5px;
width: 100%;
margin: 0;
background-color: white;
left:0px;
bottom:150px;
z-index:20;
}
#ver2
{
position: absolute;
height: 100%;
width: 5px;
margin: 0;
background-color: white;
right:150px;
top:0px;
z-index:1;
}

最佳答案

尝试从您的蓝色代码中删除以下 CSS:

position: relative;
display:table;

关于html - 如何将div扩展到填充中间列的任意大小的宽度?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/11349203/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com