Jump to content

Help with my Navigation Bar


smonkcaptain

Recommended Posts

Hey all,

 

I have a few querys with my Navigation bar i've made. Before i ask, here is the link to the navigation bar:

 

http://www.aviation-photographs.net/

 

The HTML code for the Nav Bar:

 

<ul>
<li style="border-right: 1px solid #333;"><a href="index.php">Home</a>
</li>
<li style="border-right: 1px solid #333;"><a href="#nogo">Photos  <font color="#FC3">↓</font></a>
<ul style="border: 1px solid black;">
<li style="width: 120px;"><a href="#nogo"><font color="#FC3">¤</font> Photo Search <font color="#FC3">¤</font></a></li>
<li style="width: 120px;"><a href="#nogo">Upload Your Photos!</a></li>
<li style="width: 120px;"><a href="#nogo">Top Shots <font color="#FC3">»</font></a></li>
</ul>
</li>
<li style="border-right: 1px solid #333;"><a href="#nogo">Members  <font color="#FC3">↓</font></a>
<ul style="border: 1px solid black;">
<li style="width: 120px;"><a href="#nogo"><font color="#FC3">¤</font> Userarea <font color="#FC3">¤</font></a></li>
<li style="width: 120px;"><a href="#nogo">User Profile</a></li>
<li style="width: 120px;"><a href="#nogo">Your Photos</a></li>
<li style="width: 120px;"><a href="#nogo">Queued Photos</a></li>
<li style="width: 120px;"><a href="#nogo">Update Profile</a></li>
<li style="width: 120px;"><a href="#nogo">Forgotten Password</a></li>
</ul>
</li>
<li style="border-right: 1px solid #333;"><a href="#nogo">A-P.net Prime</a>
<ul style="border: 1px solid black;">
<li style="width: 100px;"><a href="#nogo">What's it about?</a></li>
<li style="width: 100px;"><a href="#nogo"><font color="#FC3">¤</font> Join Now! <font color="#FC3">¤</font></a></li>
</ul>
</li>
<li style="border-right: 1px solid #333;"><a href="#nogo">Forums  <font color="#FC3">↓</font></a>
<ul style="border: 1px solid black;">
<li style="width: 100px;"><a href="#nogo">Aviation <font color="#FC3">»</font></a></li>
<li style="width: 100px;"><a href="#nogo">Photography <font color="#FC3">»</font></a></li>
</ul>
</li>
<li style="border-right: 1px solid #333;"><a href="#nogo">About Us  <font color="#FC3">↓</font></a>
<ul style="border: 1px solid black;">
<li style="width: 110px;"><a href="#nogo"><font color="#FC3">¤</font> Photo Use <font color="#FC3">¤</font></a></li>
<li style="width: 110px;"><a href="#nogo">How We Formed</a></li>
<li style="width: 110px;"><a href="#nogo">Terms & Conditions</a></li>
</ul>
</li>
<li style="border-right: 1px solid #333;"><a href="#nogo">Contact  <font color="#FC3">↓</font></a>
<ul style="border: 1px solid black;">
<li style="width: 100px;"><a href="#nogo">Our Team</a></li>
<li style="width: 100px;"><a href="#nogo">Photographer</a></li>
<li style="width: 100px;"><a href="#nogo"><font color="#FC3">¤</font> Contact Form <font color="#FC3">¤</font></a></li>
</ul>

 

The CSS:

 

#menu{
padding:0;
margin-left:0
}
#menu ul{
padding:0;
margin:0;

}
#menu li{
font-weight: bold;
position: relative;
float: left;
width:85px;
list-style: none;
margin: 0;
} 

#menu li a{
font-size: 10px;
height: 25px;
display:block;
text-decoration:none;
text-align: center;
line-height: 24px;
background-color: #505050;
color:#ababab;
} 

#menu li a:hover{
color: #FC3;
} 

#menu ul ul{
position: absolute;
top: 25px; 
visibility: hidden;
} 

#menu ul li:hover ul{
visibility:visible;
margin-left: -1px;
} 

 

I'd like some advice on how to text align the <li> text in the drop down box, while keeping the main 'Header' text centered like it is now.

 

I'd also like to know how to make a secondary drop down, from the <li> tag 'Top shots' and others....

 

Thankyou all for your help..

Jimmy Leaman

 

Link to comment
Share on other sites

If I read correctly what you were trying to do, just add a class to the LI portions you want to text-align and don't put the class on the portions you don't want to text align.

 

Add:

 

class="alignedText"

 

to each of the elements to be aligned and then add:

 

li.alignedText {text-align: center;}

 

(or whatever alignment you want) section to your CSS.

 

Is this what you meant?

Link to comment
Share on other sites

Gotcha, yeah, the class attribute should work for what you need, it's a way to demarcate items that otherwise would be captured in the same style.  Another way you could do it, though frowned upon, is to add the alignment to the inline style of each element, but that's far more typing than you need and best practice is to separate content and layout to the maximum extent possible.

Link to comment
Share on other sites

Thanks for your reply, however it's still not working.

 

I've added your CSS and then the class the the <li> tags that i want aligned however to no avail...

 

<li style="border-right: 1px solid #333;"><a href="#nogo">Photos  <font color="#FC3">↓</font></a>
<ul style="border: 1px solid black;">
<li style="width: 120px;" class="alignedText"><a href="#nogo"><font style="color: #FC3;">¤</font> Photo Search <font color="#FC3">¤</font></a></li>
<li style="width: 120px;" class="alignedText"><a href="#nogo">Upload Your Photos!</a></li>
<li style="width: 120px;" class="alignedText"><a href="#nogo">Top Shots <font color="#FC3">»</font></a></li>
</ul>
</li>

 

www.aviation-photographs.net

Link to comment
Share on other sites

#menu{
padding:0;
margin-left:0
}
#menu ul{
padding:0;
margin:0;

}
#menu li{
font-weight: bold;
position: relative;
float: left;
width:85px;
list-style: none;
margin: 0;
} 

#menu li a{
font-size: 10px;
height: 25px;
display:block;
text-decoration:none;
text-align: center;
line-height: 24px;
background-color: #505050;
color:#ababab;
} 

#menu li a:hover{
color: #FC3;
} 

#menu ul ul{
position: absolute;
top: 25px; 
visibility: hidden;
} 

#menu ul li:hover ul{
visibility:visible;
margin-left: -1px;
} 

li.alignedText {text-align: left;}

Link to comment
Share on other sites

Well, as I'm still not a complete expert, I may just not be seeing the problem, but now that I read the code a bit more I think the problem is that you've made all the <a> elements blocks with display:block which makes them 100% width and therefore trying to text-align them won't do anything.  Here's what I would do: move the class attributes I gave you earlier from the <li> elements to the <a> elements that you'd like to align and then change the css to a.alignedText instead of li.alignedText.  See if that works.

 

Outside of that, we might need to wait for someone else to help out :S

Link to comment
Share on other sites

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.