Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

question about coloring a the background

Posted on 2009-05-15
5
Medium Priority
?
160 Views
Last Modified: 2013-11-19

Hello group,

In following code I have assigned a color to an "option 3" background but when I get to the page more than the length of it is colored. Instead of "Option 3" it  is like  "Option 3        "

how can I trim it?!

Thanks,
ak

<ul class="menu_style">
            	<li><a href="1.html">Option 1 </a></li>
            	<li><a href="2.html">Options 2</a></li>
		<li style="background:#6699CC;"><a href="3.html">Option 3</a></li>
                <li><a href="4.html">Option 4</a></li>
            </ul>

Open in new window

0
Comment
Question by:akohan
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
5 Comments
 
LVL 2

Accepted Solution

by:
divstar earned 1000 total points
ID: 24400607
Simple change the scope of the style attribute to the link only :o)
<ul class="menu_style">
                <li><a href="1.html">Option 1 </a></li>
                <li><a href="2.html">Options 2</a></li>
                <li><a href="3.html" style="background:#6699CC;">Option 3</a></li>
                <li><a href="4.html">Option 4</a></li>
            </ul>

Open in new window

0
 
LVL 2

Expert Comment

by:Tosko
ID: 24400608
change
<li style="background:#6699CC;">
into (or change the width to w/e number you like)
<li style="background:#6699CC; width:60px;">

Hope that this solved your problem
0
 
LVL 43

Expert Comment

by:David S.
ID: 24400611
It sounds like you gave the <a> display:block. Give it float:left instead.
0
 

Author Closing Comment

by:akohan
ID: 31582141

Thanks
0
 

Author Comment

by:akohan
ID: 24400956


Thanks to all for your responses.
0

Featured Post

On Demand Webinar: Networking for the Cloud Era

Ready to improve network connectivity? Watch this webinar to learn how SD-WANs and a one-click instant connect tool can boost provisions, deployment, and management of your cloud connection.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Finding original email is quite difficult due to their duplicates. From this article, you will come to know why multiple duplicates of same emails appear and how to delete duplicate emails from Outlook securely and instantly while vital emails remai…
Q&A with Course Creator, Mark Lassoff, on the importance of HTML5 in the career of a modern-day developer.
In this tutorial viewers will learn how to embed Flash content in a webpage using HTML5. Ensure your DOCTYPE declaration is set to HTML5: "<!DOCTYPE html>": Use the <object> tag to embed Flash content.: To specify that the object is Flash content, d…
The viewer will learn the benefit of using external CSS files and the relationship between class and ID selectors. Create your external css file by saving it as style.css then set up your style tags: (CODE) Reference the nav tag and set your prop…

660 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question