9 Replies - 919 Views - Last Post: 09 September 2010 - 01:28 PM

#1 RandomlyKnighted  Icon User is offline

  • Microsoft Senior Student Partner
  • member icon

Reputation: 113
  • View blog
  • Posts: 1,322
  • Joined: 14-January 10

Am I forgetting something? Relative positioning

Posted 07 September 2010 - 12:27 PM

Hey everyone, I'm trying to create a horizontal navigation menu for the top of my website. Right now, I have this in my HTML file:

<ul class="navbar">
  <li><a href="home.html">Home <a/>
  <li><a href="portfolio.html">Portfolio <a/>
</ul>

navbar li
{
	float: left;
}



I've read several tutorials online and I am also using a book to help me as I go along as well. I've noticed in all the tutorials that you have to use an unordered list in order to make a navigation menu. After you have the list you then float the items left. As you can see above I have done both of these. Am I just missing something?

Thanks in advance for any help given.

Is This A Good Question/Topic? 0
  • +

Replies To: Am I forgetting something? Relative positioning

#2 Dormilich  Icon User is offline

  • 痛覚残留
  • member icon

Reputation: 2936
  • View blog
  • Posts: 7,690
  • Joined: 08-June 10

Re: Am I forgetting something? Relative positioning

Posted 07 September 2010 - 01:42 PM

View PostRandomlyKnighted, on 07 September 2010 - 07:27 PM, said:

I've noticed in all the tutorials that you have to use an unordered list in order to make a navigation menu.

it’s just that unordered lists makes the most sense …


View PostRandomlyKnighted, on 07 September 2010 - 07:27 PM, said:

Am I just missing something?

so it doesn’t work for you?
Was This Post Helpful? 0
  • +
  • -

#3 RandomlyKnighted  Icon User is offline

  • Microsoft Senior Student Partner
  • member icon

Reputation: 113
  • View blog
  • Posts: 1,322
  • Joined: 14-January 10

Re: Am I forgetting something? Relative positioning

Posted 07 September 2010 - 02:20 PM

No, it does not work. It shows me a list of links but they are vertical and not horizontal. Here is the site that I am working on if you would like to see what I mean.

http://www.onehughes.com

Note: Sorry, I tried to use the link button that is given above but it stretched across my entire screen and there was no button for me to insert the link into my post.
Was This Post Helpful? 0
  • +
  • -

#4 moopet  Icon User is offline

  • binary decision maker
  • member icon

Reputation: 334
  • View blog
  • Posts: 1,178
  • Joined: 02-April 09

Re: Am I forgetting something? Relative positioning

Posted 07 September 2010 - 02:45 PM

Well you appear to be forgetting to put the style into the stylesheet rather than in the HTML.
Also, navbar li should be .navbar li
Was This Post Helpful? 0
  • +
  • -

#5 singularity  Icon User is offline

  • D.I.C Head
  • member icon

Reputation: 17
  • View blog
  • Posts: 184
  • Joined: 17-October 08

Re: Am I forgetting something? Relative positioning

Posted 08 September 2010 - 11:52 PM

You have also forget to close the li tags.
Was This Post Helpful? 0
  • +
  • -

#6 Dormilich  Icon User is offline

  • 痛覚残留
  • member icon

Reputation: 2936
  • View blog
  • Posts: 7,690
  • Joined: 08-June 10

Re: Am I forgetting something? Relative positioning

Posted 08 September 2010 - 11:53 PM

in HTML the closing tag </li> is optional. nothing wrong there (though bad style)
Was This Post Helpful? 0
  • +
  • -

#7 singularity  Icon User is offline

  • D.I.C Head
  • member icon

Reputation: 17
  • View blog
  • Posts: 184
  • Joined: 17-October 08

Re: Am I forgetting something? Relative positioning

Posted 09 September 2010 - 12:00 AM

View PostDormilich, on 09 September 2010 - 05:53 AM, said:

in HTML the closing tag </li> is optional. nothing wrong there (though bad style)


Would it be valid if the doctype is strict.
Was This Post Helpful? 0
  • +
  • -

#8 Dormilich  Icon User is offline

  • 痛覚残留
  • member icon

Reputation: 2936
  • View blog
  • Posts: 7,690
  • Joined: 08-June 10

Re: Am I forgetting something? Relative positioning

Posted 09 September 2010 - 12:04 AM

in every HTML doctype, the closing </li> tag is optional
Was This Post Helpful? 1
  • +
  • -

#9 RandomlyKnighted  Icon User is offline

  • Microsoft Senior Student Partner
  • member icon

Reputation: 113
  • View blog
  • Posts: 1,322
  • Joined: 14-January 10

Re: Am I forgetting something? Relative positioning

Posted 09 September 2010 - 11:30 AM

Any advice on how to separate the two links so that they don't look like they are all one word. Thanks!
Was This Post Helpful? 0
  • +
  • -

#10 Dormilich  Icon User is offline

  • 痛覚残留
  • member icon

Reputation: 2936
  • View blog
  • Posts: 7,690
  • Joined: 08-June 10

Re: Am I forgetting something? Relative positioning

Posted 09 September 2010 - 01:28 PM

apply padding/margin.

This post has been edited by Dormilich: 09 September 2010 - 01:28 PM

Was This Post Helpful? 0
  • +
  • -

Page 1 of 1