By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
460,028 Members | 1,072 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 460,028 IT Pros & Developers. It's quick & easy.

block element inside inline element

P: n/a
Hi.
The code of my page is generated by script. However the code is the
following (I write it manually, sorry if there are some errors):
<span class="question">
<span class="number">1</span>
<span class="content"> Here can stay span with text childNode, image,
animation,etc..</span>
</span>

The question span is display block.
I want the number and the firstchild of the content in the same line.
The best thing to do is set the display:block property of the content
span and also the position:relative and use top and left property to
align the block of content with the number.(all the content is
display:block)
But in this way I have some problems whit the application so it don't
work (the cause is position:relative).
So, I have try whit number and content display:inline, the firstChild
of the content also display:inline, and the rest of the content
display:block.
In this way I have block elements (the second, third,... child of the
content span) inside a inline element (the content span).
It should work only on mozilla(1.6 or later) and firefox.
The xhtml is valid or not?
It is correct?
Thanks

Jan 21 '06 #1
Share this Question
Share on Google+
5 Replies


P: n/a
st**********@tiscali.it wrote:
The code of my page is generated by script. However the code is the
following (I write it manually, sorry if there are some errors):
<span class="question">
<span class="number">1</span>
<span class="content"> Here can stay span with text childNode, image,
animation,etc..</span>
</span>

The question span is display block.
I want the number and the firstchild of the content in the same line.


That seems to be a list, right? So why don't you use an ordered list (ol
with li) in HTML?

--
Johannes Koch
Spem in alium nunquam habui praeter in te, Deus Israel.
(Thomas Tallis, 40-part motet)
Jan 21 '06 #2

P: n/a
st**********@tiscali.it wrote:
Hi.
The code of my page is generated by script. However the code is the
following (I write it manually, sorry if there are some errors):
<span class="question">
<span class="number">1</span>
<span class="content"> Here can stay span with text childNode, image,
animation,etc..</span>
</span>

The question span is display block.

It does not matter. The above is valid HTML. That you have changed the
*presentation* to a block is irrelevant.

--
jmm (hyphen) list (at) sohnen-moe (dot) com
(Remove .AXSPAMGN for email)
Jan 21 '06 #3

P: n/a
Jim Moe wrote:
st**********@tiscali.it wrote:

<span class="question">
<span class="number">1</span>
<span class="content"> Here can stay span with text childNode, image,
animation,etc..</span>
</span>

The above is valid HTML.

^^^^^

I think that's debatable. Span soup isn't valid in my book. ;)

"question" looks like it should be a block element, anyway, so span is
definitely the wrong element for the job.

--
Reply email address is a bottomless spam bucket.
Please reply to the group so everyone can share.
Jan 22 '06 #4

P: n/a
On Sat, 21 Jan 2006 19:43:02 -0600, kchayka <us****@c-net.us> wrote:
The above is valid HTML.
I think that's debatable. Span soup isn't valid in my book. ;)


It's not at all debatable. "Valid" has a formal meaning and this
fragment (on a suitable page) meets it. It might not be "good practice",
you might not like it, but it's still valid.

<blockquote><blockquote>
Foo
</blockquote></blockquote>

is also perfectly valid, even when it's only being used to mean "double
indent". Not goo, maybe - but still formally valid.

"question" looks like it should be a block element, anyway,


I'd probably agree.

Personally I have no problem with "span soup". It's a few characters
more, but it's not harmful. It also has many valid uses, particularly in
a Semantic Web sense.
Jan 22 '06 #5

P: n/a
On 2006-01-21, st**********@tiscali.it <st**********@tiscali.it> wrote:
Hi.
The code of my page is generated by script. However the code is the
following (I write it manually, sorry if there are some errors):
<span class="question">
<span class="number">1</span>
<span class="content"> Here can stay span with text childNode, image,
animation,etc..</span>
</span>
why not use <ol> instead?
The question span is display block.


why not use a block element like <p> <div> or (gasp!) <li> ?

If you match the HTML to the semantics of the content, the styles often
become easier.

--

Bye.
Jasen
Jan 22 '06 #6

This discussion thread is closed

Replies have been disabled for this discussion.