text align does not work

Hi,

I have an html-strict-valid document. In css I declare a specific text-
align for class ".instructions" (the text alignment is "justify").
However, the text put into <div class=".instructions"> ... </div> is
not aligned in the desired way. On my Mozilla browser it is aligned to
the "right", on my Explorer browser it is aligned to "center".

Why it happens and how this problem can be solved?

Thank You!

The page is here:
http://www.showandbeshown.com
showandbeshown [ Di, 08 April 2008 02:45 ] [ ID #1938382 ]

Re: text align does not work

On 07 Apr 2008, Fro <showandbeshown [at] gmail.com> wrote:

> I have an html-strict-valid document. In css I declare a specific text-
> align for class ".instructions" (the text alignment is "justify").
> However, the text put into <div class=".instructions"> ... </div> is
> not aligned in the desired way. On my Mozilla browser it is aligned to
> the "right", on my Explorer browser it is aligned to "center".
>
> Why it happens and how this problem can be solved?
>
> Thank You!
>
> The page is here:
> http://www.showandbeshown.com

Remove the dot from <div class=".instructions">

--
Neredbojias
http://www.neredbojias.com/
Great sights and sounds
Neredbojias [ Di, 08 April 2008 02:51 ] [ ID #1938383 ]

Re: text align does not work

On Apr 7, 8:51 pm, Neredbojias <me [at] http://www.neredbojias.com/_eml/
fliam.php> wrote:
> On 07 Apr 2008, Fro <showandbesh... [at] gmail.com> wrote:
>
> > I have an html-strict-valid document. In css I declare a specific text-
> > align for class ".instructions" (the text alignment is "justify").
> > However, the text put into <div class=".instructions"> ... </div> is
> > not aligned in the desired way. On my Mozilla browser it is aligned to
> > the "right", on my Explorer browser it is aligned to "center".
>
> > Why it happens and how this problem can be solved?
>
> > Thank You!
>
> > The page is here:
> >http://www.showandbeshown.com
>
> Remove the dot from <div class=".instructions">
>
Sorry, I put this dot only in the newsgroup message (by mistake). On
the real page I do not have dots (and it still does not work).
showandbeshown [ Di, 08 April 2008 02:57 ] [ ID #1938385 ]

Re: text align does not work

In article
<625cacea-02ce-44b2-8283-2a7ea0496b2d [at] k37g2000hsf.googlegroups.com>,
Fro <showandbeshown [at] gmail.com> wrote:

> On Apr 7, 8:51 pm, Neredbojias <me [at] http://www.neredbojias.com/_eml/
> fliam.php> wrote:
> > On 07 Apr 2008, Fro <showandbesh... [at] gmail.com> wrote:
> >
> > > I have an html-strict-valid document. In css I declare a specific text-
> > > align for class ".instructions" (the text alignment is "justify").
> > > However, the text put into <div class=".instructions"> ... </div> is
> > > not aligned in the desired way. On my Mozilla browser it is aligned to
> > > the "right", on my Explorer browser it is aligned to "center".
> >
> > > Why it happens and how this problem can be solved?
> >
> > > Thank You!
> >
> > > The page is here:
> > >http://www.showandbeshown.com
> >
> > Remove the dot from <div class=".instructions">
> >
> Sorry, I put this dot only in the newsgroup message (by mistake). On
> the real page I do not have dots (and it still does not work).


You do not exactly have any <div class="instructions"> with or without
dots. You have a lot of spans...

What exactly are you not liking the look of?

--
dorayme
dorayme [ Di, 08 April 2008 03:18 ] [ ID #1938388 ]

Re: text align does not work

On Apr 7, 9:18 pm, dorayme <doraymeRidT... [at] optusnet.com.au> wrote:
> In article
> <625cacea-02ce-44b2-8283-2a7ea0496... [at] k37g2000hsf.googlegroups.com>,
>
>
>
> Fro <showandbesh... [at] gmail.com> wrote:
> > On Apr 7, 8:51 pm, Neredbojias <me [at] http://www.neredbojias.com/_eml/
> > fliam.php> wrote:
> > > On 07 Apr 2008, Fro <showandbesh... [at] gmail.com> wrote:
>
> > > > I have an html-strict-valid document. In css I declare a specific text-
> > > > align for class ".instructions" (the text alignment is "justify").
> > > > However, the text put into <div class=".instructions"> ... </div> is
> > > > not aligned in the desired way. On my Mozilla browser it is aligned to
> > > > the "right", on my Explorer browser it is aligned to "center".
>
> > > > Why it happens and how this problem can be solved?
>
> > > > Thank You!
>
> > > > The page is here:
> > > >http://www.showandbeshown.com
>
> > > Remove the dot from <div class=".instructions">
>
> > Sorry, I put this dot only in the newsgroup message (by mistake). On
> > the real page I do not have dots (and it still does not work).
>
> You do not exactly have any <div class="instructions"> with or without
> dots. You have a lot of spans...
Yes. Sorry.

>
> What exactly are you not liking the look of?
>
In one of my browser I see text which is aligned to the right. In
another one text is centered. But I want to have the "justified" text
(i.e. text which is aligned to the right and left simultaneously).
Actually, in my css part I force this type of alignment, but it does
not work. And I do not like that.
showandbeshown [ Di, 08 April 2008 03:26 ] [ ID #1938390 ]

Re: text align does not work

In article
<1e81cdfc-cbb6-4696-af9e-e6df096e6b2b [at] m73g2000hsh.googlegroups.com>,
Fro <showandbeshown [at] gmail.com> wrote:

> On Apr 7, 9:18 pm, dorayme <doraymeRidT... [at] optusnet.com.au> wrote:
> > In article
> > <625cacea-02ce-44b2-8283-2a7ea0496... [at] k37g2000hsf.googlegroups.com>,
> >
> >
> >
> > Fro <showandbesh... [at] gmail.com> wrote:
> > > On Apr 7, 8:51 pm, Neredbojias <me [at] http://www.neredbojias.com/_eml/
> > > fliam.php> wrote:
> > > > On 07 Apr 2008, Fro <showandbesh... [at] gmail.com> wrote:
> >
> > > > > I have an html-strict-valid document. In css I declare a specific
> > > > > text-
> > > > > align for class ".instructions" (the text alignment is "justify").
> > > > > However, the text put into <div class=".instructions"> ... </div> is
> > > > > not aligned in the desired way. On my Mozilla browser it is aligned
> > > > > to
> > > > > the "right", on my Explorer browser it is aligned to "center".
> >
> > > > > Why it happens and how this problem can be solved?
> >
> > > > > Thank You!
> >
> > > > > The page is here:
> > > > >http://www.showandbeshown.com
> >
> > > > Remove the dot from <div class=".instructions">
> >
> > > Sorry, I put this dot only in the newsgroup message (by mistake). On
> > > the real page I do not have dots (and it still does not work).
> >
> > You do not exactly have any <div class="instructions"> with or without
> > dots. You have a lot of spans...
> Yes. Sorry.
>
> >
> > What exactly are you not liking the look of?
> >
> In one of my browser I see text which is aligned to the right. In
> another one text is centered. But I want to have the "justified" text
> (i.e. text which is aligned to the right and left simultaneously).
> Actually, in my css part I force this type of alignment, but it does
> not work. And I do not like that.

Your mark up is truly bad. If you are going to use tables, be simpler.
At least study this:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<title>Padding</title>
<style type="text/css">
table {width: 100%;}
td {border: 1px solid; padding: .5em;}
..services {text-align: justify; width: 20em;}
..links {text-align: right;}
</style>
</head>
<body>
<table><tr><td class="services">Here is text justified. Here is text
justified. Here is text justified. Here is text justified. Here is text
justified. Here is text justified. Here is text justified. Here is text
justified. Here is text justified. Here is text justified. Here is text
justified. Here is text justified. Here is text justified. </td><td
class="links">Here is text aligned to the right</td></tr></table>
</body>
</html>

--
dorayme
dorayme [ Di, 08 April 2008 03:59 ] [ ID #1938393 ]

Re: text align does not work

On Tue, 08 Apr 2008 00:51:12 +0000, Neredbojias writ:

> On 07 Apr 2008, Fro <showandbeshown [at] gmail.com> wrote:
>
>> I have an html-strict-valid document. In css I declare a specific text-
>> align for class ".instructions" (the text alignment is "justify").
>> However, the text put into <div class=".instructions"> ... </div> is
>> not aligned in the desired way. On my Mozilla browser it is aligned to
>> the "right", on my Explorer browser it is aligned to "center".
>>
>> Why it happens and how this problem can be solved?
>>
>> Thank You!
>>
>> The page is here:
>> http://www.showandbeshown.com
>
> Remove the dot from <div class=".instructions">
>
>
I don't see the OP, must be a Googler.

Just put that content into <p>s where it belongs anyway, and assign the
class to the <p>.

--
"Because all you of Earth are idiots!"
¯`·.¸¸.·´¯`·-> freemont© <-·´¯`·.¸¸.·´¯
freemont [ Di, 08 April 2008 04:05 ] [ ID #1938394 ]

Re: text align does not work

On 8 Apr, 03:26, Fro <showandbesh... [at] gmail.com> wrote:
> On Apr 7, 9:18 pm, dorayme <doraymeRidT... [at] optusnet.com.au> wrote:
>
> > In article
> > <625cacea-02ce-44b2-8283-2a7ea0496... [at] k37g2000hsf.googlegroups.com>,
>
> > =A0Fro <showandbesh... [at] gmail.com> wrote:
> > > On Apr 7, 8:51 pm, Neredbojias <me [at] http://www.neredbojias.com/_eml/
> > > fliam.php> wrote:
> > > > On 07 Apr 2008, Fro <showandbesh... [at] gmail.com> wrote:
>
> > > > > I have an html-strict-valid document. In css I declare a specific =
text-
> > > > > align for class ".instructions" (the text alignment is "justify").=

> > > > > However, the text put into <div class=3D".instructions"> ... </div=
> is
> > > > > not aligned in the desired way. On my Mozilla browser it is aligne=
d to
> > > > > the "right", on my Explorer browser it is aligned to "center".
>
> > > > > Why it happens and how this problem can be solved?
>
> > > > > Thank You!
>
> > > > > The page is here:
> > > > >http://www.showandbeshown.com
>
> > > > Remove the dot from <div class=3D".instructions">
>
> > > Sorry, I put this dot only in the newsgroup message (by mistake). On
> > > the real page I do not have dots (and it still does not work).
>
> > You do not exactly have any <div class=3D"instructions"> with or without=

> > dots. You have a lot of spans...
>
> Yes. Sorry.
>
>
>
> > What exactly are you not liking the look of?
>
> In one of my browser I see text which is aligned to the right. In
> another one text is centered. But I want to have the "justified" text
> (i.e. text which is aligned to the right and left simultaneously).
> Actually, in my css part I force this type of alignment, but it does
> not work. And I do not like that.

The text-align property applies to block-level elements.

http://www.w3.org/TR/REC-CSS2/text.html#propdef-text-align
royarneskar [ Di, 08 April 2008 04:06 ] [ ID #1938395 ]

Re: text align does not work

On 07 Apr 2008, Fro <showandbeshown [at] gmail.com> wrote:

>> > I have an html-strict-valid document. In css I declare a specific
>> > text- align for class ".instructions" (the text alignment is
>> > "justify"). However, the text put into <div class=".instructions">
>> > ... </div> is not aligned in the desired way. On my Mozilla browser
>> > it is aligned to the "right", on my Explorer browser it is aligned
>> > to "center".
>>
>> > Why it happens and how this problem can be solved?
>>
>> > Thank You!
>>
>> > The page is here:
>> >http://www.showandbeshown.com
>>
>> Remove the dot from <div class=".instructions">
>>
> Sorry, I put this dot only in the newsgroup message (by mistake). On
> the real page I do not have dots (and it still does not work).

Oh. Well try adding a dot.

(<grin>)

--
Neredbojias
http://www.neredbojias.com/
Great sights and sounds
Neredbojias [ Di, 08 April 2008 06:35 ] [ ID #1938400 ]

Re: text align does not work

On 8 Apr, 06:35, Neredbojias <me [at] http://www.neredbojias.com/_eml/
fliam.php> wrote:
> On 07 Apr 2008, Fro <showandbesh... [at] gmail.com> wrote:
>
>
>
> >> > I have an html-strict-valid document. In css I declare a specific
> >> > text- align for class ".instructions" (the text alignment is
> >> > "justify"). However, the text put into <div class=3D".instructions">
> >> > ... </div> is not aligned in the desired way. On my Mozilla browser
> >> > it is aligned to the "right", on my Explorer browser it is aligned
> >> > to "center".
>
> >> > Why it happens and how this problem can be solved?
>
> >> > Thank You!
>
> >> > The page is here:
> >> >http://www.showandbeshown.com
>
> >> Remove the dot from <div class=3D".instructions">
>
> > Sorry, I put this dot only in the newsgroup message (by mistake). On
> > the real page I do not have dots (and it still does not work).
>
> Oh. =A0Well try adding a dot.

Are you tired today? It seems to me that the original poster (OP)
don't know the difference between inline-level elements
and block-level elements (div is a block-level element, span is an
inline-level element ). And I can't blame it.

CSS:

"Block-level elements are those elements of the source document that
are formatted visually as blocks (e.g., paragraphs). Several values of
the 'display' property make an element block-level: 'block', 'list-
item', and 'run-in' (part of the time; see run-in boxes), and
'table'."

"Inline-level elements are those elements of the source document that
do not form new blocks of content; the content is distributed in lines
(e.g., emphasized pieces of text within a paragraph, inline images,
etc.). Several values of the 'display' property make an element
inline: 'inline', 'inline-table', 'compact' and 'run-in' (part of the
time; see compact and run-in boxes). Inline-level elements generate
inline boxes."

HTML Block-level and Inline-level:

"Certain HTML elements that may appear in BODY are said to be "block-
level" while others are "inline" (also known as "text level"). The
distinction is founded on several notions:"

HTML notions on Block-level and Inline-level:

"Content model
Generally, block-level elements may contain inline elements and other
block-level elements. Generally, inline elements may contain only
data and other inline elements. Inherent in this structural
distinction is the idea that block elements create "larger" structures
than inline elements.

Formatting
By default, block-level elements are formatted differently than
inline elements. Generally, block-level elements begin on new lines,
inline elements do not. For information about white space, line
breaks, and block formatting, please consult the section on text.

Directionality
For technical reasons involving the [UNICODE] bidirectional text
algorithm, block-level and inline elements differ in how they inherit
directionality information. For details, see the section on
inheritance of text direction."

It's okay, but where is it defined?

Block-level elements:
<http://www.w3.org/TR/xhtml1/dtds.html#dtdentry_xhtml1-
strict.dtd_Block>

Inline-level elements:
<http://www.w3.org/TR/xhtml1/dtds.html#dtdentry_xhtml1-
strict.dtd_Inline>

For similar definitions not designed to work in conjunction with XML-
based user agents:
<http://www.w3.org/TR/html401/sgml/dtd.html>
royarneskar [ Di, 08 April 2008 17:52 ] [ ID #1938425 ]

Re: text align does not work

On 04/07/08 05:45 pm, Fro wrote:
>
> I have an html-strict-valid document. In css I declare a specific text-
> align for class ".instructions" (the text alignment is "justify").
> However, the text put into <div class=".instructions"> ... </div> is
> not aligned in the desired way. On my Mozilla browser it is aligned to
> the "right", on my Explorer browser it is aligned to "center".
>
> Why it happens and how this problem can be solved?
>
<span> is an inline element, not a block element, so text alignment is
meaningless there. Use <p>s, not <span>s.

--
jmm (hyphen) list (at) sohnen-moe (dot) com
(Remove .AXSPAMGN for email)
jmm-list-gn [ Di, 08 April 2008 18:39 ] [ ID #1938428 ]

Re: text align does not work

On 08 Apr 2008, "Roy A." <royarneskar [at] gmail.com> wrote:

>> >> Remove the dot from <div class=".instructions">
>>
>> > Sorry, I put this dot only in the newsgroup message (by mistake). On
>> > the real page I do not have dots (and it still does not work).
>>
>> Oh.  Well try adding a dot.
>
> Are you tired today? It seems to me that the original poster (OP)
> don't know the difference between inline-level elements
> and block-level elements (div is a block-level element, span is an
> inline-level element ). And I can't blame it.

Hehe, yeah, I was being a little flippant. Fatigue had set in and I just
didn't feel like dealing with it. Furthermore, I had to take a dump.

Good reply (yours), though. If enough people give the right answers, can I
not remain true to my basic nature as a smartass?

--
Neredbojias
http://www.neredbojias.com/
Great sights and sounds
Neredbojias [ Mi, 09 April 2008 01:30 ] [ ID #1939182 ]
Miscellaneous » alt.html » text align does not work

Vorheriges Thema: Layout question
Nächstes Thema: iframe in div block causes problems when window size is narrowed