skip to content
Advertise here

A Tab Menu with pointer

CSS play Support


CSS play Recommend

Free, practical CSS menus, layouts, and examples

Follow CSS play

Facebook  Twitter  Facebook Fan Page



Just CSS | Designs for the future

Like the CSS Zen Garden?
Then why not visit Just CSS and see it you can design for the future.




Information

An unordered list styled to give a horizontal tabbed list with a central pointer under each link on hover. Works in IE5.5, IE6, Firefox, Opera 8, Mozilla and NN 8. Doesn't work in Mac IE5 (why am I not suprised anymore . . . ho hum).

This menu does not use any images, will resize to fit any link text and will keep the pointer centrally positioned. It was produced whilst helping Sven Glazenburg with his menu problem.

Cascading Style Sheet

.menu {
  padding:0; 
  margin:0; 
  list-style-type:none;
  white-space:nowrap;
  }
.menu li {
  float:left;
  min-width:100px;
  }
.menu a {
  position:relative;
  display:block; 
  text-decoration:none; 
  min-width:100px; 
  float:left; 
  }
* html .menu a {
  width:100px;
  }
.menu a span {
  display:block; 
  color:#000; 
  background:#c4c4c4; 
  border:1px solid #fff; 
  border-width:2px 1px; 
  text-align:center; 
  padding:4px 16px; 
  cursor:pointer;
  }
* html .menu a span {
  width:100px; 
  cursor:hand; 
  w\idth:66px;
  }
.menu a b {
  display:block; 
  border-bottom:2px solid #06a;
  }
.menu a em {
  display:none;
  }
.menu a:hover {
  background:#fff;
  }
.menu a:hover span {
  color:#fff; 
  background:#08c;
  }
.menu a:hover em {
  display:block; 
  overflow:hidden; 
  border:6px solid #06a; 
  border-color:#06a #fff; 
  border-width:6px 6px 0 6px; 
  position:absolute; 
  left:50%; 
  margin-left:-6px;
  }

xhtml

<ul class="menu">
  <li>
    <a href="#nogo">
      <b><span>Tab One</span></b><em></em>
    </a>
  </li>
  <li>
    <a href="#nogo">
      <b><span>Tab Two</span></b><em></em>
    </a>
  </li>
  <li>
    <a href="#nogo">
      <b><span>Tab Three: Long Tab!!</span></b><em></em>
    </a>
  </li>
  <li>
    <a href="#nogo">
      <b><span>Tab Four</span></b><em></em>
    </a>
  </li>
</ul>



Copyright

You may use this method on your personal 'non-profit' web site without seeking my permission. A link back to CSSplay is always appreciated.

Commercial usage is also permitted without seeking approval, but I would ask that a donation is considered to support my work on CSSPlay.

If you are having problems integrating any of my demonstrations into your website then I now offer a service to fault find and correct any errors that you may have introduced. Please email me for more information.




  • Each week the Creare Group produce video tutorials for SEO and tips and tricks for the web design industry.
  • We offer nothing but the highest quality SEO, Social Media Optimisation And PPC services to businesses in London

 

CSS play Testimonial

"The citroen.co.uk web site uses
CSS play code for the site drop down menus.
This code works seamlessly in IE 6 & 7, and is an excellent solution to the Creative requirements of the site."

Damon Clark - Brandwidth