2017-02-09 52 views
0

嗨,我的问题是有人可以帮助我成为我的内容在页脚的滚动条。固定div下的HTML/CSS/JS内容滚动条

How it looks on the browser

这里代码片段

HTML:

<body> 
    <div class="major"> 
     <div class="torso"> 
     <div id="gallery"> 
     </div> 
     <div class="bone"> 
      <div class="aero"> 
       Menu 
      </div> 
      <div class="magneticaero"> 
       <a href="index.html" class="geo"> 
        <div class="chest"> 
         <div class="flaticon-house158"> 
         </div> 
        </div> 
       </a> 
      </div> 
     </div> 
    </div> 
</body> 

CSS:

html,head,body,p,div,a,ul,h2{ 
margin: 0; 
padding: 0; 
font-family: sans-serif,Century Gothic,CenturyGothic,AppleGothic; 
text-decoration: none;} 

.major{ 
max-width: 100%; 
max-height: 100%; 
width: 100%; 
height: 100%; 
margin: 0; 
padding: 0; 
position: fixed;} 

.torso{ 
width: 100%; 
height: 100%; 
margin: 0; 
padding: 0; 
overflow-y: scroll;} 

.bone{ 
width: 100%; 
height: 70px; 
margin: 0; 
padding: 0; 
bottom: 0; 
position: fixed; 
background-color: #C2C2C2; 
text-align: center; 
transition: 1s;} 

.aero{ 
width: 100%; 
height: 40px; 
box-shadow: 0 0 1px #FFF; 
padding-top: 15px; 
padding-bottom: 15px; 
font-size: 30px; 
font-weight: bold; 
color: #FFF;} 

.magneticareo{ 
width: 100%; 
height: 360px;} 

.chest{ 
width: 25%; 
height: 350px; 
box-shadow: 0 0 1px #FFF; 
float: left; 
font-size: 25px; 
font-weight: bold; 
color: #FFF;} 

.boneup{ 
height: 350px;} 

.photo{ 
width: 100%; 
height: auto; 
padding: 0; 
margin: 0;} 

.order{ 
width: 20%; 
height: auto; 
padding: 0; 
margin: 0; 
float: left;} 

The solution i search

,我会真的很感谢如果有人能帮助我:-) 添

+0

你到底想要达到什么目的? –

+0

我尝试成为第一张图片上的页脚上的滚动条,您看到一个箭头,我希望滚动条在那里箭头指向的位置。对不起语法错误,我希望你能理解所有的东西 –

+0

@SorangwalaAbbasali我在最后添加了一张新图片,可能会帮助你理解我的问题。我希望它看起来像在图片上。 –

回答

0

采取.aero的所有其他元素,将其移动正上方</body>,并与bottom: 0

我给它一个固定的位置此外,将.major的高度设置为calc(100% - 40px),即高度为窗口减去.aero的高度。 (并使用它box-sizing: border-box真的只能使40像素高。)看到网站后

此外:指定height: calc(100% - 70px);.torso-gallery - 这有我与上述相同的效果,你将不必再改变你的HTML结构。

+0

可悲的是,没有为我工作的滚动条仍然在错误的地方 –

+0

你有一个服务器上,我们可以看到它的网站? – Johannes

+0

我在测试网站上传了所有内容:https://profiletestsite.000webhostapp.com/gallery.html –