Solved

question about coloring a the background

Posted on 2009-05-15
5
155 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 250 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 42

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

Free Tool: Postgres Monitoring System

A PHP and Perl based system to collect and display usage statistics from PostgreSQL databases.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Html value of radio 14 31
How can I make the first part identical to the second ? 1 26
CSS Style 8 22
Non-Resizable Pharagraph 2 8
Have you tried to learn about Unicode, UTF-8, and multibyte text encoding and all the articles are just too "academic" or too technical? This article aims to make the whole topic easy for just about anyone to understand.
Is your Office 365 signature not working the way you want it to? Are signature updates taking up too much of your time? Let's run through the most common problems that an IT administrator can encounter when dealing with Office 365 email signatures.
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 …
Video by: Mark
This lesson goes over how to construct ordered and unordered lists and how to create hyperlinks.

830 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