views:

135

answers:

2

I have this CSS code:

   #tweet-container{
width: 290px; 
height: 272px; 
border: 1px solid #CCC; 
color: #CCC; 
font-size: 28px; 
text-align: center;
letter-spacing: -2px; 
min-height: 10px; 
display: table-cell; 
vertical-align: middle; 
padding: 15px;
}

But firefox doesn't seem to recognize the top and bottom padding. Safari and Chrome both show it normally, and even in Firebug when I add padding-top: it doesn't work. Its like its not a valid statement or something. Is there something I'm missing?

A: 

did you try adding padding:15px!important; ?

webdestroya
I hadn't tried that, but it doesn't fix the issue...thanks, though.
WillyG
+1  A: 

Humm, this is a bit interesting. You've set the width as 272px, but its actually displayed as 270px. You've set the height as 290px, with the 30px total of padding, the real displayed height should be 320px, but its actually 318px.

Had a little play and taking out display: table-cell; seems to sort the issue. Although the padding isn't spread equally for some reaosn, it all appears at the bottom. Putting the text in a p tag, and giving that a 15px top margin has done the job though I think.

thebluefox
The only real reason I used display:table-cell is for the ability to vertical align text that has an unknown height. For this reason, I'd like to try to keep that in there, but it seems as if its the trouble-maker...might have to use a javascript solution.
WillyG
Yeah, my solution was a 5 minute hack. Vertically aligning stuff is always a pain in the behind though. Least you're closer to figuring it out though!
thebluefox