aspose file tools*
The moose likes HTML, CSS and JavaScript and the fly likes ul list background color and align issue Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Java 8 in Action this week in the Java 8 forum!
JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Bookmark "ul list background color and align issue" Watch "ul list background color and align issue" New topic
Author

ul list background color and align issue

david arnold
Ranch Hand

Joined: Apr 10, 2009
Posts: 129
Hi,

I have a jsp page which has a top menu bar as below



The problem is that the horizontal top menu bar does not show background color. I tried to put background color in "menu ul" and "menu li", well, background color shows where there are words like Home, Logout. What I want is the whole top menu (width is 100%) has the color, not only the link part.

And I found when I added "float:right" to the menu as below:

The background color showed, I don't know why, but the words "Home, logout..." are left align, not right align which I want, I tried "text-align" which does not work as well.

Thanks for help!
Ogeh Ikem
Ranch Hand

Joined: May 13, 2002
Posts: 180
Try assigning the background colour to the <tr> or <td> element instead of the div.
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 60082
    
  65

Are you using tables for layout?


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
david arnold
Ranch Hand

Joined: Apr 10, 2009
Posts: 129
table is not recommended for layout, right?

Yeah, I tried to assign background color to td, it worked the same way as above, i removed table, still the same result. So I do not know how to solve it.

Thanks.
david arnold
Ranch Hand

Joined: Apr 10, 2009
Posts: 129
Any solutions or better ways to handle it?

Thanks.
Eric Pascarello
author
Rancher

Joined: Nov 08, 2001
Posts: 15376
    
    6
http://css.maxdesign.com.au/listamatic/

david arnold
Ranch Hand

Joined: Apr 10, 2009
Posts: 129
Got it, thank you Eric.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: ul list background color and align issue
 
Similar Threads
Not working with MSIE7
Need help editing some css if possible (SOLVED)
DisplayTag works but without colors!?
Absolute Position in IE
Safari and IE issues.