?
Solved

Justified Text

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

Thanks,
-Caudax
0
Comment
Question by:Caudax
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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
7 Extremely Useful Linux Commands for Beginners

Just getting started with Linux? Here's a quick start guide that has 7 commands that we believe will come in handy.

 
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

WordPress Tutorial 4: Recommended Plugins

Now that you have WordPress installed, understand the interface, and know how to install new parts, let’s take a look at our recommended plugins.

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…
I found this questions asking how to do this in many different forums, so I will describe here how to implement a solution using PHP and AJAX. The logical flow for the problem should be: Write an event handler for the first drop down box to get …
Viewers will learn about the regular for loop in Java and how to use it. Definition: Break the for loop down into 3 parts: Syntax when using for loops: Example using a for loop:
The viewer will learn how to dynamically set the form action using jQuery.
Suggested Courses

801 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