Go Back   CodingForums.com > :: Client side development > HTML & CSS

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 05-09-2011, 11:38 AM   PM User | #1
carbilldyer
New Coder

 
Join Date: Apr 2010
Location: Costa Blanca Spain
Posts: 25
Thanks: 3
Thanked 0 Times in 0 Posts
carbilldyer is an unknown quantity at this point
Cannot align text properly in dropdon LI

I have applied changes to a problem I was having for UL dropdowns as suggested by Harbinger OTV and the ul is now centered but I'm still having a problem with the 2nd level dropdown. There appears to be 2 areas in it - on the left is the text of the li's (with text still wrapped) and on the right is an area with the background I used.

I've tried several combinations of the changes suggested but some just make it even worse.

All I need to finalise now is the dropdown items aligning to the left, not wrapping text with the background situated correctly.

Hope you can help me again.

see www.radycalheating.com/indexeng1.php for example prob.
relevant code is
Code:
#content {
	clear: left;
	color: #ccc;
}

#nav, #nav ul { /* all lists */
	padding: 0;
	margin: 0;
	list-style: none;
	line-height: 1;
	float: left;
	left: 50%;
	position: relative;
        
}

#nav a {
	display: block;
	width: 6.5em;
}

#nav li { /* all list items */
	width: 6.5em; /* width needed or else Opera goes nuts */
        float: left;
	left: -50%;
	position: relative;
	margin: 0 2px;

}

#nav li ul { /* second-level lists */
        overflow: visible;
	position: relative;
	background: #ffe4af;
        z-index: 2;
	width: 12em;
	float: left;     
	left: -999em; /* using left instead of display to hide menus because display: none isn't read by screen readers */
}

#nav li:hover ul, #nav li.sfhover ul { /* lists nested under hovered list items */
	left: auto;
}

#content {
	clear: left;
	color: #ccc;
}
 <div style="background-image: url(i/bg/imagebar2r.png); margin: 0px; height: 20px; text-align: center" >
  <ul id="nav">
	<li><a href="indexeng.php" style="font-size: 15px; font-family: eurostile; font-weight: bold; text-decoration: none; color: #4a1111;" onmouseover="this.style.color='#C9252B'" onmouseout="this.style.color='#4a1111'">Home<img src="i/redline-sep.bmp" alt=" " width="2" height="15" style="padding-left: 10px; padding-right: 10px"></img></a></li>
        
	<li><a href="whatisit.php" style="font-size: 15px; font-family: eurostile; font-weight: bold; text-decoration: none; color: #4a1111;" onmouseover="this.style.color='#C9252B'" onmouseout="this.style.color='#4a1111'">What Is It?<img src="i/redline-sep.bmp" alt=" " width="2" height="15" style="padding-left: 10px; padding-right: 10px"></img></a></li>
        <li><a href="#" style="font-size: 15px; font-family: eurostile; font-weight: bold; text-decoration: none; color: #4a1111;" onmouseover="this.style.color='#C9252B'" onmouseout="this.style.color='#4a1111'">Products<img src="i/redline-sep.bmp" alt=" " width="2" height="15" style="padding-left: 10px; padding-right: 10px"></a>
		<ul>
 		 <li><a href="infraredp.php" style="font-size: 15px; font-family: eurostile; font-weight: bold; text-decoration: none; color: #4a1111;" onmouseover="this.style.color='#C9252B'" onmouseout="this.style.color='#4a1111'">Infrared Radiators</a></li>
		 <li><a href="bbqindex.php" style="font-size: 15px; font-family: eurostile; font-weight: bold; text-decoration: none; color: #4a1111;" onmouseover="this.style.color='#C9252B'" onmouseout="this.style.color='#4a1111'">Traditional Barbecues</a></li>
		 <li><a href="#" style="font-size: 15px; font-family: eurostile; font-weight: bold; text-decoration: none; color: #4a1111;" onmouseover="this.style.color='#C9252B'" onmouseout="this.style.color='#4a1111'">Air Coolers</a></li>
		 <li><a href="energyp.php" style="font-size: 15px; font-family: eurostile; font-weight: bold; text-decoration: none; color: #4a1111;" onmouseover="this.style.color='#C9252B'" onmouseout="this.style.color='#4a1111'">Energy Monitors</a></li>
		</ul>
	</li>
        <li><a href="images.php" style="font-size: 15px; font-family: eurostile; font-weight: bold; text-decoration: none; color: #4a1111;" onmouseover="this.style.color='#C9252B'" onmouseout="this.style.color='#4a1111'">Gallery<img src="i/redline-sep.bmp" alt=" " width="2" height="15" style="padding-left: 10px; padding-right: 10px"></a></li>
        <li><a href="aboutus.php" style="font-size: 15px; font-family: eurostile; font-weight: bold; text-decoration: none; color: #4a1111;" onmouseover="this.style.color='#C9252B'" onmouseout="this.style.color='#4a1111'">About Us<img src="i/redline-sep.bmp" alt=" " width="2" height="15" style="padding-left: 10px; padding-right: 10px"></a></li>
        <li><a href="contact.php" style="font-size: 15px; font-family: eurostile; font-weight: bold; text-decoration: none; color: #4a1111;" onmouseover="this.style.color='#C9252B'" onmouseout="this.style.color='#4a1111'">Contact Us</a></li>

  </ul>
 </div>
carbilldyer is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 06:58 AM.


Advertisement
Log in to turn off these ads.