2015-10-18 56 views
0

如何使所有的div图像在同一个地方

html { 
 
    font-family: 'Open Sans', sans-serif; 
 
} 
 

 
body {margin: 0; 
 
    padding: 0; 
 
} 
 

 
#wrapper { 
 
    padding-left:50px; 
 
    padding-top:30px; 
 
} 
 

 
#third, fifth { 
 
    background-color:#E8E8E8 ; 
 
} 
 
    
 
img[src^="my_menu.png"] { 
 
    z-index:10; 
 
} 
 
    
 
#second, #third, #fourth, #fifth { 
 
    width:100%; 
 
    height:100vh; 
 
    padding:0px; 
 
    margin:0; 
 
    margin-left:auto; 
 
    margin-right:auto; 
 
    background-color:white; 
 
    z-index:-1; 
 
} 
 

 
#second { 
 
    width:100%; 
 
    height:100vh; 
 
    padding:0px; 
 
    margin:0; 
 
    margin-left:auto; 
 
    margin-right:auto; 
 
    margin-top:100vh; 
 
} 
 

 
#fourth, #second { 
 
     background-color:grey; 
 
}
<!DOCTYPE html> 
 
<html> 
 
    <head> 
 
     <title>Add gospel Přerov</title> 
 
     
 
     <meta charset="utf-8" /> 
 
     <meta name="viewport" content="width=device-width" /> 
 
     <link href='https://fonts.googleapis.com/css?family=Open+Sans' rel='stylesheet' type='text/css'> 
 
    </head> 
 
    
 
    <body> 
 
     <div class="wrapper"> 
 
      <div id="second">  
 
      </div> 
 
      
 
      <div id="third">  
 
      </div> 
 
       
 
      <div id="fourth"> 
 
      </div> 
 
       
 
      <div id="fift"> 
 
      </div> 
 
     </div> 
 
    </body> 
 
</html>

我想提出一个网站,我的客户,我需要帮助。我想制作4个div,高度为100vh,宽度等于100%。这就是我所拥有的。现在,我需要将箭头朝向所有这些div,位于底部中心的某个位置。怎么做?

+1

请发布一些相关的代码,我们可以一起工作,甚至更好 - 提供[小提琴] (http://jsfiddle.net)演示。 –

回答

2

我不确定这是你想要的,但根据你的问题,这可能是你想达到的目标。刚刚创建,并内置图像div(你也可以使用background属性箭头图像)

html * { 
 
    box-sizing: border-box; 
 
} 
 
html, 
 
body { 
 
    height: 100%; 
 
} 
 
.full { 
 
    position: relative; 
 
    height: 100vh; 
 
    width: 100%; 
 
} 
 
.full:nth-child(1) { 
 
    background: cyan; 
 
} 
 
.full:nth-child(2) { 
 
    background: magenta; 
 
} 
 
.full:nth-child(3) { 
 
    background: yellow; 
 
} 
 
.full:nth-child(4) { 
 
    background: lightgray; 
 
} 
 
.arrow-down { 
 
    position: absolute; 
 
    bottom: 10px; 
 
    width: 32px; 
 
    height: 32px; 
 
    left: calc(50% - 16px); 
 
} 
 
.arrow-down > img { 
 
    width: 100%; 
 
}
<div class="full"> 
 
    <div class="arrow-down"> 
 
    <img src="https://cdn3.iconfinder.com/data/icons/google-material-design-icons/48/ic_keyboard_arrow_down_48px-128.png" alt="arrow-down"> 
 
    </div> 
 
</div> 
 
<div class="full"> 
 
    <div class="arrow-down"> 
 
    <img src="https://cdn3.iconfinder.com/data/icons/google-material-design-icons/48/ic_keyboard_arrow_down_48px-128.png" alt="arrow-down"> 
 
    </div> 
 
</div> 
 
<div class="full"> 
 
    <div class="arrow-down"> 
 
    <img src="https://cdn3.iconfinder.com/data/icons/google-material-design-icons/48/ic_keyboard_arrow_down_48px-128.png" alt="arrow-down"> 
 
    </div> 
 
</div> 
 
<div class="full"> 
 
    <div class="arrow-down"> 
 
    <img src="https://cdn3.iconfinder.com/data/icons/google-material-design-icons/48/ic_keyboard_arrow_down_48px-128.png" alt="arrow-down"> 
 
    </div> 
 
</div>

+1

正是我想要的!感谢兄弟:) –

+0

@PetrCihlar不用客气;) –

相关问题