Page Widget How to - Create hightlight for text with round border using CSS3 border-radius








Question

We would like to know how to create hightlight for text with round border using CSS3 border-radius.

Answer


<!DOCTYPE html>
<html>
<head>
<style type='text/css'>
div {<!--   ww  w. j  a  v a  2s.  c om-->
  background: #fcf8b3;
  border: 1px solid #aaa;
  margin: 10px;
  padding: 10px;
  width: 330px;
  -webkit-border-radius: 7px;
  -moz-border-radius: 7px;
  border-radius: 7px;
}
</style>

</head>
<body>
  <div>Rounded corners are pretty cool.</div>
</body>
</html>

The code above is rendered as follows: