I tried something along these lines:
a {font-size: 1em; border: 1em; padding: 1em;}
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
Now imagine the link text is rather long so that both links can't be shown on one line. Then they are displayed one under the other. To prevent the boxes of both links to overlap I did this:
a {line-height: 5em} because:
1. The letters themselves are 1em high (according to definition).
2. There are 2 times border and 2 times padding between the fonts. According to definition: 4em.
Now both boxes should just touch each other. If I put 5.1 em as line-height then there should be space between the two borders, right? But there isn't! Why? (with 5.2 em there is a little space between them)
The content is HTML
The content is HTML proprietary, and makes no sense.
David, what do you mean by
David, what do you mean by "content" and what do you mean by "HTML proprietary"?
src is not an
src is not an attribute, therefore it is HTML proprietary ("garbage").
And this is the content:
<a src="">aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa</a> <a src="">aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa</a>
Do you have a CSS question?
I'm sorry, David. src="" was
I'm sorry, David. src="" was meant to be href="" and why does the content play a role? Just imagine something meaningful would be there instead of the letter a.
Here's the css question:
David, why is there no vertical space between the two links' borders when line-height is 5.1 em if the font-size, borders and paddings only add up to 5 em? (assuming the links are one under the other)
This is my take. An em is
This is my take.
An em is equal to the space a capital M occupies. Ie, 1 em x 1em. However, some letters extend below the line. Ie, the letters y, p, q etc. Therefore, line height is actually greater than 1em to accomodate the tails of these letters
I don't play games. Put it
I don't play games. Put it on a public server with a clickable link to the page/problem in question.
David Laakso wrote:I don't
I don't play games. Put it on a public server with a clickable link to the page/problem in question.
The question is quite proper and does indeed deal with css related issues. The markup is intended to be representative and not literal. If you don't like or want to assist in this thread, then don't.
If you lack an understanding of the OP's question, feel free to ask for clarification. Beyond that is not within your purview.
gary
moderator
gary.turner wrote: The
The question is quite proper and does indeed deal with css related issues. The markup is intended to be representative and not literal.
Then get off my case, and answer the OPs question.
David Laakso
The question is quite proper and does indeed deal with css related issues. The markup is intended to be representative and not literal.
Then get off my case, and answer the OPs question.
After several attempts to encourage less discourtesy and less sarcasm in your responses, and despite your obvious knowledge of the subject, I am blocking your account pending discussion with the other moderators.
If you feel this is arbitrary or undeserved, you may contact the site's administrator at http://csscreator.com/contact
gary.turner
moderator
You have chosen to ask about
You have chosen to ask about one area of css's typographical stuff that is poorly understood by the unwashed masses of developers: the inline box model.
Since I have to put myself in that category, I'll give you a simple test case based on your example that I hope will illustrate what's going on.
p { margin: 3em; /*to reveal what would normally be hidden*/ } a { background-color: white; color: red; font-size: 1em; border: 1em solid red; padding: 1em; } a#v2 { color: blue; opacity: .5; border-color: blue: } ===================== <p><a href="#">aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa</a> <a href="#" id="v2">aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa</a></p>
You should see that the actual line-height is not affected. The vertical padding and thus the borders do not impinge on lines above and below; they overlap.
See David Baron, a major player at Mozilla and W3C, and Eric Meyer, a NameĀ® in css.
Neither are easy to absorb, but keep trying. Play around with what you see and learn. Come back with the specific questions that arise.
cheers,
gary
Huh. That's weird. I wish
Huh. That's weird. I wish it would overlap when I'm using line-height to vertically center stuff : )
Now, I don't have IE at the moment cause I'm at home, but with that funny idea it has about line-height=height (well, IE6), do they NOT overlap in IE6? That might explain some things I've seen.
BTW to anyone else with David's confusion about when one would ever meet a case like this, just think of very long links, which have no line breaks and are sometimes very very very long.
http://www.example.com/something/somethingelse/somedates/2008/10/17/someotherstuff?phpstuff/morestuff/strangecodes/298739509834987398734567%
They show up on websites all the time, esp where people can post comments that don't fit the comment-box.
I didn't want feed the fire
I didn't want feed the fire by stepping into the offtopic lane of David. With this said I want to thank Gary for moderating the thread appropriatly.
I have looked at on of the texts about inline formatting and I have to agree that it is not a very easy to understand matter. For example I didn't know until now that a font has an em-box. So it seems that there are several things I have to learn about first before being able to fully understand the answer to my question. Thanks Gary for showing me the right direction.
Yeah I also want to thank
Yeah I also want to thank you Gary for David's Inline Box link-- three boxes??? Geez no wonder stuff doesn't do what I expect it to sometimes. It's bookmarked!