Grow your CSS skills. Land your dream job.

relative letter spacing?

  • # November 9, 2009 at 12:17 pm

    Hello

    Is it possible to give the header tag an attribute that forces a width of e.g. 300px for both headers?

    Example: if I on one page have a header that says:

    "This is a very long header"

    and another header that says

    "short header"

    Can I make both headers the same width?

    Thank you
    Simon

    # November 9, 2009 at 12:34 pm

    I’m going to go ahead and say it’s not possible, though saying that makes me feel a little wrong. There might be some crazy javascripting you can do, but I don’t know why you would want to do this in the first place.

    # November 9, 2009 at 6:35 pm

    Not letter but word spacing may help things in the right direction:

    Code:
    {
    text-align: justify;
    }
    # November 10, 2009 at 7:17 am

    @TeMc

    text-align justify only works with, I guess, anything longer than two-three words. In my above mentioned first example, it could work but I need it to work with e.g. two words.
    Whether or not it is a good solution graphically or not, I think it would be nice if I could get it to work.

    /Simon

    # November 14, 2009 at 9:07 pm

    theres no way to do this in css.. (text-align:justify only works if you have more than one line of text)

    # November 15, 2009 at 12:48 am
    "Norman" wrote:
    theres no way to do this in css.. (text-align:justify only works if you have more than one line of text)

    And it only works on the lines that wrap (never on the last line).

Viewing 6 posts - 1 through 6 (of 6 total)

You must be logged in to reply to this topic.

*May or may not contain any actual "CSS" or "Tricks".