Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

question about coloring a the background

Posted on 2009-05-15
5
Medium Priority
?
161 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
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

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Preface This is the third article about the EE Collaborative Login Project. A Better Website Login System (http://www.experts-exchange.com/A_2902.html) introduces the Login System and shows how to implement a login page. The EE Collaborative Logi…
Not sure what the best email signature size is? Are you worried about email signature image size? Follow this best practice guide.
In this tutorial viewers will learn how to embed videos in a webpage using HTML5. Ensure your DOCTYPE declaration is set to HTML5: "<!DOCTYPE html>": Use the <video> tag to insert a video. Define the src as the URL of your video; this is similar to …
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)
Suggested Courses

972 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