SPAN is a GENERIC inline container. It does not matter whether an a is inside span or span is inside a as both are inline elements.
Nesting span tags is valid HTML. A span tag is non-semantic markup intended for grouping inline content, and is a valid wrapper for phrasing content. This includes tags like strong , em , time , and etc, but also additional span tags.
Yes, it is valid to have a <span> tag as the content of an <i> tag.
The span element is an inline element, which should contain only other inline elements and no block elements. From the spec: Generally, block-level elements may contain inline elements and other block-level elements. Generally, inline elements may contain only data and other inline elements.
HTML4 specification states that:
Inline elements may contain only data and other inline elements
Span is an inline element, therefore having span inside span is valid. There's a related question: Can <span> tags have any type of tags inside them? which makes it completely clear.
HTML5 specification (including the most current draft of HTML 5.3 dated November 16, 2017) changes terminology, but it's still perfectly valid to place span inside another span.
Yes. You can have a span
within a span
. Your problem stems from something else.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With