You are here: Re: 2 text alignment on the same line « HTML « IT news, forums, messages
Re: 2 text alignment on the same line

Posted by Neredbojias on 08/17/06 04:55

To further the education of mankind, "Andy Dingley"
<dingbat@codesmiths.com> vouchsafed: To further the education of
mankind, "Andy Dingley" <dingbat@codesmiths.com> vouchsafed:

>> > I try below, but it does not work. It has 'left text' and 'right
>> > text' next to each other:
>> > <span style="color:purple" align="left">left text</span><span
>> > style="color:green" align="right">right text</span> <br/>
>> >
>> > And I try not to use Table or css float to achieve that.
>>
>> Must use float or absolute positioning.
>
> "Float" doesn't itself control text alignment, and it would be
> misleading to imply so.
>
> Inline elements won't render the CSS text-align property
> http://www.w3.org/TR/CSS21/text.html#alignment-prop
>
> To make them do so, you have to change their display property, so that
> their internal content is rendered as a block. There are two ways to
> do this.
>
> Ideally we'd set "display: inline-block;" which does just what we
> want. Unfortunately browser support is unusably low for this as yet.
>
> So instead we have to use "display: block;" instead. This works fine,
> except that it sets the "outside" behaviour of the element to be block
> as well -- we have to counteract that by adding the floats.

Can you not just use divs instead of spans and float them?

>> Also, this:
>> <span style="color:purple" align="left">
>> is invalid. Should be:
>> <span style="background:inherit;color:purple;text-align:left;">...
>
> Why is that invalid ? It's _obsolete_ perhaps, but it's not invalid.
> Invalid has a definite technical meaning, and this isn't it.

Technically speaking, perhaps invalid !== obsolete but still invalid =
obsolete. I suppose the definitive guage would be the w3c validator
which I haven't tried because I do consider obsolete things to be no
longer valid.

> Also what useful purpose does setting background-color: inherit; have,
> other than to turn off a validator warning message ?

Exactly that. It's a sop to the w3c pragma and strict adherence to some
questionable definition of "validated" in the purest form.

--
Neredbojias
Infinity has its limits.

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация