SitePoint Sponsor

User Tag List

Results 1 to 17 of 17
  1. #1
    SitePoint Guru coiL's Avatar
    Join Date
    Sep 2001
    Location
    QLD, Australia
    Posts
    666
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Question How do you do that???

    I've seen a few sites now where the text in a paragraph makes a square. (ie; there are no lines longer then any other lines in the paragraph)

    I'm guessing it's done with css but I haven't come across it in any tutorials. Anyone know?

    Thanks
    coiL
    "cradled in the learning curve"

  2. #2
    SitePoint Zealot
    Join Date
    Jan 2002
    Posts
    111
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Coil,
    Post a link to the example and well try to show you how its done. ;-)

  3. #3
    The Legend Indian's Avatar
    Join Date
    Nov 2001
    Location
    Gods' Own Country
    Posts
    890
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: How do you do that???

    Originally posted by coiL
    I've seen a few sites now where the text in a paragraph makes a square. (ie; there are no lines longer then any other lines in the paragraph)

    I'm guessing it's done with css but I haven't come across it in any tutorials. Anyone know?

    Thanks
    <p align=justify>
    Death --the last sleep? No, it is the final awakening.

    TinyPlanet.org
    Discuss and Debate World Events, Politics and Religion

  4. #4
    SitePoint Guru coiL's Avatar
    Join Date
    Sep 2001
    Location
    QLD, Australia
    Posts
    666
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    thanks for that
    I have seen justify mentioned but I never got what it was for, now i do.

    btw is that compatable with all browsers?
    coiL
    "cradled in the learning curve"

  5. #5
    SitePoint Guru moonman's Avatar
    Join Date
    Dec 2000
    Location
    The Sea of Tranquility
    Posts
    696
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Yeah, justify is compatible with all browsers. Well all the browsers I have anyway (that's IE 6 and NS 6.2). It's just a style, so I should imaging it works with the older browsers too.

  6. #6
    SitePoint Wizard
    Join Date
    Oct 2001
    Location
    Tucson, Arizona
    Posts
    1,858
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    You should really use this in favor of using the align attribute, however.
    Code:
    p.this { text-align: justify; }

  7. #7
    SitePoint Wizard creole's Avatar
    Join Date
    Oct 2000
    Location
    Nashvegas Baby!
    Posts
    7,845
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Justify is a carry-over from newspapers. It's what papers use to get the text to fit completely in a news column.
    Adobe Certified Coldfusion MX 7 Developer
    Adobe Certified Advanced Coldfusion MX Developer
    My Blog (new) | My Family | My Freelance | My Recipes

  8. #8
    SitePoint Guru coiL's Avatar
    Join Date
    Sep 2001
    Location
    QLD, Australia
    Posts
    666
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    thanks for the replies everyone
    Text looks a lot better now.
    coiL
    "cradled in the learning curve"

  9. #9
    Currently Occupied; Till Sunda Andrew-J2000's Avatar
    Join Date
    Aug 2001
    Location
    London
    Posts
    2,475
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    <p align="justify">should be this instead</p>

  10. #10
    SitePoint Wizard
    Join Date
    Oct 2001
    Location
    Tucson, Arizona
    Posts
    1,858
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Originally posted by Andrew-J2000
    <p align="justify">should be this instead</p>
    No, it should be what I said above.

  11. #11
    SitePoint Enthusiast
    Join Date
    Dec 2001
    Location
    USA
    Posts
    50
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Yeah, what he said.

  12. #12
    Currently Occupied; Till Sunda Andrew-J2000's Avatar
    Join Date
    Aug 2001
    Location
    London
    Posts
    2,475
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    thats if your using css, which is the correct way to do it then yes your right, but what Indian put was incorrect as the was no quotes around the align.

  13. #13
    SitePoint Member FunkyDish's Avatar
    Join Date
    Mar 2002
    Location
    Sydney, Australia
    Posts
    19
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    or u could use <div align="justify">blahblah</div>
    "<insert quote here>"
    :: email :: pm ::

  14. #14
    Currently Occupied; Till Sunda Andrew-J2000's Avatar
    Join Date
    Aug 2001
    Location
    London
    Posts
    2,475
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    or layer/ilayer/../././././etc

    used for loads of things

  15. #15
    The Legend Indian's Avatar
    Join Date
    Nov 2001
    Location
    Gods' Own Country
    Posts
    890
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Originally posted by Andrew-J2000
    but what Indian put was incorrect as the was no quotes around the align.
    yeah, I am lazy
    Death --the last sleep? No, it is the final awakening.

    TinyPlanet.org
    Discuss and Debate World Events, Politics and Religion

  16. #16
    Currently Occupied; Till Sunda Andrew-J2000's Avatar
    Join Date
    Aug 2001
    Location
    London
    Posts
    2,475
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    hehe aint we all.

  17. #17
    Robert Wellock silver trophybronze trophy xhtmlcoder's Avatar
    Join Date
    Apr 2002
    Location
    A Maze of Twisty Little Passages
    Posts
    6,316
    Mentioned
    60 Post(s)
    Tagged
    0 Thread(s)
    For the older browsers you could try the following, so that if they couldn't interpret CSS then they would skip the code.

    <style type="text/css">
    <!--
    p{ text-align : justify; }
    -->
    </style>

    Or, alternatively you would link to an external style sheet, with a *.css extension, e.g. <link rel="stylesheet" href="somefile.css" type="text/css" /> and within the text file;

    p{
    text-align : justify;
    }

    The inline example has been covered already, similar to:

    <p style="text-align:justify;">Hello</p>

    I think now most of the three major angles have been covered for justify of a <p> element using CSS.

    };-) http://www.xhtmlcoder.com/
    Last edited by xhtmlcoder; Apr 24, 2002 at 05:17.


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •