Solved

expand bar on both sides of css menu

Posted on 2011-03-18
6
340 Views
Last Modified: 2012-08-13
I  finally got the horizonal css menu nav bar to center, but now I can't get the bar to expand to 100% of width because I had to declard a width size in order to center it.  Is there any way around this problem.

 http://insurance.illinois.gov/dropdown/menu.html
0
Comment
Question by:smitty62
  • 4
6 Comments
 
LVL 20

Expert Comment

by:Mark Brady
ID: 35168932
After your <body> tag, add this

<center>

Now change the width of the horizontal navbar to 100% instead of 825px so it fills the whole width or change the width size to 1264px. The problem of centering is because you are missing the <center> tag to center all page content. For each item you don't want centered, you add "text-align:left" to those div elements. Anyway try that and see how it looks.
0
 
LVL 20

Expert Comment

by:Mark Brady
ID: 35168964
Actually you would be better off putting the top nav bar inside the DOIBanner container as that container has a width property of 1265px and the nav bar looks to be inside it.
0
 

Author Comment

by:smitty62
ID: 35168985

The bar becomes uncentered and does not expand.

http://insurance.illinois.gov/dropdown/menu.html
0
Independent Software Vendors: 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!

 
LVL 3

Expert Comment

by:Prafulla Maharjan
ID: 35170032
The Horizontal size is maximum 1000px if it increase more than that it will come a scroll bar. please fix the size and place it.
0
 
LVL 20

Expert Comment

by:Mark Brady
ID: 35170386
smitty62: Can you post your webpage and the css if it is external. It would help if I could edit it myself and get it centered. I can't see your code so don't know what to tell you but this will be something very VERY simple to fix. Just need to see all of your code for that page.
0
 
LVL 20

Accepted Solution

by:
Mark Brady earned 500 total points
ID: 35173661
it looks to me like you need to add

text-align:center;

to your top navbar code.

#topNavBar{
background:#00F;
font-weight:bold;
margin: 0 auto;
width:100%;
text-align:center;
}

that will center anything you put inside the topNavBar div so it should center all your menu items. If not then the ul and li styles are over-riding it and you need to play around with text-align:center; in those elements as well.
0

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering 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
Help in good tutorials for PHP, HTML and CSS 6 53
How do I select this logo using CSS? 6 42
How to put a "check" next to active checkboxes. 5 27
CSS Style Effect 2 18
So you have coded your own WordPress plugin and now you want to allow users to upload images to a folder in the plugin folder rather than the default media location? Follow along and this article will show you how to do just that!
This article describes how to create custom column layout styles for Bootstrap. The article uses 5 columns to illustrate the concept, but the principle can be extended to any number of columns.
In this tutorial viewers will learn how to style transparent/translucent elements using alpha transparency in CSS Start with a normal styled element, such as a div.: Define its "background-color" property as "rgba (255, 255, 255, .5): The numbers in…
In this tutorial viewers will learn how to style a decorative dropcap for the first letter in a paragraph using CSS. In CSS, create a new paragraph class by typing "p.fancy": Then, to style only the first letter of the first sentence, include the ps…

756 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