Results 1 to 4 of 4

Thread: Div Hover, fit to Text?

  1. #1
    Join Date
    Sep 2007
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Div Hover, fit to Text?

    Hi everyone,

    Does anyone know how to use CSS to make a div's height increase to accommodate for the amount of text? I know that this wouldn't normally take any special coding, but for some reason it isn't working. I might be missing something really simple.

    Here's the url:http://www.freewebs.com/wxyzack/test.htm

    I just want "#u:hover" to stretch length-wise for the amount of text it has. The text is cut-off with "overflow:hidden" in "#u", but not in "#u:hidden". Why is the text still cutoff in "#u:hover"?

  2. #2
    Join Date
    Oct 2005
    Posts
    255
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Default

    Do this
    <div id="test">
    on the page where you have the box or content..

    and on the css add this

    #test {
    width : auto;
    height : auto;
    }

    something like that should work, test it and let me know...
    Hey new design new look, goto xudas for personal webdsign help.. (:

  3. #3
    Join Date
    Jul 2007
    Posts
    11
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    yes if you add height:auto or width:auto in there for whichever one you want to change... it works

    i looked at your css code and u didnt even have the height property in the hover part so there was no way it would have known to change, and your width property didnt have a unit in there (eg 270px).
    Last edited by littleEd; 09-26-2007 at 02:28 AM.

  4. #4
    Join Date
    Sep 2007
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    yeah, i realized that a few minutes after i posted this. sorry everyone

Bookmarks

Posting Permissions

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