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 09-13-2012, 11:46 AM   PM User | #1
aaronoafc
New Coder

 
Join Date: Feb 2012
Posts: 76
Thanks: 8
Thanked 0 Times in 0 Posts
aaronoafc is an unknown quantity at this point
CSS Nav Bar is wrong

Hi,

Coding a mockup website, working on a simple horizontal css bar. Was following a tutorial as a rough guideline but it doesn't look anywhere near the same!

I have attached 2 images, one is how it is supposed to be and one is how it looks. Please see css code below:

Code:
/* Navigation Bar */
#nav {
	width:100%;
	float:left;
	margin:0 0 3em 0;
	padding:0;
	list-style:none;
	background-color:#f2f2f2;
	border-bottom:1px solid #ccc;
	border-top:1px solid #ccc;
}
#nav li {
	float:left;
}
#nav li a {
	display:block;
	padding:8px 15px;
	text-decoration:none;
	font-weight:bold;
	color:#069
	border-right: 1px solid #css;
}
#nav li a:hover {
	color:#c00;
	background-color:#fff
}
Thanks guys
Attached Thumbnails
Click image for larger version

Name:	Screen shot 2012-09-13 at 11.39.20.png
Views:	40
Size:	6.5 KB
ID:	11548   Click image for larger version

Name:	Screen shot 2012-09-13 at 11.45.17.png
Views:	21
Size:	7.0 KB
ID:	11549  
__________________
Don't Click Here!
aaronoafc is offline   Reply With Quote
Old 09-13-2012, 12:59 PM   PM User | #2
Cole001
New to the CF scene

 
Join Date: Jan 2012
Location: Ahmedabad, Gujarat, India
Posts: 8
Thanks: 0
Thanked 0 Times in 0 Posts
Cole001 can only hope to improve
i am not sure.. but you can do one thing....

do fixed position on the page & try

Quote:
.class {
position: fixed
/* Any positioning that you want to do using top: ; bottom: ; etc.*/
}
Cole001 is offline   Reply With Quote
Old 09-13-2012, 04:05 PM   PM User | #3
sunfighter
Senior Coder

 
Join Date: Jan 2011
Location: Missouri
Posts: 2,491
Thanks: 18
Thanked 361 Times in 360 Posts
sunfighter is on a distinguished road
@ Cole001, stay away from position: fixed/absolute/relative and use the natural flow of things unless absolutely necessary. And it isn't in a simple horizontal css menu.

@aaronoafc I really think you stopped midway through the example because some easy stuff is missing. Like
Code:
#nav li {
	float:left;
	list-style: none;
	padding: 5px;
	border-left: 1px solid #ccc;
}
for starters. Go back and redo the tutorial.
sunfighter is offline   Reply With Quote
Reply

Bookmarks

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 08:06 AM.


Advertisement
Log in to turn off these ads.