Re: Span element nests unnecessarily

Your original code is wrong - it should be a div if you want to wrap it
around block elements. And then it would work in Amaya as is. Amaya is
correcting the code to make it valid.

The CSS won't work because text-align doesn't make sense for an inline
element like span.

The best way to do this in Amaya would be to select the two elements, (select
a bit of each then press f2/Esc - windows/Linux&Mac variation) then from the
XHTML menu of via the shortcut, make a div (I think it's normally ctrl-h
ctrl-v but I use a personalised set of shortcuts so check it in the menu).

Cheers

Chaals

On Mon, 30 Aug 2004, Leon Stringer 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>
>
>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>
>
>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...
>
>
>

Charles McCathieNevile  http://www.w3.org/People/Charles  tel: +61 409 134 136
SWAD-E http://www.w3.org/2001/sw/Europe         fax(france): +33 4 92 38 78 22
 Post:   21 Mitchell street, FOOTSCRAY Vic 3011, Australia    or
 W3C, 2004 Route des Lucioles, 06902 Sophia Antipolis Cedex, France

Received on Monday, 30 August 2004 15:26:28 UTC