Forum Home Forum Home > Expression Web > General Expression web problems
  New Posts New Posts RSS Feed - Centering Navigation Bar
  FAQ FAQ  Forum Search   Register Register  Login Login


Welcome to expression web help - thank you for joining us.

Centering Navigation Bar

 Post Reply Post Reply
Author
Message
lyndale View Drop Down
Learning Fast
Learning Fast


Joined: 17 May 2007
Location: United States
Status: Offline
Points: 63
Post Options Post Options   Thanks (0) Thanks(0)   Quote lyndale Quote  Post ReplyReply Direct Link To This Post Topic: Centering Navigation Bar
    Posted: 06 Mar 2017 at 11:05pm
Modifying a supplied template (Small Business 2) with EW4 and am trying to get the navigation section centered so it'll appear centered with any screen resolution.  I tried various things:

<div id="navigation" class="style_center"> in the master .dwt but it doesn't have any effect.

In the .css file, navigation is

#navigation li {
float: left;
}

Does that affect the positioning of the nav menu on the screen?

I know there's not much info here and site isn't live but I could post it to a temp folder to view.

Dale - Admin ChevelleStuff.net
Back to Top
Sponsored Links


Back to Top
tcertain View Drop Down
Admin Group
Admin Group
Avatar

Joined: 04 Apr 2008
Location: United States
Status: Offline
Points: 3926
Post Options Post Options   Thanks (0) Thanks(0)   Quote tcertain Quote  Post ReplyReply Direct Link To This Post Posted: 07 Mar 2017 at 8:38am
 Hi
You don't say whether the nav is horizontal of vertical.
To center anything including an entire site
Put a div around it and create a style called center
In your CSS
.center {width:75%; margin-left:auto; margin-right:auto;}

In your HTML
<div class="center"> put your text in here </div>

This gives you a div that is 75% of the width of whatever your div is in and everything inside it will be centered. Adjust the width and the text will move

If you change the float left to text-align:left  then your text itself will be on the left side of the div
#navigation li {
float: left;
}




TCertain
"The Truly Educated Never Graduate" - Author Unknown
Back to Top
lyndale View Drop Down
Learning Fast
Learning Fast


Joined: 17 May 2007
Location: United States
Status: Offline
Points: 63
Post Options Post Options   Thanks (0) Thanks(0)   Quote lyndale Quote  Post ReplyReply Direct Link To This Post Posted: 01 Apr 2017 at 8:41pm
That did it!  Should have mentioned it's a horizontal nav bar, my bad.  I did adjust the percentage to 73% to fit the particular application at hand.

Appreciate your help.

Dale - Admin ChevelleStuff.net
Back to Top
 Post Reply Post Reply
  Share Topic   

Forum Jump Forum Permissions View Drop Down



This page was generated in 0.031 seconds.