简体   繁体   English

无法弄清楚如何在div末尾删除不必要的空间

[英]Can't figure out how to remove the unnecessary space at end of div

Here's the template I'm using: http://tympanus.net/Blueprints/ElasticContentSlider/ Source here: http://tympanus.net/codrops/2013/02/26/elastic-content-slider/ 这是我使用的模板: http : //tympanus.net/Blueprints/ElasticContentSlider/此处来源: http : //tympanus.net/codrops/2013/02/26/elastic-content-slider/

Closest I've gotten is changing the height of '.main' but it changes the size of the main content box. 我最近得到的是更改'.main'的高度,但是它更改了主内容框的大小。

尝试放置html, body, .container, .main {overflow:hidden;}这是最适合您的解决方案...

to remove the extra space change your css to something like this: 要删除多余的空间,请将CSS更改为以下内容:

body .container { height:72%;}
.cbp-contentslider { height:100%;}

To simplify the layout even further I would suggest: 为了进一步简化布局,我建议:

 body .container { height:66%;}
.cbp-contentslider { height:100%;}
.main, .container > header { padding:0; width:82%; } // Don't need such padding for .main just use width/margin

this is what you need 这就是你所需要的

.cbp-contentslider li > div {
position: absolute;
top: 9em;
bottom: 3.313em;
width: 100%;
left: 0;
padding: 0 1em;
overflow-x: hidden;
overflow-y: hidden;  //changed this from `auto` to `hidden`
}

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM