Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
?
Solved

Justified Text

Posted on 2003-02-24
9
Medium Priority
?
306 Views
Last Modified: 2010-04-06
How do you justify text?

Thanks,
-Caudax
0
Comment
Question by:Caudax
9 Comments
 
LVL 53

Accepted Solution

by:
COBOLdinosaur earned 80 total points
ID: 8012944
<p style="text-align:justify">
Text in this paragraph will be justified except in browsers that do not implement the stadards correctly in which case it will porbably be left justified.
<p>

Cd&
0
 
LVL 2

Expert Comment

by:colje
ID: 8013813
You can do it in a paragraph tag like this :-
<p align="right">Test</p>

or in a DIV tag like this :-
<div align = "right">Test</div>

If you wish to use styles like the example from COBOLdinosaur you could use a style sheet (css file) so that the style is applied to all paragraphs / headings / table rows etc.
0
 
LVL 2

Expert Comment

by:j79zlr
ID: 8014249
OK, I agree with coljie but he didn't say
<p align="justify">your text here</p>
"left" "right" "center" do what you think, this is for HTML anyway
0
Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

 
LVL 1

Expert Comment

by:pk_mkhalid
ID: 8015731
if you need to justify text then there is only one option that you should use paragraph tag.
like
<p align="justify">Text </p>
0
 
LVL 53

Expert Comment

by:COBOLdinosaur
ID: 8017731
colje, j79zlr, and pk_mkhalid:

May I ask why you would suggest using a property (align) that has been depreciated in the standards, and is slated to be made obsolete; and therefore no longer supported?  Why would any professional developer create pages that may break because a new version of a browser no longer reconizes legacy code?

Cd&
0
 
LVL 4

Expert Comment

by:monolith_888
ID: 8018501
The proper way to justify text would be to use the 'text-align' properties of CSS.  Possible values are left,right,center and justify.  Usage can be in any block level element (P, TD, DIV, etc...)

Example:

<DIV STYLE="width:50%;text:align:justify">
 text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text
</DIV>

-Blake
0
 
LVL 1

Expert Comment

by:msmales
ID: 8030926
Certain tags support the justify attribute. P and DIV are some of the supported tags. See online documentation for this especially at Microsoft's website.

For a <P> tag, use:

<P style="width:100%;text-align:justify;">blah blah do lots of these</P>

(Similar to Blake's but I can see he should use text-align instead of text:align)

You can always change the width attribute.

Martin
0
 
LVL 4

Expert Comment

by:monolith_888
ID: 8030957
woops!  Thanks for pointing that out Martin, I biffed.  Of course the attribute is 'text-align:xxxx'.  Sorry for the typo guys!
0
 
LVL 53

Expert Comment

by:COBOLdinosaur
ID: 8068299
Glad we could help. Thanks for the A. :^)

Cd&
0

Featured Post

Hire Technology Freelancers with Gigs

Work with freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely, and get projects done right.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Most of the sites are being standardized with W3C Web Standards. W3C provides lot of web standard services to the web. They have the web specification, process and documentation for all the web standards. You can apply HTML, CSS and Accessibility st…
It's sometimes a bit tricky to use date functions in Oracle BPEL. I'll explain quickly how you can add N days to the current date. In a BPEL process this can be useful, and you can adapt it to fit your needs. First of all, let's see how to add 1 …
HTML5 has deprecated a few of the older ways of showing media as well as offering up a new way to create games and animations. Audio, video, and canvas are just a few of the adjustments made between XHTML and HTML5. As we learned in our last micr…
Learn how to create flexible layouts using relative units in CSS.  New relative units added in CSS3 include vw(viewports width), vh(viewports height), vmin(minimum of viewports height and width), and vmax (maximum of viewports height and width).
Suggested Courses

581 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question