Forum Moderators: open

Message Too Old, No Replies

<span> within <span>

is that okay?

         

eveningwalk

8:25 pm on Sep 19, 2005 (gmt 0)

10+ Year Member



Is it okay to have <span> within <span>, like

<span>
...some text
<span>...</span>
...more text
</span>

Thanks,
ew

moltar

8:32 pm on Sep 19, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Yes it is.

g1smd

10:46 am on Sep 21, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



I avoid div and span as much as possible, prefering instead to build pages out of the native logical blocks: headings, paragraphs, lists, tables and forms.

moltar

3:19 pm on Sep 21, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



You shouldn't avoid them. They are useful for logical content separation. I know many overuse them, but they are good if used correctly. I usually do basic structure like this:

<div id="container"> 
<div id="header" />
<div id="content" />
<div id="nav" />
<div id="footer" />
</div>

I don't see anything wrong here at all. It's very logical and helps with styling later on.

I rarely use spans, but there is use for them too. For example, I want to style all numbers on the page differently. Or sometimes a certain word/phrase needs to be visually emphasised, but has not semantic emphasis, best way to do that is to use span.