- android - 多次调用 OnPrimaryClipChangedListener
- android - 无法更新 RecyclerView 中的 TextView 字段
- android.database.CursorIndexOutOfBoundsException : Index 0 requested, 光标大小为 0
- android - 使用 AppCompat 时,我们是否需要明确指定其 UI 组件(Spinner、EditText)颜色
这是我的代码和我的期望。有什么好的建议请多多指教。
.dash-wrapper {
height: 100%;
position: relative;
}
.dash-wrapper > div {
height: 100%;
float: left;
}
.dash-nav{
background-color: #606B79;
max-width:223px;
width: 25%;
}
.dash-content{
width:??????;
}
<div class="dash-wrapper">
<div class="dash-nav">
</div>
<div class="dash-content">
</div>
</div>
我想在减小 dash-nav
宽度后保留 .dash-content
剩余宽度(它将是 25%,但最大宽度为 223px)。因此,如果我设置 75% 的宽度,我就会在容器中获得额外的空间用于大视口(viewport)设备。我知道对于较小的设备它会起作用。我想在所有视口(viewport)中使用剩余宽度。提前致谢。
最佳答案
如果您被允许使用 calc,那么将其添加到您的样式标签中:
.dash-content {
background-color: #F00;
width: 75%;
}
//have to change this by a few pixels to handle all screen widths
@media only screen and (min-width: 994px) {
.dash-content {
width: calc(100% - 223px);
}
}
Here是否支持计算...
如果您不能使用它,请尝试这个解决方案(可能会为您指明正确的方向):
.dash-wrapper {
width: 100%;
height: 100px; /*made this 100px to show in snippet, change to %*/
position: relative;
border: 1px solid #000;
}
.dash-wrapper > div {
height: 100%;
}
.dash-nav {
background-color: #606B79;
max-width: 223px;
width: 25%;
}
.dash-content {
width: auto;
float: right;
}
<div class="dash-wrapper">
<div class="dash-nav">
</div>
<div class="dash-content">
</div>
</div>
关于css - 使用float left时需要取div元素剩余宽度,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/34086943/
我正在运行一个带有 while 约束的 SQL 查询,其中包含一些“id”。例如: SELECT table.id FROM TableOne table WHERE table.id IN (1,
我正在寻找在替换其中一个元素后打印元素列表的最正确方法。我可以按如下方式做,但显然很困惑。 #!/usr/bin/python import sys file = open(sys.argv[1])
这个问题在这里已经有了答案: How wide is the default `` margin? (4 个答案) How do I remove the top margin in a web
当我尝试使用命令安装 rvm 时::(I am Using UBUNTU 12.04 LTS) curl -L https://get.rvm.io | bash -s 当我尝试与简单用户相同的命令时
我使用 GOPro 工作人员 6 个月前发送给我的命令,通过终端(在 Gopro 网络上)使用 Gopro Hero3 拍摄照片/视频。有效。但是,在过去的一个月里,我一直在尝试再次执行此操作,并且不
尽管知道我不应该关闭应用程序按钮,但我仍然这样做。完成所有 Activity 后,我调用 finish() 方法,它们调用析构函数和所有内容。用户的行为也是正确的。但我想知道为什么还有 5 个打开的线
当我在 Rest Controller 中的类级别启用 @Validated spring 注释时,会生成 2 个验证上下文(每个验证上下文都有不同的前缀)。 @Validated 注释是必需的,因为
在旧的 API 中,剩余的允许容量显然作为 X-Ratelimit-Remaining 返回HTTP header 。 然而,current version's documentation对此一无所获
我一直在使用 Service Fabric 一段时间,成功构建、部署和测试了多个服务,但我刚刚完成构建的服务在部署时失败(请参阅下面的错误)。在诊断中,我尝试使用 VS 模板(没有代码更改)创建和部署
这个问题在这里已经有了答案: 关闭 12 年前。 Possible Duplicate: Progress unit in ProgressDialog 如何覆盖进度条进度消息,即 61/100 到
我正在用 Objective-C (Cocoa) 编写命令行实用程序的前端。我需要解析输出以检查不同类型的消息。有两种基本类型;信息消息和下载状态消息。信息消息始终以以下内容之一开头:INFO:、WA
我是一名优秀的程序员,十分优秀!