Reputation: 6477
I am trying to vertically align the contents of a PRE block within a TD to "Top". I am using a CSS stylesheet file. No Luck. I can get the font colour and size to change however.
table td pre{
color: red;
font: normal 16px Arial;
vertical-align:top; /* Does not work */
}
Thoughts appreciated.
EDIT:
table td pre{
color: red;
font: normal 16px Arial;
}
table td {
padding: 5px;
border: solid 1px white;
background-color: #edeff1;
vertical-align: top;
}
Upvotes: 2
Views: 1864
Reputation: 37065
Make sure you 0 out any top spacing on the pre element as well:
td {
padding-top: 0;
margin-top: 0;
vertical-align: top;
}
pre {
padding-top: 0;
margin-top: 0;
}
Upvotes: 1
Reputation: 46910
Vertical align is for td
and not for pre
table td.preBlock{
vertical-align:top;
}
table td pre{
color: red;
font: normal 16px Arial;
}
Then you can do
<td class="preBlock">
Edit:
Seems to work for me even that way, just reduce margin-top
. See here
Upvotes: 3