Jump to content


Photo

Vertical Align text inside of boxes


  • Please log in to reply
1 reply to this topic

#1 draconis1

draconis1

    Newbie

  • Members
  • Pip
  • 1 posts
  • Country: Country Flag

Posted 28 February 2013 - 05:51 PM

Hello all,

     I searched best I could and did not find a solution so I thought I would ask. I am trying to vertically align text inside a series of boxes. I used CSS to get the rounded corners and shadow working but I can't seem to get the vertical alignment to work. I tried using:

 
#fbox_ID {vertical-align:middle;}

 

both on it's own and with a table cell declaration as well as:

 
#fbox_ID {position: absolute; top:50%;}

 

I'm still new to CSS so forgive me if this should be a self evident fix.  :(

 

Thanks!

Robert



#2 James B

James B

    Advocate

  • Moderators
  • 5126 posts
  • LocationSurrey - UK
  • Country: Country Flag

Posted 28 February 2013 - 11:49 PM

Hi Robert

 

You're css looks correct, its #fbox though as the ID, not fbox_ID, you might need to go further into the elements within the box to get this to work correctly, like inside the box you have the fbox title and the fbox content. If you use those classes you are applying those instructions specifically to those areas.