2017-05-11 2 views
0

私はHTMLとCSSのコードの問題でも、CSSでoverflow: scrollプロパティを使用した後、あるhereボーダーの底が

を添付しています私のWebページに欠けて、ページの下部には表示されませんいくつかの奇妙な割合に。もう一つの問題は、境界線だけではありません。その下にあるものはすべて表示されず、下にスクロールして表示されます。 divコンテナにスクロールプロパティを与えると、イメージの位置が破棄されます。

body { 
 
    background-color: #001126; 
 
    margin: 0; 
 
    overflow: scroll; 
 
} 
 

 
.container { 
 
    border-style: solid; 
 
    border-color: white; 
 
    margin: 70px; 
 
    color: white; 
 
    padding: 80px; 
 
    font-size: 30px; 
 
    position: fixed; 
 
} 
 

 
.menu { 
 
    top: -40px; 
 
    left: -40px; 
 
    position: absolute; 
 
} 
 

 
.social { 
 
    margin-top: 5%; 
 
    position: absolute; 
 
} 
 

 
.icons; 
 
{ 
 
    position: absolute; 
 
} 
 

 
#img { 
 
    padding-left: 20px; 
 
    padding-bottom: 10px; 
 
}
<div class="container"> 
 
    <div class="contents"> 
 
     <p id="text">It is a long established fact that a reader will be distracted by the readable content of a page when looking at its layout. The point of using Lorem Ipsum is that it has a more-or-less normal distribution of letters, as opposed to using 'Content 
 
     here, content here', making it look like readable English. Many desktop publishing packages and web page editors now use Lorem Ipsum as their default model text, and a search for 'lorem ipsum' will uncover many web sites still in their infancy. 
 
     Various versions have evolved over the years, sometimes by accident, sometimes on purpose (injected humour and the like).</p> 
 
    </div> 
 
    <div class="menu"><img src="icon.png" style="height: 50%;width:50%"></div> 
 
    <div class="social"> 
 
     <div class="icons"> 
 
     <img src="fb.png" style="height: 8%;width:8%" id="img"> 
 
     <img src="insta.png" style="height: 8%;width:8%" id="img"> 
 
     <img src="tw.png" style="height: 8%;width:8%" id="img"> 
 
     <img src="u.png" style="height: 8%;width:8%" id="img"> 
 
     <img src="vid.png" style="height: 8%;width:8%" id="img"> 
 
     </div> 
 
    </div>

+0

をエド? –

+0

_ "私はそれを見るために下にスクロールします" _ - あなたはただ '固定 'が今何を意味しているかを発見しています...? – CBroe

答えて

2

あなたはコンテナにposition: fixedを与えたbeacuseこれがいました。

body { 
 
    background-color: #001126; 
 
    height: auto; 
 
    margin: 0; 
 
    overflow: scroll; 
 
} 
 

 
.container { 
 
    border-style: solid; 
 
    border-color: white; 
 
    height: 100%; 
 
    margin: 70px; 
 
    color: white; 
 
    padding: 80px; 
 
    font-size: 30px; 
 
}
<div class="container"> 
 
    <div class="contents"> 
 
    <p id="text">some large text</p> 
 
    </div> 
 
    <div class="menu"><img src="icon.png" style="height: 50%;width:50%"></div> 
 
    <div class="social"> 
 
    <div class="icons"> 
 
     <img src="fb.png" style="height: 8%;width:8%" id="img"> 
 
     <img src="insta.png" style="height: 8%;width:8%" id="img"> 
 
     <img src="tw.png" style="height: 8%;width:8%" id="img"> 
 
     <img src="u.png" style="height: 8%;width:8%" id="img"> 
 
     <img src="vid.png" style="height: 8%;width:8%" id="img"> 
 
    </div>

0

ここplunkrソリューション見つけてください:修正:あなたがポジションを使用している理由

https://plnkr.co/edit/aA4aKpRa467kCuXcZ6bp?p=preview

body { 
 
    background-color: #001126; 
 
    margin: 0; 
 
} 
 

 
.container { 
 
    border-style: solid; 
 
    border-color: white; 
 
    height: 100%; 
 
    margin: 70px; 
 
    color: white; 
 
    padding: 80px; 
 
    font-size: 30px; 
 
} 
 

 
.menu { 
 
    top: -40px; 
 
    left: -40px; 
 
    position: absolute; 
 
} 
 

 
.social { 
 
    margin-top: 5%; 
 
    position: absolute; 
 
} 
 

 
.icons; 
 
{ 
 
    position: absolute; 
 
} 
 

 
#img { 
 
    padding-left: 20px; 
 
    padding-bottom: 10px; 
 
}
<div class="container"> 
 
    <div class="contents"> 
 
    <p id="text">It is a long established fact that a reader will be distracted by the readable content of a page when looking at its layout. The point of using Lorem Ipsum is that it has a more-or-less normal distribution of letters, as opposed to using 'Content 
 
     here, content here', making it look like readable English. Many desktop publishing packages and web page editors now use Lorem Ipsum as their default model text, and a search for 'lorem ipsum' will uncover many web sites still in their infancy. 
 
     Various versions have evolved over the years, sometimes by accident, sometimes on purpose (injected humour and the like).</p> 
 
    </div> 
 
    <div class="menu"><img src="icon.png" style="height: 50%;width:50%"></div> 
 
    <div class="social"> 
 
    <div class="icons"> 
 
     <img src="fb.png" style="height: 8%;width:8%" id="img"> 
 
     <img src="insta.png" style="height: 8%;width:8%" id="img"> 
 
     <img src="tw.png" style="height: 8%;width:8%" id="img"> 
 
     <img src="u.png" style="height: 8%;width:8%" id="img"> 
 
     <img src="vid.png" style="height: 8%;width:8%" id="img"> 
 
    </div> 
 
    </div>

関連する問題