Do you have a question? Post it now! No Registration Necessary. Now with pictures!
- Posted on
- How to force a text to be on the same level?
January 22, 2009, 3:52 am
rate this thread
I put some text in a table. Because of some reasons text in different
cells is on different levels. You can see this problem here
One can clearly see that "It is" (in the left cell) is higher than
"web-site" (in the right cell).
Could anybody help me to find out why it happens?
Thank you in advance for any help.
Re: How to force a text to be on the same level?
It's all those numerous font-size properties you have in there. The left
hand td only contains a span. The right contains a span preceeded by an a,
and probably a couple of text nodes representing the \r\n between said
elements. Something in there is causing the td to consider some of its
content to be font-size: 100%, and it's sizing itself accordingly. The other
elements (the a and the span) are of course positioned at the baseline of
this font-size 100% text and, as they are smaller, appear lower.
A similar effect can be obtained by inserting some text before or after the
span in the first td. This text will of course be the default text size
(100%). Now the left td will be the same size as the right td and the text
in both will be lined up. (All of this is very easy to do with firebug).
Set font-size *once*, for the body, and set it to 100%. Alter it for
individual elements (or style rules) only if it differs.
- » How to find out what search terms people used to find your site through google?
- — Previous thread in » HTML Authoring Forum