Setting text vertical align to bottom in div tag

Reply

Join Date: Dec 2007
Posts: 2
Reputation: kezia_kristina is an unknown quantity at this point 
Solved Threads: 0
kezia_kristina kezia_kristina is offline Offline
Newbie Poster

Setting text vertical align to bottom in div tag

 
0
  #1
Mar 23rd, 2008
Hi all,
I want to set the text on the right side of image to bottom in a div tag.
depict like below:

______
| img |
| |
|_____| The text is here at the bottom of Image

But after trying some CSS code (using 'vertical-align:bottom'), I always got something like below (there is aways a padding on the bottom, even I set the padding-bottom to zero):
______
| img |
| | The text is here at the bottom of Image
|_____|

Here my code:

  1. <div class='title'>
  2. <div class='date'>
  3. <!-- the image is a background of this 'div' -->
  4. </div>
  5. <h2 id='header2'>
  6. The text is here at the bottom of Image
  7. </h2>
  8. </div>
  9.  
  10.  
  11. .title {
  12. padding:0 0 0 0;
  13. vertical-align:bottom;
  14. height:56px;
  15. }
  16.  
  17. .date
  18. {
  19. float:left; width:59px; height:56px; overflow:hidden;
  20. text-align:center;
  21. background: url("someurlHere/icon.jpg") no-repeat;
  22. }
  23.  
  24. #header2 {
  25. vertical-align:bottom;
  26. padding-bottom:0;
  27. }
Anyone can help me?
Last edited by peter_budo; Mar 24th, 2008 at 6:00 am. Reason: [icode]is for one line of code, [code] is for multiple lines
Reply With Quote Quick reply to this message  
Join Date: Jan 2008
Posts: 79
Reputation: rudevils is an unknown quantity at this point 
Solved Threads: 9
rudevils rudevils is offline Offline
Junior Poster in Training

Re: Setting text vertical align to bottom in div tag

 
0
  #2
Mar 24th, 2008
Originally Posted by kezia_kristina View Post
#header2 {
vertical-align:bottom;
padding-bottom:0;
}
Anyone can help me?
try this

  1. #header2 {
  2. vertical-align:bottom;
  3. padding-bottom:0;
  4. float: left;
  5. }
Last edited by peter_budo; Mar 24th, 2008 at 6:00 am. Reason: Keep It Organized - please use [code] tags
If love is blind, why there's a bikini ??

Post your article at Bali Side Notes share your knowledge
Reply With Quote Quick reply to this message  
Join Date: Dec 2007
Posts: 2
Reputation: kezia_kristina is an unknown quantity at this point 
Solved Threads: 0
kezia_kristina kezia_kristina is offline Offline
Newbie Poster

Re: Setting text vertical align to bottom in div tag

 
0
  #3
Mar 24th, 2008
No, it didn't work
Reply With Quote Quick reply to this message  
Join Date: Jan 2008
Posts: 79
Reputation: rudevils is an unknown quantity at this point 
Solved Threads: 9
rudevils rudevils is offline Offline
Junior Poster in Training

Re: Setting text vertical align to bottom in div tag

 
0
  #4
Mar 24th, 2008
sorry i didn't see height attribute in your ".title"
try it like this :

HTML and CSS Syntax (Toggle Plain Text)
  1. .title {
  2. padding:0 0 0 0;
  3. text-align: left;
  4. }
  5.  
  6. .date {
  7. width:59px; height:56px; overflow:hidden;
  8. text-align:center;
  9. background: url("someurlHere/icon.jpg") no-repeat;
  10. }
  11.  
  12. #header2 {
  13. padding:0;
  14. margin:0;
  15. }
If love is blind, why there's a bikini ??

Post your article at Bali Side Notes share your knowledge
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:



Similar Threads
Other Threads in the HTML and CSS Forum
Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC