1. Advertising
    y u no do it?

    Advertising (learn more)

    Advertise virtually anything here, with CPM banner ads, CPM email ads and CPC contextual links. You can target relevant areas of the site and show ads based on geographical location of the user if you wish.

    Starts at just $1 per CPM or $0.10 per CPC.

How do I horizontally scale text with css?

Discussion in 'CSS' started by bizmart, Jun 11, 2007.

  1. #1
    My client has provided me with the text size, spacing and width settings that he wants on his site. I have got the word-spacing (tracking) and letter-spacing (kerning) set correctly but I am having trouble setting the horizontal scaling of the text with css. Does anyone know if it can actually be done? He wants it set at 80%. I have come across the "font-stretch" command, which I think would work but it doesn't appear to be recognized by any browsers.

    Any help would be appreciated.
     
    bizmart, Jun 11, 2007 IP
  2. Xabber

    Xabber Active Member

    Messages:
    437
    Likes Received:
    6
    Best Answers:
    0
    Trophy Points:
    58
    #2
    Make a div class with 80% width :)
     
    Xabber, Jun 11, 2007 IP
  3. bizmart

    bizmart Active Member

    Messages:
    436
    Likes Received:
    20
    Best Answers:
    0
    Trophy Points:
    58
    #3
    Thanks Xabber! I'll give it a go to see if has the desired effect.
     
    bizmart, Jun 11, 2007 IP
  4. bizmart

    bizmart Active Member

    Messages:
    436
    Likes Received:
    20
    Best Answers:
    0
    Trophy Points:
    58
    #4
    Still having some problems. When I set the width in the div class to 80% it makes the text drop down to the next line instead of squashing it so that it all fits on one line (it's only two words).
     
    bizmart, Jun 11, 2007 IP
  5. demonhale

    demonhale Peon

    Messages:
    352
    Likes Received:
    13
    Best Answers:
    0
    Trophy Points:
    0
    #5
    I think it's hard to stretch the actual texts other than adjusting it's spacing... why do they need it to stretch anyway? the spacing could do it...
     
    demonhale, Jun 11, 2007 IP
  6. bizmart

    bizmart Active Member

    Messages:
    436
    Likes Received:
    20
    Best Answers:
    0
    Trophy Points:
    58
    #6
    He wants each individual letter to be narrower than normal. Spacing will pull the letters closer together but it doesn't make them narrower. I have to agree, having seen my customers example done with Illustrator, that at 80% it looks much better than standard width text and is easier to read.
     
    bizmart, Jun 12, 2007 IP
  7. demonhale

    demonhale Peon

    Messages:
    352
    Likes Received:
    13
    Best Answers:
    0
    Trophy Points:
    0
    #7
    If it's a short header, why not use a graphical text instead and display:none; the actual texts... I think there's no way you can do the stretching through css, unless you do find a font that is exactly at that stretch point...
     
    demonhale, Jun 12, 2007 IP