Go Back   CodingForums.com > :: Client side development > HTML & CSS

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 10-05-2012, 05:12 PM   PM User | #1
VaMoose
New to the CF scene

 
Join Date: Oct 2012
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
VaMoose is an unknown quantity at this point
CSS Navbar error?

I have my navbar, but the links are showing up in reverse order, ie: not Home, About Us, Gallery, Contact Us. it is Contact Us, Gallery, About Us, Home.

my css code:
.navbar ul li{
display:inline-block;
margin-left:10px;
margin-right:10px;
background-image:url(button.png);
background-repeat:no-repeat;
height:40px;
width:100px;
text-align:center;
padding-top:10px;
float:right;
text-decoration:none;
list-style:none;
}


my html code:
<div class="navbar">
<ul>
<a href="#"><li>Home</li></a>
<a href="#"><li>About Us</li></a>
<a href="#"><li>Gallery</li></a>
<a href="#"><li>Contact Us</li></a>
</ul>
</div>

Any one know what the hell is going on?
VaMoose is offline   Reply With Quote
Old 10-05-2012, 05:24 PM   PM User | #2
JT Web Design
New Coder

 
Join Date: Jun 2012
Location: Burnley, Lancashire UK
Posts: 11
Thanks: 0
Thanked 3 Times in 3 Posts
JT Web Design is an unknown quantity at this point
Hi VaMoose,

You need to float the links to the left not the menu itself but the links inside the menu, try this -

.navbar li a{
float:left;
}
JT Web Design is offline   Reply With Quote
Old 10-06-2012, 07:27 AM   PM User | #3
fireplace_tea
New Coder

 
Join Date: Sep 2012
Location: Boulder, CO
Posts: 56
Thanks: 5
Thanked 0 Times in 0 Posts
fireplace_tea is an unknown quantity at this point
Instead of floating right, float them left. Here is the coding:

Code:
.navbar ul li{
display:inline-block;
margin-left:10px;
margin-right:10px;
background-image:url(button.png);
background-repeat:no-repeat;
height:40px;
width:100px;
text-align:center;
padding-top:10px;
float:left;
text-decoration:none;
list-style:none;
}
Notice, I changed float:right to float: left and that fixed it.
fireplace_tea is offline   Reply With Quote
Reply

Bookmarks

Tags
buttons, css, html, text, web design

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 09:46 PM.


Advertisement
Log in to turn off these ads.