Help withs <ul>'s

This is a discussion on "Help withs <ul>'s" within the Web Page Design section. This forum, and the thread "Help withs <ul>'s are both part of the Design Your Website category.


 Subscribe in a reader

Go Back   Webforumz.com > Main Forums > Design Your Website > Web Page Design

Notices




Reply
 
LinkBack Thread Tools
  #1  
Old Jun 30th, 2007, 22:13
Reputable Member
Join Date: Apr 2007
Location: Ireland
Age: 15
Posts: 332
Thanks: 0
Thanked 0 Times in 0 Posts
Help withs <ul>'s

This is kind of a stupid question, but could someone tell me how I can get a <ul> to sperate on to two different lines like in the image attached.

Thanks,
Pádraig.
Attached Images
File Type: png clueless.png (70.1 KB, 33 views)
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote

  #2  
Old Jun 30th, 2007, 22:15
Most Reputable Member
Join Date: May 2006
Location: North West, UK
Age: 22
Posts: 1,173
Thanks: 0
Thanked 0 Times in 0 Posts
Re: Help withs <ul>'s

You could give it a class or id and then apply clear:both; in the css should work as long as nothing is conflicting with it. There may be another way though I can't think of it at the minute. You would give the 'Contact me' li the class. I forgot to mention.

Pete.

Last edited by pa007; Jun 30th, 2007 at 22:16. Reason: i forgot something
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #3  
Old Jun 30th, 2007, 22:17
Most Reputable Member
Join Date: May 2006
Location: North West, UK
Age: 22
Posts: 1,173
Thanks: 0
Thanked 0 Times in 0 Posts
Re: Help withs <ul>'s

I just thought, you would be best giving it a class of "clear" or something similiar. That way if anything else on the site needed clearing you could just use that class again.

Pete.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #4  
Old Jun 30th, 2007, 22:25
Reputable Member
Join Date: Apr 2007
Location: Ireland
Age: 15
Posts: 332
Thanks: 0
Thanked 0 Times in 0 Posts
Re: Help withs <ul>'s

So some thing like...

HTML
Code: Select all
    <div id="nav">
        <ul>
            <div class="top">
            <li>Home</li>
            <li>Skins</li>
            <li>Bebo Page</li>
            <li>Other Links</li>
            </div>
            
            <div class="bottom">
            <li>Conact Me</li>
            <li>Other Skinners</li>
            </div>
        </ul>
    </div>
CSS:
Code: Select all
.top {
     clear: both;
}
Would that be right?
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #5  
Old Jun 30th, 2007, 22:53
Most Reputable Member
Join Date: May 2006
Location: North West, UK
Age: 22
Posts: 1,173
Thanks: 0
Thanked 0 Times in 0 Posts
Re: Help withs <ul>'s

Give me a minute, this should be easy but it's not.

Pete.

Last edited by pa007; Jun 30th, 2007 at 23:02.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #6  
Old Jun 30th, 2007, 22:54
Reputable Member
Join Date: Apr 2007
Location: Ireland
Age: 15
Posts: 332
Thanks: 0
Thanked 0 Times in 0 Posts
Re: Help withs <ul>'s

Thanks alot! Something wrong again?

Last edited by Pádraig; Jun 30th, 2007 at 23:15.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #7  
Old Jun 30th, 2007, 23:23
Most Reputable Member
Join Date: May 2006
Location: North West, UK
Age: 22
Posts: 1,173
Thanks: 0
Thanked 0 Times in 0 Posts
Re: Help withs <ul>'s

I think I've got it now.

Use the following code and it will give you the required effect. there may be a better way, I've never done this before so I'm not sure, but this works.

HTML:
Code: Select all
<ul>
<li><a href="#">Link 1</a></li>
<li><a href="#">Link 2</a></li>
<li><a href="#">Link 3</a></li>
<li><a href="#">Link 4</a></li>
<span><li><a href="#">Link 5</a></li>
<li><a href="#">Link 6</a></li></span>
CSS:
Code: Select all
ul {
    list-style: none;
}

ul li {
   display:inline;
}

span {
   display: block;
}
Try that. You can just style the anchors as normal after this. Add margin/padding to the span to position the bottom set of links properly.

Pete.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #8  
Old Jun 30th, 2007, 23:24
Reputable Member
Join Date: Apr 2007
Location: Ireland
Age: 15
Posts: 332
Thanks: 0
Thanked 0 Times in 0 Posts
Re: Help withs <ul>'s

Thanks alot, Pete!
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #9  
Old Jun 30th, 2007, 23:25
Most Reputable Member
Join Date: May 2006
Location: North West, UK
Age: 22
Posts: 1,173
Thanks: 0
Thanked 0 Times in 0 Posts
Re: Help withs <ul>'s

It had me stumped for a minute but it should be ok now. Just make sure you use display: inline; rather than float: left; to give the horizontal nav.

Let me know if it works or not.

Pete.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #10  
Old Jun 30th, 2007, 23:57
Reputable Member
Join Date: Apr 2007
Location: Ireland
Age: 15
Posts: 332
Thanks: 0
Thanked 0 Times in 0 Posts
Re: Help withs <ul>'s

Yep, its working!
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #11  
Old Jul 1st, 2007, 00:06
Most Reputable Member
Join Date: May 2006
Location: North West, UK
Age: 22
Posts: 1,173
Thanks: 0
Thanked 0 Times in 0 Posts
Re: Help withs <ul>'s

Excellent. If that hadn't have worked I would never have coded another site. I would have closed BBedit for the last time. The pressure was unbearable. Luckily it's all ok. Phew!

Pete.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #12  
Old Jul 1st, 2007, 00:13
Reputable Member
Join Date: Apr 2007
Location: Ireland
Age: 15
Posts: 332
Thanks: 0
Thanked 0 Times in 0 Posts
Re: Help withs <ul>'s

Hahahahaha...lol. The alternative was to use two <ul>'s, but I prefer your way!
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #13  
Old Jul 1st, 2007, 00:20
Most Reputable Member
Join Date: May 2006
Location: North West, UK
Age: 22
Posts: 1,173
Thanks: 0
Thanked 0 Times in 0 Posts
Re: Help withs <ul>'s

I was thinking that but it just wasn't right. It's one list so to put in two ul's is like saying it's 2 lists. Me being a stickler for semantics and all I just couldn't bring myself to say that was the best way. It was a lucky escape, for both of us. Who'd have thought a bit of innocent html and css could push us so close to the edge?

I think I need a lie down.

Pete.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #14  
Old Jul 1st, 2007, 00:26
Reputable Member
Join Date: Apr 2007
Location: Ireland
Age: 15
Posts: 332
Thanks: 0
Thanked 0 Times in 0 Posts
Re: Help withs <ul>'s

I think now would be a bad time to say that I have another 50 questions I would like answered.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #15  
Old Jul 1st, 2007, 00:38
Most Reputable Member
Join Date: May 2006
Location: North West, UK
Age: 22
Posts: 1,173
Thanks: 0
Thanked 0 Times in 0 Posts
Re: Help withs <ul>'s

Fire away, I like life on the edge.

Pete.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #16  
Old Jul 1st, 2007, 00:38
Elite Veteran
Join Date: Sep 2006
Location: Pink House
Posts: 3,946
Thanks: 0
Thanked 0 Times in 0 Posts
Re: Help withs <ul>'s

I would have taken the easy route and put in a <br/>
* hahahahahaha

*hands Pete an ice pack for head!
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #17  
Old Jul 1st, 2007, 00:45
Most Reputable Member
Join Date: May 2006
Location: North West, UK
Age: 22
Posts: 1,173
Thanks: 0
Thanked 0 Times in 0 Posts
Re: Help withs <ul>'s

It wasn't really too difficult to be honest but I couldn't for the life of me figure out how to do it. Then it clicked. It's like when you can't remember a word and it really gets on your nerves. Kind of.

Pete.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #18  
Old Jul 1st, 2007, 10:36
New Member
Join Date: Jul 2007
Location: Kent, UK
Age: 25
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Re: Help withs <ul>'s

Would a much simpler method not have been to just give the ul a suitable width? Anything going over that width would span onto a new line by itself.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #19  
Old Jul 1st, 2007, 12:12
Most Reputable Member
Join Date: May 2006
Location: North West, UK
Age: 22
Posts: 1,173
Thanks: 0
Thanked 0 Times in 0 Posts
Re: Help withs <ul>'s

Yeah, I never thought of that. But if the text was resized it could mess that up. I tried for a bulletproof method though I don't know how bulletproof it is.

Pete.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
Reply

Tags
lists, unordered

Thread Tools

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