2017-06-19 37 views
0

我做了一個新的佈局,但有邊帶或邊線(我的意思是滾動線「當太多的內容」,你必須滾動很多「,但這條邊線在谷歌瀏覽器的底部)出現在全視口不知道爲什麼會發生如果我將100vw的包裝寬度更改爲90,則右側的空白區域不好。以下是圖像:我作了一個佈局,邊帶或副業出現不知道爲什麼

enter image description here

這裏是我的代碼:

<!DOCTYPE html> 
<html> 
<head> 
    <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/meyer-reset/2.0/reset.css"> 
<script src="https://code.jquery.com/jquery.min.js"></script> 
<link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css" rel="stylesheet" type="text/css" /> 
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/js/bootstrap.min.js"></script> 

    <meta charset="utf-8"> 
    <meta name="viewport" content="width=device-width"> 
    <title>JS Bin</title> 
</head> 
<body> 
<div class="wrap"> 
    <div class="el2">header</div> 
    <div class="el1">left</div> 
    <div class="el3"> 
    <div class="el5">pakk1</div> 
    <div class="el6">pakk1</div> 
    phakk 
    </div> 
    <div class="el4">footer</div> 
</div> 

</body> 
</html> 



* { 
    box-sizing: border-box; 
} 
.wrap { 
    width: 100vw; 
    height: 100vh; 
    background: grey; 



} 

.el2 { 
    width: 100vw; 
    height: 30vh; 
    background: #C2FF76; 
} 

.el1 { 
    width: 20vw; 
    height: 70vh; 
    background: blue; 
    float:left; 
} 
.el3 { 
    float:left; 
    width: 80vw; 
    height: 70vh; 
    background: red; 
} 
.el4 { 

    width: 100vw; 
    height: 13vh; 
    background: purple; 
    float:left; 
} 
.el5 { 
    width: 30vw; 
    height: 13vh; 
    background: green; 
    float:left; 
} 
.el6 { 
    width: 40vw; 
    height: 13vh; 
    background: green; 
    float:right; 
} 

回答

0

如果您將溢出隱藏在最上面的容器中,則此問題將消失。

.wrap { 
    overflow: hidden; 
} 

很好理解爲什麼你有溢出,所以你可以解決潛在的問題。

https://css-tricks.com/findingfixing-unintended-body-overflow/

注意:您也可以只改變溢出的X軸和Y軸

https://css-tricks.com/almanac/properties/o/overflow/

+0

但喬納森如果它隱藏所有的邊線我的意思是右側,我不能向下滾動檢查底部內容/頁腳。我只是想排除底線,而不是右邊。這有什麼可能嗎?我要檢查那個鏈接 –

0

引導上的一些元素使用消極的一面利潤率,這是什麼原因導致你的問題。

只需將所有vw值更改爲%值(相同的數值) - 這些都考慮父元素的「真實寬度」。

https://codepen.io/anon/pen/MopXrq

0

其實,問題是一些盒子的高度:VH超過了限制。

相關問題