HTML Element Style How to - Create tag button like Span








Question

We would like to know how to create tag button like Span.

Answer


<!DOCTYPE html>
<html>
<head>
<style type='text/css'>
.btn {<!--  ww  w . j  a v  a 2s  . c o  m-->
  display: block;
  width: 100px;
  background: #eee;
  padding: 2px;
  border-radius: 2px
}
</style>
</head>
<body>
  <span class="btn">java2s.com</span>
</body>
</html>

The code above is rendered as follows: