开发者

Trouble aligning a div

开发者 https://www.devze.com 2023-03-06 01:56 出处:网络
I\'ll admit from the outset that I\'m a self-semi-traine开发者_StackOverflow社区d hack when it comes to html and css.

I'll admit from the outset that I'm a self-semi-traine开发者_StackOverflow社区d hack when it comes to html and css.

The problem I need help with is a drop down menu that is not centering in the container div. I need to have the menu behave like the one in the live site http://wedevents.com.au/index.htm

PROBLEM PAGE EXAMPLE: http://www.wedevents.com.au/index.asp (it's a work in progress so please forgive the mess)

Thaks for any help! Regards, Rick


I'm assuming you mean you want the links across the top to be centered on the page?

Floating the ul left won't help that :p. On ul.topnav, remove float:left and change the following properties:

margin: 0 auto;
padding: 0 85px;
width: 630px;
height: 36px;


I would adjust the width on your .topnav and adjust the padding as well.

Then on your ul.topnav li ul.subnav add this left:-31px; this shall make your drop down center below the weddings option


Create another div that will contain your ul class=topnav, set the width that fit in the page wrapper and add this as the property of ul:

margin: 0 auto;

0

精彩评论

暂无评论...
验证码 换一张
取 消