From: Marious Barrier on
On 06/15/2010 10:05 AM, coltrane wrote:
> is there a way to have text centered and justified?

Justified always takes the whole width, so it would be the same as
centered I guess.

What you try to do is to center a block of justified text?
if so... just give the block a width and auto for left and right margins.
From: Thomas 'PointedEars' Lahn on
coltrane wrote:

> [...] how can I specify both center and justify text?

Assuming you mean *horizontal* centering: Use `width' to restrict the block
that contains the text, `margin: … auto;' to center it in the greater
context, and `text-align: justify' to justify the inline content (e.g.,
text) contained in that restricted block.


PointedEars
--
Use any version of Microsoft Frontpage to create your site.
(This won't prevent people from viewing your source, but no one
will want to steal it.)
-- from <http://www.vortex-webdesign.com/help/hidesource.htm> (404-comp.)
From: coltrane on
On 6/15/2010 10:27 AM, Marious Barrier wrote:
> On 06/15/2010 10:05 AM, coltrane wrote:
>> is there a way to have text centered and justified?
>
> Justified always takes the whole width, so it would be the same as
> centered I guess.
>
> What you try to do is to center a block of justified text?
> if so... just give the block a width and auto for left and right margins.
ah, I found my problem, I was specifing width, i.e.
p
{
text-align:justify;
width:100px;
}
This was causing the text to be left justified.
margin is what I should have been using.

thanks for the help

john
From: David Stone on
In article <4c17888e$0$22507$607ed4bc(a)cv.net>,
coltrane <tendengarci(a)yahoo.com> wrote:

> is there a way to have text centered and justified?

Centre-aligned, yes. For example:

p { text-align: center }

Not sure what you mean by "and justified", though. I would understand
that to mean "adjusted to align both left and right", which makes
centring moot... You can align left, centre, or right but AFAIK
you cannot specify justified text using CSS.
From: coltrane on
On 6/15/2010 11:05 AM, David Stone wrote:
> In article<4c17888e$0$22507$607ed4bc(a)cv.net>,
> coltrane<tendengarci(a)yahoo.com> wrote:
>
>> is there a way to have text centered and justified?
>
> Centre-aligned, yes. For example:
>
> p { text-align: center }
>
> Not sure what you mean by "and justified", though. I would understand
> that to mean "adjusted to align both left and right", which makes
> centring moot... You can align left, centre, or right but AFAIK
> you cannot specify justified text using CSS.
you can get justified text by specifying
p{text-align:justify;}
this results in text where the lines are set to be the same length.
According to the book I have I should be able to justify the text and
specify the width with the following
p{text-align:justify;width:500px;}
According to my book this should set the width, justify the text and
center the text. What I get is justified text set at the correct width
but the text is set against the left side. The book shows the text set
to the correct width but centered in the page.