Grow your CSS skills. Land your dream job.

div grows/expands with text to left instead of right?

  • # December 28, 2011 at 12:09 pm

    Am I over looking something simple here? I have a div that is floated to the right with an unordered list inside. the first list item (on the left) is a variable that can have up to 25 characters, and I want that div to grow with the variable to the left. I tried listing the items in order and floating them left, then listing them in reverse order and floating them to the right, but no matter what the div grows/expands to the right? Anyway getting around this?

    # December 28, 2011 at 12:20 pm

    I don’t think I particularly understand! Can you set up a fiddle of what you’re experiencing? Too many left/rights for me to follow!

    # December 28, 2011 at 1:54 pm

    I’m skinning a forum, and a nav list expands with the variable length (the username) to the right. I want to align the list to the right and have it expand to the left. See red box below:
    Image

    # December 28, 2011 at 1:56 pm

    haha It must be my first day back from holidays…

    I’m not quite following you, but I’m almost there! So, the picture that you’ve posted is bad? Can you post a picture of what you want it to look like?

    # December 28, 2011 at 2:04 pm

    Yeah I haven’t slept much lately and I’m know I’m not explaining it the best lol.

    See if this makes more sense, the longer the username, the div expands to the right. I want the div to align to the right, and expand to the left with a longer username.Image

    # December 28, 2011 at 3:37 pm

    float the li left and the ul right (without a width)

    # December 28, 2011 at 4:25 pm

    I knew there was something simple, but I could not think of it or find a solution ughh :/

    I will try that out, thanks.

Viewing 7 posts - 1 through 7 (of 7 total)

You must be logged in to reply to this topic.

*May or may not contain any actual "CSS" or "Tricks".