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 5 of 5
  1. #1
    Regular Coder
    Join Date
    Oct 2009
    Posts
    189
    Thanks
    38
    Thanked 3 Times in 3 Posts

    aligning a text node in a div on the bottom

    Hey all,

    I can't figure out how to align a text node appeneded to a div to the bottom of the div so that regardless of the amount of text the last line of text is aligned to the bottom:

    Code:
    <div style="position: absolute; bottom: 0px; margin-bottom: 0px; left: 0px; width: 537px; height: 94.25px; background-color: rgb(255, 255, 255); opacity: 0.5;" class="textholder" id="textholder97342611">Pioneers of innovative technology</div>
    The text node is being appended to the div in javascript, particularly using the jquery library:

    $('#textholder'+randID).html(t).animate({marginBottom:'0px'},500);

    I tried doing this but didn't work:

    Code:
    						$('#textholder'+randID).append('<span></span>');
    						$('#textholder'+randID+' span').html(t);
    						$('#textholder'+randID+' span').css({verticalAlign:'text-bottom'});
    This is link the plugin:
    http://www.stahs.org.uk/jquery.infinitecarousel.bak

    Thanks for response.

  • #2
    New Coder
    Join Date
    Sep 2010
    Location
    U S of A
    Posts
    56
    Thanks
    0
    Thanked 12 Times in 12 Posts
    does this help any ? ...

    Code:
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml" dir="ltr" lang="en">
    
    <div style="
    position: absolute;
    margin-bottom: 0px; 
    bottom:0;
    left: 0px;
     width: 537px;
     height: 94.25px;
     background-color: rgb(255, 255, 55);
     opacity: 0.5;" 
    class="textholder" 
    id="textholder97342611">
    <div style="display:table-cell; height: 94.25px;vertical-align:bottom">
     ...  Pioneers of innovative technology<br>Pioneers of innovative technology
    </div>
    </div>

  • Users who have thanked Shaka Zorba for this post:

    johnmerlino (12-08-2010)

  • #3
    Regular Coder
    Join Date
    Oct 2009
    Posts
    189
    Thanks
    38
    Thanked 3 Times in 3 Posts
    It worked somewhat. Is there a way to get the text to be center aligned. text-align: center doesn't work.

  • #4
    New Coder
    Join Date
    Sep 2010
    Location
    U S of A
    Posts
    56
    Thanks
    0
    Thanked 12 Times in 12 Posts
    text-align center works if we have to specify
    the width like this ...

    Code:
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml" dir="ltr" lang="en">
    
    <div style="
    position: absolute;
    margin-bottom: 0px; 
    bottom:0;
    left: 0px;
     width: 537px;
     height: 94.25px;
     background-color: rgb(255, 255, 55);
     opacity: 0.5;" 
    class="textholder" 
    id="textholder97342611">
    <div style="display:table-cell; height: 94.25px;width: 537px;vertical-align:bottom;text-align: center;">
     ...  Pioneers of innovative technology<br>Pioneers of innovative technology
    </div>
    </div>

  • #5
    Regular Coder
    Join Date
    Oct 2009
    Posts
    189
    Thanks
    38
    Thanked 3 Times in 3 Posts
    thanks


  •  

    Tags for this Thread

    Posting Permissions

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