Everybody! This is important. In a few days, these forums will be moving over to using the totally sweet Discourse platform. To ensure this migration happens smoothly with no loss of content, these forums are currently in a read-only mode. I do apologize for the inconvenience.

There is never a good time to turn the forums off for an extended period of time, but I promise the new forums will be a billion times better. I'm pretty sure of it.

See you all on the other side in a few days, and if you have any (non-technical) questions, please e-mail me at kirupa@kirupa.com. For technical questions, try to find a tutorial that corresponds to what you are looking for and post in the comments section of that page.

Cheers,
Kirupa

Results 1 to 6 of 6

Thread: linebreak and lists?

  1. #1

    linebreak and lists?

    Hi there,

    im having trouble with some lists im working with... this is my htmlcode:
    Code:
    <p>this is a list:
    <ul>
     <li>asd</li>
     <li>asdasd</li>
     <li>asd<br></li>
    </ul>
    </p>
    my problem is the empty line after 'this is a list'... i was wondering how to get rid of it, or how to work around the problem...

    thanks!

  2. #2
    You can set "this is a list" as a list item as well.

    Code:
    <ul>
     <li id="title">this is a list</li>
     <li>asd</li>
     <li>asdasd</li>
     <li>asd<br></li>
    </ul>

    and in CSS put
    Code:
    #title {
    margin-left: -5px;
    }
    This would cause the first item in the list which is "this is a list" to be offset to the left by 5px. This is more than likely not the best way of doing and far from the only way.

  3. #3
    I would do what bpk did or you can use the <br /> tag with a span around the text if you need it out of the ul also you can put a style on that p tag. There is a few ways to do this.

    shane-c....Your site is a lot like a transvestite in that respect.
    fester8542.I'd hit it like the fist of an angry God .
    JoshuaJonah.I design for DDD. Then clients usually like it, and the ladies find me more attractive.
    Cybercode Albert Einstein Said that my math teacher has that on his wall

    K-Emmys-06: Best "Best Mod" K-Emmys-06: Best "Most Creative Critic"

    Member #1 of the "I wont critique Timmytot's designs anymore" club

  4. #4
    well, bpk's way is a hack not because of presentation, but because of info hierarchy. a list's title isn't an element in the list. here's what i would do:
    HTML Code:
    <h1>this is a list:</h1>
    <ul>
     	<li>asd</li>
     	<li>asdasd</li>
     	<li>asd</li>
    </ul>
    Code:
    h1 {
    	margin-bottom: 0;
    }
    ul {
    	margin-top: 0;
    }
    Last edited by bwh2; February 24th, 2006 at 02:05 PM.

  5. #5
    well, bpk's way is a hack not because of presentation, but because of info hierarchy. a list's title isn't an element in the list. i would put the p's bottom margin to zero and the ul's top margin to 0 (or whatever you want).
    True. I should have mentioned that. Your suggestion is more sensible as well.

  6. #6
    thanks a lot guys, i used bwh2's approach... thanks a lot!

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  

Home About kirupa.com Meet the Moderators Advertise

 Link to Us

 Credits

Copyright 1999 - 2012