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 to make sentences the same width???

Discussion in 'HTML & Website Design' started by Emie., Feb 19, 2008.

  1. #1
    Does anyone know of a code I could use to make sentences all the same width so they don't look so messy on my website?
     
    Emie., Feb 19, 2008 IP
  2. Cri2T

    Cri2T Peon

    Messages:
    104
    Likes Received:
    3
    Best Answers:
    0
    Trophy Points:
    0
    #2
    <p style="text-align:justify;">
    Your sentences here.<br />
    More sentences here...<br />
    Even more sentences here...<br />
    and so-on and so-forth.<br />
    </p>


    This is the only bit of code that you need: "text-align: justify;" but I wrote the above assuming you don't know CSS or how to implement that in your site.
     
    Cri2T, Feb 19, 2008 IP
    Emie. likes this.
  3. Emie.

    Emie. Banned

    Messages:
    1,263
    Likes Received:
    45
    Best Answers:
    0
    Trophy Points:
    0
    #3
    Where can I put it so that I don't have to enter it everytime I make a post?
     
    Emie., Feb 19, 2008 IP
  4. AstarothSolutions

    AstarothSolutions Peon

    Messages:
    2,681
    Likes Received:
    77
    Best Answers:
    0
    Trophy Points:
    0
    #4
    Put it in the stylesheet against the name of the div/ cell etc that holds the comments or as a class that these use
     
    AstarothSolutions, Feb 19, 2008 IP
  5. Stomme poes

    Stomme poes Peon

    Messages:
    3,195
    Likes Received:
    136
    Best Answers:
    0
    Trophy Points:
    0
    #5
    After doing this, though, take a second look at your text. Depending on what the width is, sometimes t h e t e x t g e t s v e r y h a r d t o re ad.

    A change in font might be in order after text-justify. Just to warn you : )
     
    Stomme poes, Feb 19, 2008 IP
  6. innovati

    innovati Peon

    Messages:
    948
    Likes Received:
    63
    Best Answers:
    1
    Trophy Points:
    0
    #6
    cautious editing goes a long way to. as Stomme poes pointed out when you justify a block of text you end up with gaps and spaces between lines that designers call "snakes" or "rivers" and the solution is manual letterspacing and kerning.....which can't be done in CSS.

    I would try to avoid justified text unless it's a lot of text with very very long line lengths (like full-page width)
     
    innovati, Feb 19, 2008 IP
    Emie. likes this.
  7. Stomme poes

    Stomme poes Peon

    Messages:
    3,195
    Likes Received:
    136
    Best Answers:
    0
    Trophy Points:
    0
    #7
    You can't set kerning, but you can set letterspacing in CSS, as well as wordspacing.

    letter-spacing: .5em;
    word-spacing: 2em;

    No percentages allowed, and of course this person would not want to use these for this particular problem, but it's a nice tool, esp for design : )

    Another option that I have JUST learned about a few days ago on another forum is called the soft hyphen. You stick it where, if a word needs to be broken, a hyphen would be appropriate. Not supported by FF2, but there was a way around that. & shy; or &# 173; (spaces added so they render). Also nice to have.
     
    Stomme poes, Feb 19, 2008 IP
  8. LittleJonSupportSite

    LittleJonSupportSite Peon

    Messages:
    386
    Likes Received:
    20
    Best Answers:
    0
    Trophy Points:
    0
    #8
    I find it very difficult to read when people do this. Your better of using divs and keeping everything evenly spaced. For example on 100% width use 4 25% boxes. Things like that.
     
    LittleJonSupportSite, Feb 19, 2008 IP
    Emie. likes this.
  9. Cri2T

    Cri2T Peon

    Messages:
    104
    Likes Received:
    3
    Best Answers:
    0
    Trophy Points:
    0
    #9
    I've used this on quite a few designs for people who wanted it, and I've never seen i t s p a c e t h e t e x t o u t t h i s b a d l y...

    It spaces each line about a word's width, and the final line just doesn't go all the way to the end. Although, you guys are right, he has to have alot of text to do it with or it will be just horribly messy.
     
    Cri2T, Feb 19, 2008 IP
  10. Stomme poes

    Stomme poes Peon

    Messages:
    3,195
    Likes Received:
    136
    Best Answers:
    0
    Trophy Points:
    0
    #10
    It seems to depend on the font, whether or not i t s p a c e s o u t so bad. It also depends on the width of the container. It seems to me that using text-justify on a container as wide as the page would have less problem than in a container only 150px wide.
     
    Stomme poes, Feb 19, 2008 IP
  11. deathshadow

    deathshadow Acclaimed Member

    Messages:
    9,666
    Likes Received:
    1,983
    Best Answers:
    250
    Trophy Points:
    515
    #11
    Pretty much - though you REALLY have to take 'justify' on a case by case basis. For 12px text 320px seems about right for most text - you can do the math to scale that up ;) - though excessively long words can throw it completely out of whack - it also varies from font to font as not all fonts kern the same.
     
    deathshadow, Feb 19, 2008 IP
    Emie. likes this.
  12. camp185

    camp185 Well-Known Member

    Messages:
    1,653
    Likes Received:
    51
    Best Answers:
    0
    Trophy Points:
    180
    #12
    Justify is for newspapers or column articles. Is this for main content reading on your site? I would not use justify is that is the case.
     
    camp185, Feb 19, 2008 IP
    Emie. likes this.