HTML Element Style How to - Use bottom border to separate two div








Question

We would like to know how to use bottom border to separate two div.

Answer


<!DOCTYPE html>
<html>
<head>
<style type='text/css'>
#test {<!--from  www  .j a v a2  s.co  m-->
  min-height: 50px;
  border-bottom: 1px solid #bbb;
}

#hello {
  min-height: 200px;
}

.container {
  border: 1px solid black;
}
</style>
</head>
<body>
  <div class="container">
    <div id="test"></div>
    <div id="hello"></div>
  </div>
</body>
</html>

The code above is rendered as follows: