treehouse : what would you like to learn today?
Web Design Web Development iOS Development

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

  • 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?
  • 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!
  • 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
  • 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?
  • 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
  • float the li left and the ul right (without a width)
  • I knew there was something simple, but I could not think of it or find a solution ughh :/

    I will try that out, thanks.