Previous Message
Next Message

Trying to emulate a LaTeX trick in CSS...

Sent by Philippe Wittenbergh on 9 April 2009 10:10

On Apr 9, 2009, at 5:19 PM, Cristian Palmas wrote:

> By the way, the "ex" measure unit in CSS does not exist for width.  
> You can
> use, on second your needs: "px", "pt" (I recommend to use only for  
> print
> styles), "%" or "em".
> See for  
> further info.

That is incorrect. It is certainly possible to use 'ex' for width.

the quote URL says:
> Value:  	<length> | <percentage> | auto | inherit

<length> brings us to

> There are two types of length units: relative and absolute. Relative  
> length units specify a length relative to another length property.  
> Style sheets that use relative units will more easily scale from one  
> medium to another (e.g., from a computer display to a laser printer).
> Relative units are:
>     * em: the 'font-size' of the relevant font
>     * ex: the 'x-height' of the relevant font
>     * px: pixels, relative to the viewing device

Whether you'll get consistent results in browser is a different  
matter. On Windows, the ex unit is really broken in Safari 4b+/Chrome,  
well implemented in IE 8 (Vista and Win 7 only) and Gecko browsers.  
Opera always treated it as 1/2 em. On Mac, it is half-broken in Safari  
4b+; it works fine in Gecko based browsers.

As for the original question, as asked, that cannot be done in CSS   
yet. Some kind of text-justify value would do, but atm not implemented  
in any browser.
This maybe (future !):

maybe some javascript trick might do.

Philippe Wittenbergh

css-discuss [EMAIL-REMOVED]]
List wiki/FAQ --
List policies --
Supported by --
Previous Message
Next Message

Message thread: