简体   繁体   English

Flexbox在页面右侧创建空白

[英]Flexbox creates blank space on the right of a page

Whenever i remove the flex display- it goes away. 每当我卸下Flex显示屏时,它就会消失。 Can't understand what's happening there. 无法理解那里发生了什么。 Been going through source up and down, but no element seems to be stretching there. 一直在源头上下移动,但是似乎没有任何元素在那儿延伸。

html of it 的HTML

<div class="newheadwrap">
<div class="newlogo newhead">with contents</div>
<div class="newtagline newhead" >with contents</div>
<div class="mainhead newhead">with contents</div>
</div>

and the css 和CSS

.newheadwrap {
-o-display:flex;
-webkit-display:flex;
-ms-display:flex;
-moz-display:flex;
display:flex;  
flex-direction:row;
width:966px;
margin:0 auto;
}
.newlogo {
width:17%;
padding-top:43px;
}
.newtagline {
width:33%;  
color:white;
padding-top:93px;
font-family: berkeleyFont;
font-size:16px;
float:right !important;
}
.mainhead {
width:50%;
}

I know it's not advised to post live links here, but fiddle will not do in this case, so, here is a link https://aps-direct.myshopify.com 我知道不建议在此处发布实时链接,但是在这种情况下,提琴将不起作用,因此,这里是一个链接https://aps-direct.myshopify.com

One way to remove the extra padding to the right side of your current page: 删除当前页面右侧多余的填充的一种方法:

Add overflow: hidden; 添加overflow: hidden; to the .newheadwrap .newheadwrap

.newheadwrap {
-o-display: flex;
-webkit-display: flex;
-ms-display: flex;
-moz-display: flex;
display: flex;
flex-direction: row;
width: 966px;
margin: 0 auto;
overflow: hidden;
}

You have extra space because of this: 因此,您有多余的空间:

.span9 {
width: 717px;
}

reduce the width and it will fit 减少宽度,它将适合

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

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