gpt4 book ai didi

css - 我应该如何使用固定布局和基于百分比的布局来实现 Bootstrap 响应?

转载 作者:太空宇宙 更新时间:2023-11-03 18:21:23 24 4
gpt4 key购买 nike

+-----------+----------------------------------+
| | |
| | |
|216px fixed| percentage based layout here |
| | |
| | |
| | |
| | |
| | |
+-----------+----------------------------------+

我该如何使用它?

<div id="left" class="span"></div>
<div id="right" class"span12"></div><!--or if span9--- that wouldn't fit exactly-->

最佳答案

这是一个 CSS 解决方案:

.wrapper
{
min-height:100%;
width:100%;
position:relative;
background-color:Black;
display:inline-block;
}
.sidebar
{
width:216px;
top:0px;
left:0px;
bottom:0px;
position:absolute;
background-color:Aqua;
}
.content
{
width:calc(100% - 216px);
position:relative;
background-color:Gray;
float:right;
}

我用一个解决方案更新了一个 fiddle :

<div class="wrapper">
<div class="sidebar hidden-phone">
</div>
<div class="content">

It will work according to the content
<br/>It will work according to the content
<br/>
</div>

http://jsfiddle.net/DppA8/20/

您可以阅读更多关于替代品的更多兼容性:

css width: calc(100% -100px); alternative using jquery

最好的问候,

关于css - 我应该如何使用固定布局和基于百分比的布局来实现 Bootstrap 响应?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/21776631/

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