Re: [css-d] how big is a space in ems?
On 11/03/2008 18:20, Jukka K. Korpela wrote: > So if you had a situation where you wanted, for some reason, to set e.g. > the left padding of an element to match the width of a space, then > padding-left: 0.25em > would probably be the best guess in general. That's exactly what I want: I have text being output from a dynamic system and don't want to hard-code an before the text output, but instead want to pad it has you mention so it sits consistently with the adjacent text. Thanks all for the help. I'm testing 0.5ex at the moment, but I knew there was a reason I avoid using ex units. I'll change this to 0.25em and tweak from there. -- http://antanova.blogspot.com __ css-discuss [EMAIL PROTECTED] http://www.css-discuss.org/mailman/listinfo/css-d List wiki/FAQ -- http://css-discuss.incutio.com/ List policies -- http://css-discuss.org/policies.html Supported by evolt.org -- http://www.evolt.org/help_support_evolt/
Re: [css-d] how big is a space in ems?
Jason Crosse wrote: > I've got a pretty basic question. How wide is a typographical space > in relative units? It's an interesting question, though not a CSS question as such. It may be relevant in CSS authoring, though, since you can turn a space into an element and then try to set its width. This would be somewhat tricky, though; instead, you would normally set padding or other properties for non-blank elements. The width of the Ascii SPACE character varies by font. Moreover, when justification (text-align: justify) is applied, spaces may get stretched as needed. Other space characters may have specific widths assigned to them, but they are generally more or useless in web authoring; see http://www.cs.tut.fi/~jkorpela/chars/spaces.html > I want to pad a one-line element's left side so > it looks like a space has been inserted. If I understand you correctly, you can just put a NO-BREAK SPACE (U+00A0) there, either as such (if you know how to type it - e.g., Alt+0160 works in most applications on Windows) or as the entity reference . As a character, it is a clone of SPACE with the added feature that it is "non-breaking" when formatting text into lines. In practice, it has the same width as SPACE, though it is not stretchable in justification. > Is there a reliable way of doing this (e.g 0.5ex;), or does is just > depend on how big a given font's space is? The ex unit is not really reliable for anything, because IE incorrectly implements it as half of em whereas e.g. Firefox correctly implements it as the x-height of the font, which is in practice always either smaller or larger than 0.5em. I have a web page about this, don't I... http://www.cs.tut.fi/~jkorpela/x-height.html But you don't need the ex unit here, or CSS at all for this purpose, unless I misunderstood your question. > If it's dependent on the font, is there a traditional proportion > that's widely used across popular fonts? Microsoft's typography page (which is not to be taken as an authority, just as a description of an important manufacturer's approach) says: - The minimum value should be no less than 1/5 the em, which is equivalent to the value of a thin space in traditional typesetting. - For an average width font a good value is ~1/4 the em. - For a wide width font a good value is ~1/3 the em. - The maximum width should be no greater than 1/2 the em, which is equivalent to the en space of a typeface. http://www.microsoft.com/typography/developers/fdsspec/spaces.htm So if you had a situation where you wanted, for some reason, to set e.g. the left padding of an element to match the width of a space, then padding-left: 0.25em would probably be the best guess in general. Jukka K. Korpela ("Yucca") http://www.cs.tut.fi/~jkorpela/ __ css-discuss [EMAIL PROTECTED] http://www.css-discuss.org/mailman/listinfo/css-d List wiki/FAQ -- http://css-discuss.incutio.com/ List policies -- http://css-discuss.org/policies.html Supported by evolt.org -- http://www.evolt.org/help_support_evolt/
Re: [css-d] how big is a space in ems?
On Mar 11, 2008, at 1:57 PM, Rob Emenecker wrote: > The width of a word space will vary depending upon the font you are > working > with. In most cases it falls somewhere between a thin (1/3 em) and > an en > (1/2 em) space. For web page treatments I usually just use 0.4em or > 0.5em > for a standard width word space. I may be getting off topic but is there a specific reason you don't let the browser handle all of this? In other words, Why bother setting the space size on a fluid design rather then going for pixel perfect reproduction in print? -- Jason Pruim Raoset Inc. Technology Manager MQC Specialist 3251 132nd ave Holland, MI, 49424-9337 www.raoset.com [EMAIL PROTECTED] __ css-discuss [EMAIL PROTECTED] http://www.css-discuss.org/mailman/listinfo/css-d List wiki/FAQ -- http://css-discuss.incutio.com/ List policies -- http://css-discuss.org/policies.html Supported by evolt.org -- http://www.evolt.org/help_support_evolt/
Re: [css-d] how big is a space in ems?
The width of a word space will vary depending upon the font you are working with. In most cases it falls somewhere between a thin (1/3 em) and an en (1/2 em) space. For web page treatments I usually just use 0.4em or 0.5em for a standard width word space. -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Jason Crosse Sent: Tuesday, March 11, 2008 12:59 PM To: CSS-Discuss Subject: [css-d] how big is a space in ems? I've got a pretty basic question. How wide is a typographical space in relative units? I want to pad a one-line element's left side so it looks like a space has been inserted. Is there a reliable way of doing this (e.g 0.5ex;), or does is just depend on how big a given font's space is? If it's dependent on the font, is there a traditional proportion that's widely used across popular fonts? __ css-discuss [EMAIL PROTECTED] http://www.css-discuss.org/mailman/listinfo/css-d List wiki/FAQ -- http://css-discuss.incutio.com/ List policies -- http://css-discuss.org/policies.html Supported by evolt.org -- http://www.evolt.org/help_support_evolt/
Re: [css-d] how big is a space in ems?
> but harking back to my days of letterpress printing And you've got the lead burn scars to prove it, right? __ css-discuss [EMAIL PROTECTED] http://www.css-discuss.org/mailman/listinfo/css-d List wiki/FAQ -- http://css-discuss.incutio.com/ List policies -- http://css-discuss.org/policies.html Supported by evolt.org -- http://www.evolt.org/help_support_evolt/
Re: [css-d] how big is a space in ems?
On Tue, March 11, 2008 4:58 pm, Jason Crosse wrote: > I've got a pretty basic question. How wide is a typographical space > in relative units? I want to pad a one-line element's left side so > it looks like a space has been inserted. > > Is there a reliable way of doing this (e.g 0.5ex;), or does is just > depend on how big a given font's space is? > > If it's dependent on the font, is there a traditional proportion > that's widely used across popular fonts? I don't know what tends to be the case in computer typography, but harking back to my days of letterpress printing, apart from the em and en (0.5em) spaces, there were thicks, mids and thins, also known as three-to-em, four-to-em and five-to-em. Unless one was setting type with full justification, when the spacing had to vary on a line-by-line and word-by-word basis, the most common word spacing was a thick, or 1/3 of an em - 0.33em should be accurate enough :-) HTH, Nick. -- Nick Fitzsimons http://www.nickfitz.co.uk/ __ css-discuss [EMAIL PROTECTED] http://www.css-discuss.org/mailman/listinfo/css-d List wiki/FAQ -- http://css-discuss.incutio.com/ List policies -- http://css-discuss.org/policies.html Supported by evolt.org -- http://www.evolt.org/help_support_evolt/