Welcome to WebmasterWorld Guest from 54.211.101.8

Forum Moderators: not2easy

Justify Text

how to align text using external css file

   
5:00 pm on Apr 10, 2003 (gmt 0)

10+ Year Member



I have a external file whereby I am controlling the font and colour etc. but I want to justify my text. I thought it would be as simple as adding text-align: justify to my file but this doesn't seem to be working.

This is the complete line of code in the file that controls the font.

.font {font-family:verdana, arial, sans-serif; text-align: justify; font-size:10pt; color:#000000; }

Justify just isn't doing what it should be doing - I have tried viewing the page in several different browsers. Where am I going wrong?

Many Thanks

TP

5:13 pm on Apr 10, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Where do you apply the style?

I usually create two style one for the text and one to justify it.

I apply the txt style on the <TD> tag (in case you built your pages in tabe) and the justify text on the <P> tags.

If you are using Dreamweaver for example when you select all the text in a cell and apply a style it apply it to the <TD> and not the text itself. Try applying the style on the <P> tags.

Hope this help.

LEo

5:38 pm on Apr 10, 2003 (gmt 0)

WebmasterWorld Senior Member blobfisk is a WebmasterWorld Top Contributor of All Time 10+ Year Member



I believe that le_gber is correct, you will need to restyle a p tag to justify you text. If you don't want every single p tag to do this, apply a class to is:

p.justifiedText { text-align: justify }

Then in you html: <p class="justifiedText">

I'm not sure how well supported this is at the moment, but I'll go an do a quick test for you....

<added>
I am very pleasantly surprised, IE6, Moz1.0, Opera6, and NN4.7 all justify as requested!
</added>

6:43 pm on Apr 10, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



am very pleasantly surprised, IE6, Moz1.0, Opera6, and NN4.7 all justify as requested

Yep it work great.

leo

1:24 pm on Apr 11, 2003 (gmt 0)

10+ Year Member



Thanks for your replies - thats great and yes it worked fine but I was hoping to able to add the justify to the existing .font style.

I have already applied the font style to all the pages and was trying to avoid having to go through my 100 or so pages to apply the <p class="justifiedText"> to my html. I have used a template in dreamweaver but I can see no way of adding the style to the template. It looks as though I would have to go through each page.

2:36 pm on Apr 11, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Depends - if you want all the text on every page justified why not redefine the <P> tag style?

The all you need to do is check that all the text was enclosed in <P>'s

Leo

4:01 pm on Apr 11, 2003 (gmt 0)

10+ Year Member



Yup - that works - Thanks
 

Featured Threads

My Threads

Hot Threads This Week

Hot Threads This Month