CSS Layout How to - Absolute position to top and left for Tab menu








Question

We would like to know how to absolute position to top and left for Tab menu.

Answer


<!DOCTYPE html>
<html>
<head>
<style type='text/css'>
ul {<!--   w  ww .jav a  2s.c  om-->
  position: absolute;
  top: 75px;
  left: 200px;
  width: 620px !important;
}

li {
  text-transform: uppercase;
  letter-spacing: 2px;
  padding: 5px;
  margin-right: 16px;
  border: 1px solid black;
  white-space: pre-wrap;
  margin-bottom: 20px;
  float: left;
}
</style>
</head>
<body>
  <ul>
    <li><a>hello</a></li>
    <li>welcome</li>
    <li>welcome</li>
    <li>welcome</li>
    <li>welcome</li>
  </ul>
</body>
</html>

The code above is rendered as follows: