Solved

question about coloring a the background

Posted on 2009-05-15
5
153 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

CSS is a visual language used to classify objects and define rules about how they should be displayed. CSS skills aren’t restricted to developers anymore, there is a big benefit to having a basic understanding of the language, regardless of your occ…
Why do we like using grid based layouts in website design? Let's look at the live examples of websites and compare them to grid based WordPress themes.
The viewer will learn how to create a basic form using some HTML5 and PHP for later processing. Set up your basic HTML file. Open your form tag and set the method and action attributes.: (CODE) Set up your first few inputs one for the name and …
Video by: Mark
This lesson goes over how to construct ordered and unordered lists and how to create hyperlinks.

911 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

Need Help in Real-Time?

Connect with top rated Experts

17 Experts available now in Live!

Get 1:1 Help Now