Page Widget How to - Create CSS3 3D Text








Question

We would like to know how to create CSS3 3D Text.

Answer


<!DOCTYPE html>
<html>
<head>
<style type='text/css'>
#txt {<!-- www .jav  a  2 s  .  c o  m-->
  width: 750px;
  font-size: 55px;
  margin: 225px auto;
  text-align: center;
  font-family: Sans-Serif;
  color: #fff;
  text-shadow: 0px 0px 2px #686868, 
               0px 1px 1px #ddd, 
               0px 2px 1px #d6d6d6,
             0px 3px 1px #ccc, 
             0px 4px 1px #EEE, 
             0px 5px 1px #c1c1c1, 
             0px 6px 1px #bbb, 
             0px 7px 1px #777, 
             0px 8px 3px rgba(100, 100, 100, 0.4), 
             0px 9px 5px rgba(100, 100, 100, 0.1), 
             0px 10px 7px rgba(100, 100, 100, 0.15), 
             0px 11px 9px rgba(100, 100, 100, 0.2), 
             0px 12px 11px rgba(100, 100, 100, 0.25), 
             0px 13px 15px rgba(100, 100, 100, 0.3);
}
</style>

</head>
<body>
  <div id="txt">java2s.com</div>
</body>
</html>

The code above is rendered as follows: