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.



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

Notices


Reply
 
LinkBack Thread Tools
  #1 (permalink)  
Old Jun 30th, 2007, 22:13
SuperMember

SuperMember
Join Date: Apr 2007
Location: Ireland
Age: 15
Posts: 332
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via AIM to Pádraig
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)
Reply With Quote

  #2 (permalink)  
Old Jun 30th, 2007, 22:15
SuperMember

SuperMember
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
Reply With Quote
  #3 (permalink)  
Old Jun 30th, 2007, 22:17
SuperMember

SuperMember
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.
Reply With Quote
  #4 (permalink)  
Old Jun 30th, 2007, 22:25
SuperMember

SuperMember
Join Date: Apr 2007
Location: Ireland
Age: 15
Posts: 332
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via AIM to Pádraig
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?
Reply With Quote
  #5 (permalink)  
Old Jun 30th, 2007, 22:53
SuperMember

SuperMember
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.
Reply With Quote
  #6 (permalink)  
Old Jun 30th, 2007, 22:54
SuperMember

SuperMember
Join Date: Apr 2007
Location: Ireland
Age: 15
Posts: 332
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via AIM to Pádraig
Re: Help withs <ul>'s

Thanks alot! Something wrong again?

Last edited by Pádraig; Jun 30th, 2007 at 23:15.
Reply With Quote
  #7 (permalink)  
Old Jun 30th, 2007, 23:23
SuperMember

SuperMember
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.
Reply With Quote
  #8 (permalink)  
Old Jun 30th, 2007, 23:24
SuperMember

SuperMember
Join Date: Apr 2007
Location: Ireland
Age: 15
Posts: 332
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via AIM to Pádraig
Re: Help withs <ul>'s

Thanks alot, Pete!
Reply With Quote
  #9 (permalink)  
Old Jun 30th, 2007, 23:25
SuperMember

SuperMember
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.
Reply With Quote
  #10 (permalink)  
Old Jun 30th, 2007, 23:57
SuperMember

SuperMember
Join Date: Apr 2007
Location: Ireland
Age: 15
Posts: 332
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via AIM to Pádraig
Re: Help withs <ul>'s

Yep, its working!
Reply With Quote
  #11 (permalink)  
Old Jul 1st, 2007, 00:06
SuperMember

SuperMember
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.
Reply With Quote
  #12 (permalink)  
Old Jul 1st, 2007, 00:13
SuperMember

SuperMember
Join Date: Apr 2007
Location: Ireland
Age: 15
Posts: 332
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via AIM to Pádraig
Re: Help withs <ul>'s

Hahahahaha...lol. The alternative was to use two <ul>'s, but I prefer your way!
Reply With Quote
  #13 (permalink)  
Old Jul 1st, 2007, 00:20
SuperMember

SuperMember
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.
Reply With Quote
  #14 (permalink)  
Old Jul 1st, 2007, 00:26
SuperMember

SuperMember
Join Date: Apr 2007
Location: Ireland
Age: 15
Posts: 332
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via AIM to Pádraig
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.
Reply With Quote
  #15 (permalink)  
Old Jul 1st, 2007, 00:38
SuperMember

SuperMember
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.
Reply With Quote
  #16 (permalink)  
Old Jul 1st, 2007, 00:38
SuperMember

SuperMember
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!
Reply With Quote
  #17 (permalink)  
Old Jul 1st, 2007, 00:45
SuperMember

SuperMember
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.
Reply With Quote
  #18 (permalink)  
Old Jul 1st, 2007, 10:36
New Member
Join Date: Jul 2007
Location: Kent, UK
Age: 24
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.
Reply With Quote
  #19 (permalink)  
Old Jul 1st, 2007, 12:12
SuperMember

SuperMember
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.
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
Trackbacks are On
Pingbacks are On
Refbacks are On


All times are GMT. The time now is 16:21.


Powered by vBulletin®
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0 RC8
© 2003-2008 Webforumz.com : All Rights Reserved

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43