Quote:
Originally Posted by slowsmile
Just to be absolutely clear. When I say "empty span tags" I mean span tags that have nothing inside them -- no classes, style or any other attributes. Example below:
Code:
<h1 class="heading"><span>CHAPTER 1</span></h1>
Whereas "a naked span tag" I think refers to a span tag containing perhaps some text on it's own line in the html that is not surrounded by any other html tags. That's my understanding of "naked spans" anyway. As well, "naked spans" surrounding text or whatever can also contain classes, style and other attributes.
Generally, as a rule, I always try and avoid using both "empty span tags" and "naked span tags" in my own epubs. In most instances, empty spans serve no earthly purpose and naked spans alone on there own line(not surrounded by <div> tags) will always give you an error whenever you run FlightCrew or Epubcheck.
|
The problem is that in your example is that the span following the h1 could be defined in the style sheet as part of a combinator selector (h1 span, h1 > span, h1 + span or h1 ~ span). So an empty span may still have an effect on the text.
As an example, in the ebook I was having fun with, this was in the stylesheet:
Code:
h1 + span {
font-size: 1.5rem;
}
Now a piece of code that shows:
Code:
<span><span>
or
<span class="whatever"></span>
can be safely dumped.