Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 7 of 7

Thread: Add Text Upward

  1. #1
    New Coder
    Join Date
    Dec 2008
    Posts
    58
    Thanks
    2
    Thanked 1 Time in 1 Post

    Add Text Upward

    So I don't know if this is possible without javascript, but here is what I am looking to do.

    I have a div with a min-height of 75px and within the div I have text (and other inline objects [or objects that I made inline through styles] like anchors).

    What I want the text to do is start at the bottom of the div, and the more I add I want the text to be vertically-aligned to the bottom so that the text is always align with the bottom of the div. Also, if the text hits more than 75px I want the div to expand to fit (thus min-height:75px).

    here is my HTML so far (with styles added inline):
    Code:
    <div style="min-height:75px">
    Some Text <a href="link">Link</a>
    </div>
    I tried to do vertical-align:bottom on the div, but that didn't work. Am I doing it wrong, and/or how should it be done?

  • #2
    Senior Coder twodayslate's Avatar
    Join Date
    Mar 2007
    Location
    VA
    Posts
    1,042
    Thanks
    67
    Thanked 39 Times in 39 Posts
    Got a picture of what you want?
    twitter | Quality Hosting - $5.95/mo*
    Feel free to PM me!

  • #3
    New Coder
    Join Date
    Dec 2008
    Posts
    58
    Thanks
    2
    Thanked 1 Time in 1 Post
    No, I don't have a picture, but in essence here is what I want:

    Code:
    -------------
    
    
    
    This is some
    text.
    ------------

    Code:
    -------------
    
    This is some
    text. This is 
    additional
    text.
    ------------

    Code:
    -------------
    This is some
    text. This is
    additional
    text. This
    text expands
    the height
    by a few 
    extra px.
    ------------
    (The dashed lines are the top and bottom of the divs). Does that make more sense?

  • #4
    New Coder
    Join Date
    Dec 2008
    Posts
    58
    Thanks
    2
    Thanked 1 Time in 1 Post
    *bump*

  • #5
    Senior Coder effpeetee's Avatar
    Join Date
    Feb 2007
    Location
    Clapham Junction - London SW
    Posts
    4,885
    Thanks
    228
    Thanked 204 Times in 203 Posts
    If you have a div with a fixed width, the text will automatically fill as you want.
    Leave the height undefined.

    There are some usefull sites here.

    Frank
    * Sources (updated: 21.11.2012.
    Using Windows 8 Professional. 64bit with HP Photosmart 5510 printer Very useful site here.

  • #6
    New Coder
    Join Date
    Dec 2008
    Posts
    58
    Thanks
    2
    Thanked 1 Time in 1 Post
    @effpeetee I have the height set as auto (aka default) so it should automatically fill as needed. I just want the text to be able to start from the bottom of the div instead of the top and have the text stay within the div (aka not use padding/margin to lower it and thus have the text disappear if I add extra amounts) [the amounts of text will randomly change due to a script and thus I can't just always change the padding]

  • #7
    Senior Coder effpeetee's Avatar
    Join Date
    Feb 2007
    Location
    Clapham Junction - London SW
    Posts
    4,885
    Thanks
    228
    Thanked 204 Times in 203 Posts
    Is this site any help.
    It uses Javascript I believe.

    Another possibility here?


    Frank
    Last edited by effpeetee; 05-09-2009 at 01:11 PM.
    * Sources (updated: 21.11.2012.
    Using Windows 8 Professional. 64bit with HP Photosmart 5510 printer Very useful site here.


  •  

    Posting Permissions

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