Forum Moderators: not2easy

Message Too Old, No Replies

Justify text in an inline span element?

         

JAB Creations

4:26 am on Apr 4, 2007 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I'm having a sneaky suspicion that paragraphs are able to justify text because they are block level elements? I'd like to justify text inside a span element without it clearing other spans, is this possible in CSS 2?

- john

Setek

5:14 am on Apr 4, 2007 (gmt 0)

10+ Year Member



Hmm, I'm inclined to believe it can't be done.

Justification is taking up the measure because the line itself isn't long enough to do so naturally.

If it's an inline element, it is only as long as itself, therefore it takes up the width of its "measure" perfectly.

The only way I can see this working is by setting the

span
to display as block.

As you can see from the W3C, the

text-align
property only applies to block-level elements:

CSS 2, Chapter 16: Text [w3.org]

Dabrowski

6:25 pm on Apr 4, 2007 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Setek is right, can you explain what you're trying to do?