我一直在尝试一段时间,以中心一个div,并保持它在更高的分辨率(1920 x 1200及以上)溢出,我试图增加width:auto
或使用定位,但没有任何工作,所以我希望有人可以指引我走向正确的方向。在更高的分辨率溢出分区
这是我的div:
而这正是发生在更高的分辨率:
这个div是另外一个内所以这里它既是CSS和html for both:
/*Parent*/
.main-graphic-container {
border-radius: 5px;
padding-right: 75px;
padding-left: 75px;
padding-bottom: 35px;
margin-top: 20px;
margin-bottom: 20px;
background-color: #ebebeb;
}
/*Child*/
.feature-container {
height: 80px;
position: absolute;
z-index: 1;
margin-top:80px;
margin-left:45px;
padding-top: 10px;
border-style: solid;
border-width: 1px;
border-color: #888888;
background-color: #ffffff;
}
<div class="container main-graphic-container">
<div class="row">
...
</div>
<!-- end row -->
<!-- Child container so troublesome-->
<div class="container ">
<div class="row">
<div class="center-block">
<h1 class="greyText col-md-8 col-md-offset-2">LOREM IPSUM DOLOR SIT AMET. </h1>
<!-- Title -->
<!-- Info container -->
<div class="col-md-8 col-md-offset-1 feature-container">
<!-- Left -->
<div class="col-md-6">
<h4 class="bold blue-title text-center">Lorem ipsum</h4>
</div>
<!-- Right -->
<div class="col-md-6">
<h4 class="grey-title">Lorem ipsum</h4>
</div>
</div>
</div>
</div>
</div>
任何反馈将不胜感激。
使用媒体查询更改分辨率(1920×1200及以上) –
你试图使用**媒体查询后,你的CSS **了吗?当屏幕分辨率改变时,它们非常适合调整文档的不同元素。以下是您应该检查的一些链接:https://developer.mozilla.org/en-US/docs/Web/CSS/Media_Queries/Using_media_queries,http://www.w3schools.com/css/css_rwd_mediaqueries.asp,这里是一个例子:http://www.w3schools.com/css/tryit.asp?filename=tryresponsive_breakpoints。希望这有助于:) – IchHabsDrauf
@andihamolli谢谢我会研究它。 –