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 3 of 3
  1. #1
    Senior Coder
    Join Date
    Jul 2003
    Location
    My pimped-out igloo in Canadia
    Posts
    1,966
    Thanks
    36
    Thanked 0 Times in 0 Posts

    can vertical-align only be applied to images?

    Hi,

    i have a table cell and within it a div. I want to have this be be vertical-align: middle but it doesn't seem to work.

    Is what I'm trying to do impossible or have I just mis-used the css?

    Code:
     <td class="thismonth tue" valign="top"> <div class="date">11</div>
                        <div class="cell"> 
                          <div class="alertTitle">Clinic Cancelled<br>-!-<br>Clinique Annul&eacute;e</div>
                        </div></td>
    
    and
    
    div.alertTitle {
    	color: #FF0000;
    	font-weight: bold;
    	font-family: Arial, Helvetica, sans-serif;
    	font-size: 11px;
    	padding-bottom: 2px;
    	text-align: center;
    	vertical-align: middle
    }
    Before you criticize someone, you should walk a mile in their shoes. That way, when you criticize them, you're a mile away and you have their shoes :)

  • #2
    Senior Coder nikkiH's Avatar
    Join Date
    Jun 2005
    Location
    Near Chicago, IL, USA
    Posts
    1,973
    Thanks
    1
    Thanked 32 Times in 31 Posts
    It is aligning, just to its parent container.
    Set the width to 100%, or set the align on the TD, not the div.

    If this post contains any code, I may or may not have tested it. It's probably just example code, so no getting knickers in a bunch over a typo, OK? If it doesn't have basic error checking in it, such as object detection or checking if objects are null before using them, put that in there. I'm giving examples, not typing up your whole app for you. You run code at your own risk.
    Bored? Visit
    http://www.kaelisspace.com/

  • #3
    Senior Coder
    Join Date
    Jul 2003
    Location
    My pimped-out igloo in Canadia
    Posts
    1,966
    Thanks
    36
    Thanked 0 Times in 0 Posts
    Setting the TD align wont work because i have multiple divs within the TD, but i found a way around it

    Thanks
    Before you criticize someone, you should walk a mile in their shoes. That way, when you criticize them, you're a mile away and you have their shoes :)


  •  

    Posting Permissions

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