Solved

question about coloring a the background

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

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
html input clean up 3 32
Flexbox in CSS3 2 26
SVG Star 4 16
Bootstrap css to change alignment without using padding 3 27
This article demonstrates how to create a simple responsive confirmation dialog with Ok and Cancel buttons using HTML, CSS, jQuery and Promises
This article explains how to prepare an HTML email signature template file containing dynamic placeholders for users' Azure AD data. Furthermore, it explains how to use this file to remotely set up a department-wide email signature policy in Office …
The viewer will learn how to look for a specific file type in a local or remote server directory using PHP.
The viewer will learn how to create and use a small PHP class to apply a watermark to an image. This video shows the viewer the setup for the PHP watermark as well as important coding language. Continue to Part 2 to learn the core code used in creat…

705 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

15 Experts available now in Live!

Get 1:1 Help Now