I am trying to create a main menu on a site with css and lists. The following is my html and css. I would like to get rid of the border between between themain item and subitems so it looks like a tab when hovered over. Any help would be appreciated. THanks you.
<div id="menuwrapper">
<ul id="p7menubar">
<li id="MainItem3"><a href="#">Home</a></li>
<li id="MainItem"><a href="#">Trigger One</a>
<ul>
<li class="topItem"><a href="#">Sub 1.1</a></li>
<li><a href="#">Sub 1.2</a></li>
<li><a href="#">Sub 1.3</a></li>
<li class="bottomItem"><a href="#">Sub 1.4</a></li>
</ul>
</li>
<li id="MainItem1"><a href="#">Trigger Two</a>
<ul>
<li><a href="#">Sub 2.1</a></li>
<li><a href="#">Sub 2.2</a></li>
<li><a href="#">Sub 2.3</a></li>
<li><a href="#">Sub 2.4</a></li>
<li><a href="#">Sub 2.5</a></li>
</ul>
</li>
<li id="MainItem2"><a href="#">Trigger Three</a>
<ul>
<li><a href="#">Sub 3.1</a></li>
<li><a href="#">Sub 3.2</a></li>
<li><a href="#">Sub 3.3</a></li>
<li><a href="#">Sub 3.4</a></li>
<li><a href="#">Sub 3.5</a></li>
<li><a href="#">Sub 3.6</a></li>
<li><a href="#">Sub 3.7</a></li>
<li><a href="#">Sub 3.8</a></li>
</ul>
</li>
</ul>
<br class="clearit">
</div>
</div>
/*
------------------------------------
PVII Menu CSS Express Drop-Down Menu
by Project Seven Development
------------------------------------
*/
/*
Container for the menu. We set top and bottom borders only because the menu container
stretches the entire window width. Note that this container can go inside a fixed width
element that is centered on the page, if you so desire. It can even go inside a table cell.
It carries a background image for aesthetics.
*/
#menuwrapper
{
background-repeat: repeat-x;
}
/*Clears the floated menu items.
Assigned to a BR tag placed just before
menuwrapper's closing DIV tag*/
.clearit
{
clear: both;
height: 0;
line-height: 0.0;
font-size: 0;
}
/*
p7menubar is the root UL and p7menubar ul applies to all the sub-menu ULs.
We set padding and margin to zero to eliminate all indentation, turn bullets off,
and set a font-family different from the global font-family declared for the
body element above. This sets font for just the menu. Do not add a font-size here.
*/
#p7menubar, #p7menubar ul
{
padding: 0;
margin: 0;
list-style: none;
font-family: Arial, Helvetica, sans-serif;
}
/*
Root-Level Links. Do not change the first two properties.
Adjust padding values to make the root links taller and to offset them
from the left and right edges of the link box. The border right creates a
separator between links. Font-size is set here and will apply to all menu levels.
Font color is set to light gray.
*/
#p7menubar a
{
display: block;
text-decoration: none;
padding: 5px 10px 5px 10px;
font-size: .85em;
color: #016799;
}
/*
Class assigned to those Root-Level links that have associated Sub-Menus.
The top and bottom padding assigned this element must be the same as
that assigned to the p7menubar a element. The right padding is increased
to accomodate the display of background image depicting a downward
pointing arrow.
*/
#p7menubar a.trigger
{
padding: 5px 16px 5px 10px;
}
#p7menubar li a.trigger:hover
{
border-top: 1px solid #016799;
}
#p7menubar a.notrigger:hover
{
border-top: 1px solid #016799;
border-bottom: 1px solid #016799;
}
/*
The Root-Level list items. Floating left allows
them to appear horizontally. Width is for IE5 Mac. The last rule in
this style sheet will set the width for this element to auto for all
other browsers - hiding it from IE5 Mac. The width is proportional.
As you add and edit root menu items, you will need to test this width
to ensure it is wide enough to accomodate all text.
*/
#p7menubar li
{
float: left;
width: 9em;
}
/*
Sets width for Sub-Menu box and the List Items inside - in proportional em units.
This allows the sub-menu width to expand if users resize the text in their browsers.
*/
#p7menubar li ul, #p7menubar ul li
{
width: 12em;
}
/*
The sub-menu links. We set color and turn off the right border, which
would otherwise be inherited from the root link rule. We set top and
bottom padding less than the root items and increas the left padding
to indent the sub-menu links a small amount in from the root links.
*/
#p7menubar ul li a
{
color: #016799;
border-right: 0;
padding: 3px 12px 3px 16px;
}
/*
Sub-Menu Unordered Lists describes each dropdown sub-menu grouping.
Positioned Absolutely to allow them to appear below their root trigger.
Set to display none to hide them until trigger is moused over.
Background Color must be set or problems will be encountered in MSIE.
Right and bottom borders are set to simulate a raised look.
A gradient background image is assigned.
*/
#p7menubar li ul
{
position: absolute;
display: none;
background-color: #FFFFFF;
}
#MainItem:hover, #MainItem1:hover, #MainItem2:hover, #MainItem3:hover
{
border-top: 1px solid #016799;
border-bottom: 4px solid #fff;
z-index: 100;
}
#MainItem3:hover
{
border-top: 1px solid #016799;
border-bottom: 1px solid #016799;
}
/*
Changes the Text color and background color when the Root-Level
menu items are moused over. The second selector sets color and background
when Root-Level items are accessed with the keyboard tab key. The third
selector sets an active state to support keyboard access in MSIE. The fourth
selector is assigned to IE5 and IE6 Windows via the P7_ExpMenu script.
Note that IE7 supports hover on elements other than links and so behaves
like Firefox, Opera, and Safari - making the menu operable even if JavaScript
is not enabled.
*/
#p7menubar li:hover a, #p7menubar a:focus, #p7menubar a:active, #p7menubar li.p7hvr a
{
color: #016799;
background-color: #fff;
border-right: 1px solid #016799;
border-left: 1px solid #016799;
}
/*
Set the Sub-Menu UL to be visible when its associated
Root-Level link is moused over. The second selector is
assigned to IE5 and IE6 via the P7_ExpMenu script.
*/
#p7menubar li.bottomItem
{
border-bottom: 1px solid #016799;
}
#p7menubar li.topItem
{
border-top: 1px solid #016799;
}
#p7menubar li:hover ul, #p7menubar li.p7hvr ul
{
display: block;
}
/*
Sets the Text color of the Sub-Level links when the Root-Level
menu items are moused over. The second selector is
assigned to IE5 and IE6 via the P7_ExpMenu script.
The color set should march the normal Sub-Level link color
in the rule: #p7menubar ul li a. The background color must be
transparent to allow the underlying gradient background on the UL
to show through.
*/
#p7menubar li:hover ul a, #p7menubar li.p7hvr ul a
{
color: #000000;
background-color: transparent;
}
/*
The normal hover class for Sub-Level links. The Important directive
is required for older browsers. We set a background color, which shows
over the gradient background. We set text color to white.
*/
#p7menubar ul a:hover
{
background-color: #016799 !important;
color: #FFFFFF !important;
}
/* The single backslash \ character inside this comment
causes IE5 Mac to ignore the following rule, which allows other
browsers to render top-level menu items to their natural width.
Do not edit this rule in any way. */
#p7menubar li
{
width: auto;
}
<div id="menuwrapper">
<ul id="p7menubar">
<li id="MainItem3"><a href="#">Home</a></li>
<li id="MainItem"><a href="#">Trigger One</a>
<ul>
<li class="topItem"><a href="#">Sub 1.1</a></li>
<li><a href="#">Sub 1.2</a></li>
<li><a href="#">Sub 1.3</a></li>
<li class="bottomItem"><a href="#">Sub 1.4</a></li>
</ul>
</li>
<li id="MainItem1"><a href="#">Trigger Two</a>
<ul>
<li><a href="#">Sub 2.1</a></li>
<li><a href="#">Sub 2.2</a></li>
<li><a href="#">Sub 2.3</a></li>
<li><a href="#">Sub 2.4</a></li>
<li><a href="#">Sub 2.5</a></li>
</ul>
</li>
<li id="MainItem2"><a href="#">Trigger Three</a>
<ul>
<li><a href="#">Sub 3.1</a></li>
<li><a href="#">Sub 3.2</a></li>
<li><a href="#">Sub 3.3</a></li>
<li><a href="#">Sub 3.4</a></li>
<li><a href="#">Sub 3.5</a></li>
<li><a href="#">Sub 3.6</a></li>
<li><a href="#">Sub 3.7</a></li>
<li><a href="#">Sub 3.8</a></li>
</ul>
</li>
</ul>
<br class="clearit">
</div>
</div>
/*
------------------------------------
PVII Menu CSS Express Drop-Down Menu
by Project Seven Development
------------------------------------
*/
/*
Container for the menu. We set top and bottom borders only because the menu container
stretches the entire window width. Note that this container can go inside a fixed width
element that is centered on the page, if you so desire. It can even go inside a table cell.
It carries a background image for aesthetics.
*/
#menuwrapper
{
background-repeat: repeat-x;
}
/*Clears the floated menu items.
Assigned to a BR tag placed just before
menuwrapper's closing DIV tag*/
.clearit
{
clear: both;
height: 0;
line-height: 0.0;
font-size: 0;
}
/*
p7menubar is the root UL and p7menubar ul applies to all the sub-menu ULs.
We set padding and margin to zero to eliminate all indentation, turn bullets off,
and set a font-family different from the global font-family declared for the
body element above. This sets font for just the menu. Do not add a font-size here.
*/
#p7menubar, #p7menubar ul
{
padding: 0;
margin: 0;
list-style: none;
font-family: Arial, Helvetica, sans-serif;
}
/*
Root-Level Links. Do not change the first two properties.
Adjust padding values to make the root links taller and to offset them
from the left and right edges of the link box. The border right creates a
separator between links. Font-size is set here and will apply to all menu levels.
Font color is set to light gray.
*/
#p7menubar a
{
display: block;
text-decoration: none;
padding: 5px 10px 5px 10px;
font-size: .85em;
color: #016799;
}
/*
Class assigned to those Root-Level links that have associated Sub-Menus.
The top and bottom padding assigned this element must be the same as
that assigned to the p7menubar a element. The right padding is increased
to accomodate the display of background image depicting a downward
pointing arrow.
*/
#p7menubar a.trigger
{
padding: 5px 16px 5px 10px;
}
#p7menubar li a.trigger:hover
{
border-top: 1px solid #016799;
}
#p7menubar a.notrigger:hover
{
border-top: 1px solid #016799;
border-bottom: 1px solid #016799;
}
/*
The Root-Level list items. Floating left allows
them to appear horizontally. Width is for IE5 Mac. The last rule in
this style sheet will set the width for this element to auto for all
other browsers - hiding it from IE5 Mac. The width is proportional.
As you add and edit root menu items, you will need to test this width
to ensure it is wide enough to accomodate all text.
*/
#p7menubar li
{
float: left;
width: 9em;
}
/*
Sets width for Sub-Menu box and the List Items inside - in proportional em units.
This allows the sub-menu width to expand if users resize the text in their browsers.
*/
#p7menubar li ul, #p7menubar ul li
{
width: 12em;
}
/*
The sub-menu links. We set color and turn off the right border, which
would otherwise be inherited from the root link rule. We set top and
bottom padding less than the root items and increas the left padding
to indent the sub-menu links a small amount in from the root links.
*/
#p7menubar ul li a
{
color: #016799;
border-right: 0;
padding: 3px 12px 3px 16px;
}
/*
Sub-Menu Unordered Lists describes each dropdown sub-menu grouping.
Positioned Absolutely to allow them to appear below their root trigger.
Set to display none to hide them until trigger is moused over.
Background Color must be set or problems will be encountered in MSIE.
Right and bottom borders are set to simulate a raised look.
A gradient background image is assigned.
*/
#p7menubar li ul
{
position: absolute;
display: none;
background-color: #FFFFFF;
}
#MainItem:hover, #MainItem1:hover, #MainItem2:hover, #MainItem3:hover
{
border-top: 1px solid #016799;
border-bottom: 4px solid #fff;
z-index: 100;
}
#MainItem3:hover
{
border-top: 1px solid #016799;
border-bottom: 1px solid #016799;
}
/*
Changes the Text color and background color when the Root-Level
menu items are moused over. The second selector sets color and background
when Root-Level items are accessed with the keyboard tab key. The third
selector sets an active state to support keyboard access in MSIE. The fourth
selector is assigned to IE5 and IE6 Windows via the P7_ExpMenu script.
Note that IE7 supports hover on elements other than links and so behaves
like Firefox, Opera, and Safari - making the menu operable even if JavaScript
is not enabled.
*/
#p7menubar li:hover a, #p7menubar a:focus, #p7menubar a:active, #p7menubar li.p7hvr a
{
color: #016799;
background-color: #fff;
border-right: 1px solid #016799;
border-left: 1px solid #016799;
}
/*
Set the Sub-Menu UL to be visible when its associated
Root-Level link is moused over. The second selector is
assigned to IE5 and IE6 via the P7_ExpMenu script.
*/
#p7menubar li.bottomItem
{
border-bottom: 1px solid #016799;
}
#p7menubar li.topItem
{
border-top: 1px solid #016799;
}
#p7menubar li:hover ul, #p7menubar li.p7hvr ul
{
display: block;
}
/*
Sets the Text color of the Sub-Level links when the Root-Level
menu items are moused over. The second selector is
assigned to IE5 and IE6 via the P7_ExpMenu script.
The color set should march the normal Sub-Level link color
in the rule: #p7menubar ul li a. The background color must be
transparent to allow the underlying gradient background on the UL
to show through.
*/
#p7menubar li:hover ul a, #p7menubar li.p7hvr ul a
{
color: #000000;
background-color: transparent;
}
/*
The normal hover class for Sub-Level links. The Important directive
is required for older browsers. We set a background color, which shows
over the gradient background. We set text color to white.
*/
#p7menubar ul a:hover
{
background-color: #016799 !important;
color: #FFFFFF !important;
}
/* The single backslash \ character inside this comment
causes IE5 Mac to ignore the following rule, which allows other
browsers to render top-level menu items to their natural width.
Do not edit this rule in any way. */
#p7menubar li
{
width: auto;
}