SitePoint Sponsor

User Tag List

Results 1 to 4 of 4

Thread: expanding a DIV

  1. #1
    SitePoint Enthusiast
    Join Date
    Mar 2006
    Posts
    60
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    expanding a DIV

    Hi all

    Can anyone pls. tell me how can i expand my div tag horizontally. I have tried using height only without any width for the DIV... but it didnt work. I want my DIV to expand horizontally according to the text entered in the DIV.
    Anyone kindly solve this issue

    Pls check the below link

    http://demo.animatingminds.com

    I want my username bar(top right hand side)to expand and contract according to the number of characters entered.

    thanks in advance
    venkat

  2. #2
    SitePoint Enthusiast
    Join Date
    Jun 2005
    Posts
    61
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Check out the sliding doors technique by Doug Bowman.

    Sliding Doors

  3. #3
    The CSS Clinic is open silver trophybronze trophy
    Paul O'B's Avatar
    Join Date
    Jan 2003
    Location
    Hampshire UK
    Posts
    40,343
    Mentioned
    179 Post(s)
    Tagged
    6 Thread(s)
    Hi,

    If you float an element without width then it will shrink wrap it's contents (ie5 mac needs a width though).

    If you are talking about your welcome username you could do something like this.

    Code:
    #unameBar   {position:relative; float:right; width:auto; margin-top: 5px; margin-right: 5px; padding-right:35px}
    
    .unBr	{background:url(../image/default/username-endcap_right.gif) no-repeat; position:absolute;right:0;top:0;  width: 35px; height: 35px;}

  4. #4
    SitePoint Enthusiast
    Join Date
    Mar 2006
    Posts
    60
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thanks a lot paul... it worked.


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
  •