We help IT Professionals succeed at work.
Get Started

css for tabs problem

Panos asked
Last Modified: 2012-05-12
Hello experts.
I need help to style my tabs menu.
The problem i have is to "hide" the border at the bottom on hover and second  trying to style the active tab  with the same hover style.
I'm trying to use a negative bottom margin for the ul tag but it is not working.
Any help?

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
<style type="text/css">
.tabs {height:26px; margin:0}
.tabs ul,.tabs li,.tabs a{font-family: Verdana,Helvetica,Arial,Sans-Serif;
    font-size: 12px;text-decoration:none;color:#272727;list-style:none;margin:0;padding:0;line-height:1}
.tabs li{display:inline}
.tabs li a,.tabs li span{height:26px;float:left;cursor:pointer}
.tabs a{background:url('menu/images/Detailmenu/left.jpg') left no-repeat;padding-left:47px;}
.tabs .right{padding-right:47px}
.tabs .center{background:url('menu/images/Detailmenu/center.jpg') repeat-x;margin-right:-47px;min-width:47px;padding:11px 0 0px 0;height:15px;}
.tabs .start{background:url('menu/images/Detailmenu/farleft.jpg') left no-repeat}
.tabs .end{background:url('menu/images/Detailmenu/farright.jpg') right no-repeat;padding-right:94px}
.tabs a:hover{background:url('menu/images/Detailmenu/right.jpg');}
.tabs a.start:hover{background:url('menu/images/Detailmenu/farlefthover.jpg');}
.tabs a:hover .end{background:url('menu/images/Detailmenu/farrighthover.jpg') right;}
.tabs a:hover .center{background:url('menu/images/Detailmenu/centerhover.jpg');font-weight:bold;color:#F60;;padding:8px 0 0 0;height:18px;}
.tabs a:hover .right{background:url('menu/images/Detailmenu/lefthover.jpg') right;padding-right:94px;margin-right:-47px;position:relative;}
.divcontainer{width:400px; height:100px;text-align:left;margin-bottom:10px;border: thin solid #CCC;}
 <ul class="tabs">
  <li id="li_tab1" class="li_tab1">
   <a href="#" class="start">
    <span class="right"><span class="center">Test</span></span>
  <li id="li_tab2" class="li_tab2">
   <a href="#">
    <span class="right"><span class="center">Test</span></span>
  <li id="li_tab3" class="li_tab3">
   <a href="#tab3">
    <span class="end"><span class="center">Test</span></span>
<div class="divcontainer">

Open in new window

Watch Question
Top Expert 2013
This problem has been solved!
Unlock 2 Answers and 11 Comments.
See Answers
Why Experts Exchange?

Experts Exchange always has the answer, or at the least points me in the correct direction! It is like having another employee that is extremely experienced.

Jim Murphy
Programmer at Smart IT Solutions

When asked, what has been your best career decision?

Deciding to stick with EE.

Mohamed Asif
Technical Department Head

Being involved with EE helped me to grow personally and professionally.

Carl Webster
CTP, Sr Infrastructure Consultant
Ask ANY Question

Connect with Certified Experts to gain insight and support on specific technology challenges including:

  • Troubleshooting
  • Research
  • Professional Opinions
Did You Know?

We've partnered with two important charities to provide clean water and computer science education to those who need it most. READ MORE