Jump to content

Recommended Posts

Hey guys,

Here is a screenshot of what I have right now:
[img src=\"http://www.sfu.ca/~fcc/navigation.gif\" border=\"0\" alt=\"IPB Image\" /]

Notice how there is a line between the first and second line. That is fine. How do the second link text align itself all the way to the right side? Like this:

[img src=\"http://www.sfu.ca/~fcc/navigation2.gif\" border=\"0\" alt=\"IPB Image\" /]

My current code is:

<div id="navContainer_1">
<ul id="nav">
<li><a href="index.php">主頁</a></li>
<li><a href="register.php">申請及退出</a></li>
</ul>
</div>

<div id="navContainer_2">
<ul id="nav">
<li><a href="index.php">主頁</a></li>
<li><a href="register.php">申請及退出</a></li>
</ul>
</div>

NavContainer1 simply has the attribute float: left. What attribute do I put in navContainer 2 to make the links go all the way to right side?
Link to comment
https://forums.phpfreaks.com/topic/9529-navigation-bar-alignment-problem/
Share on other sites

float right and give both div containers the width of 49% so they both sit sibe by the side of each other nicely.

This is the css you'll want:
[code]#navContainer_1, #navContainer_2 {
    width: 49%;
    float: left;
}

#navContainer_2 {
    float: right;
    text-align: right;
}[/code]
This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.