Html 具有固定标题/标题的内联div
我有这个CSS代码:Html 具有固定标题/标题的内联div,html,css,Html,Css,我有这个CSS代码: .homeBoxes { width: 49%; display:inline; float:left; overflow-y:scroll; min-height:300px; max-height:350px; margin-right:5px; margin-left:5px; margin-top:10px; margin-bottom:10px; } .title { marg
.homeBoxes {
width: 49%;
display:inline;
float:left;
overflow-y:scroll;
min-height:300px;
max-height:350px;
margin-right:5px;
margin-left:5px;
margin-top:10px;
margin-bottom:10px;
}
.title {
margin:0 auto 0 auto;
padding:2px;
font-size:20px;
background-color:#f36f25;
}
我希望标题固定在.homeboxs
div和100%内(不显示标题右侧的滚动条)
仅在div中固定,而不是在整个页面上
你可以这样做: HTML:
<div class="homeBoxes_container">
<div class="title">Title</div>
<div class="homeBoxes">TEXT</div>
</div>
.homeBoxes_container {
clear:both;
width: 49%;
min-height:300px;
max-height:350px;
}
.homeBoxes {
width:100%;
display:inline;
float:left;
overflow-y:scroll;
margin-right:5px;
margin-left:5px;
margin-top:10px;
margin-bottom:10px;
min-height:300px;
max-height:350px;
}
设置溢出属性
.homeBoxes
{
width: 49%;
display:inline;
float:left;
overflow-y:scroll;
min-height:300px;
max-height:350px;
margin-right:5px;
margin-left:5px;
margin-top:10px;
margin-bottom:10px;
overflow: hidden;
}
如果要滚动到内容,请指定溢出:自动或滚动。溢出:隐藏;试试这个。。您已经给出了最小高度和最大高度。看看那个。。我在哪里可以试试?看看我的编辑,找到了!:)非常好,谢谢!