The forums have permanently moved to forum.kirupa.com. This forum will be kept around in read-only mode for archival purposes. To learn how to continue using your existing account on the new forums, check out this thread.


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