css position:absolute align center bottom

zyip發表於2015-06-12

 

 

 

<!DOCTYPE html>
<html>
<head>
  <meta charset="utf-8">
  <title>JS Bin</title>
</head>
<body>

  <div class="div1">
    
      <div class="div2"></div>
    
  </div>

</body>
</html>

 

 

 

.div1{
  
  border:solid 1px red;
  width:100%;
  height:400px;
  position:relative;
  margin-top:80px;
}


.div2{
  border:solid 1px red;
  width:100%;
  height:60px;
  position:absolute;
  margin:auto;
  bottom: 0; right: 0;
  box-sizing: border-box;
  border-left:none;
  border-right:none;
  border-bottom:none;
}

 

 

 

 

 

 

 

http://jsbin.com/miciburuwo/1/

 

相關文章