Page Widget How to - hr with no space








Question

We would like to know how to hr with no space.

Answer


<!DOCTYPE html>
<html>
<head>
<style type='text/css'>
p {<!--   ww  w .j av  a  2 s .com-->
  margin: 0;
  padding: 0;
  background: #eee;
}

hr {
  border-top: 1px solid #000;
  padding: 0;
  margin: 0;
  font-size: 0;
  display: block;
  height: 0;
  line-height: 0;
  background: #f00;
  color: #f00;
}

hr {
  margin: -7px 0!ie7;
}
</style>
</head>
<body>
  <p>text here</p>
  <hr>
  <p>some more text</p>
</body>
</html>

The code above is rendered as follows: