I'd like to take an h2 element and span it's text across the width of it's div.
text-align:justify;
only spreads the text if it's width is greater than the width of it's container... kind of like Photoshop's justify-left
I'd like to take an h2 element and span it's text across the width of it's div.
text-align:justify;
only spreads the text if it's width is greater than the width of it's container... kind of like Photoshop's justify-left
Time machine answer for when the CSS 3 Text Module becomes a recommendation:
It won't be of much use before then, though.
CSS:
HTML:
Note that this adds a unvisible extra line, resulting in too much height. You might want to compensate for that:
And for a very neat markup, only working for browsers other then IE7 or below, you could use the
::after
selector:See demo fiddle of all three solutions.