Forums

The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums CSS styling an unordered list

  • This topic is empty.
Viewing 7 posts - 1 through 7 (of 7 total)
  • Author
    Posts
  • #29798
    revok
    Participant

    Hello

    I am making a wordpress site where i need an unordered list in one of my posts. It needs to look like this:

    http://www.simontornby.dk/textpost.png

    Since i can’t space it out via spacing in the post, my first idea was to style my .post strong class, but the problem is that this affects all my post headers as well.

    Is there a way to do it via the .post ul or .post ul li class, or is there some other way around this?

    Thanks
    Simon

    #80754

    Yes. Just style the li elements inside the ul.

    If you had an html example we could help you better, and provide you with some CSS.

    #80802
    revok
    Participant

    Hello again

    Thank you for your reply.

    I can’t really make it work as I want. Since I am working locally, I wont be able to provide live html. And since I want my client to add the info via WordPress I guess it is a question about styling the ul in css?
    But I just can’t seem to get my head around how to do it.

    Here is how it looks now:
    http://www.simontornby.dk/list1.png

    And I would really love to make it look like this:
    http://www.simontornby.dk/list2.png

    Here is my css:

    Code:
    .post ul { float: left; margin-left: 120px; padding-top: 10px; padding-bottom: 10px;}

    .post ul li strong { padding-right: 100px; }

    .post ul li { margin-left: 0px; padding-top: 7px; padding-bottom: 7px; }

    Hope you can help. Apparently it seems simple, but I can’t make it work…
    Thanks.

    Simon

    #80805
    revok
    Participant

    Ok

    It seems that I managed to solve it myself:

    Code:
    .post ul { width: 800px; float: left; margin-left: 250px; padding-top: 10px; padding-bottom: 10px;}

    .post ul li strong { position: absolute; display: block; width: 200px; margin-left: -200px; }

    .post ul li { margin-left: 0px; padding-top: 6px; padding-bottom: 6px;

    /Simon

    #80822
    clifference
    Member

    That looks more like a table than a list :)

    #80832
    TheDoc
    Member
    "clifference" wrote:
    That looks more like a table than a list :)

    Was going to say the exact same thing, actually.

    #80842
    revok
    Participant

    yes i know, but it does the trick ;)

Viewing 7 posts - 1 through 7 (of 7 total)
  • The forum ‘CSS’ is closed to new topics and replies.