Re: [Moderator Action] Span element nests unnecessarily

On Mon, 30 Aug 2004 10:10:08 +0000
Leon Stringer <leon.stringer@ntlworld.com> wrote:

> 
> 
> Hi,
> 
> I have a heading and paragraph and I want to apply a common style. So I 
> open the source view and add a span element containing the heading and 
> paragraph:
> 
>     <span style="text-align: center">
>     <h1>Heading 1</h1>
> 
>     <p>Paragraph</p>
>     </span>

The right solution is to
 1) Select by drag from the heading to the paragraph 
     and hit the F2 key (Esc on Unix platforms) to select the whole two elements.
 2) Then select the entry menu XHTML>Division (Ctrl-h Ctlr-v)
 3) Then either select the entry menu Attributes>style and insert "text-align: center"
     or select the entry menu Style>Format, click the center align and Apply
     Both dialogs will be closed by Done.

> However, if I edit the document and then save it and re-check the 
> source, Amaya has changed this to:
> 
>     <h1><span style="text-align: center">Heading 1</span></h1>
> 
>     <p><span style="text-align: center">Paragraph</span></p>

Just because headings and paragraphs cannot be children of a span element.

> Surely this is wrong? Span is supposed to contain multiple elements; now 
> if I want to change the style I have to update every opening span tag.
> 
> (As an aside the above CSS doesn't work in Amaya).
> 
> Is this not supported or am I using Amaya incorrectly?
> 
> Thanks,
> 
> Leon...
> 
> 


     Irene.
-----
Irène Vatton                     INRIA Rhône-Alpes
INRIA                               ZIRST
e-mail: Irene.Vatton@inria.fr       655 avenue de l'Europe
Tel.: +33 4 76 61 53 61             Montbonnot
Fax:  +33 4 76 61 52 07             38334 Saint Ismier Cedex - France

Received on Monday, 30 August 2004 14:53:47 UTC