3 replies [Last post]
TheRaven81
TheRaven81's picture
Offline
newbie
Last seen: 7 years 14 weeks ago
Timezone: GMT-4
Joined: 2014-04-21
Posts: 2
Points: 3

I was looking at an EPUB ebook, in an editor. I was looking at it's CSS sheet, and I noticed several classes that were defined in the sheet, but contained no data, like this:

.classx{
}

(classx is not the name of the class I saw, just an example name.) Is there really any reason for someone to do this? and if there is what could it be? Because, I don't know about you, but I see no reason for a class with no data attached in the brackets to even exist in the first place. It makes no sense. But maybe you can clear that up for me.

gary.turner
gary.turner's picture
Offline
Moderator
Dallas
Last seen: 21 weeks 1 day ago
Dallas
Timezone: GMT-6
Joined: 2004-06-25
Posts: 9776
Points: 3858

A common silliness

Without knowing the context in which the example lives, we can only guess. It may be as simple as the author having forgot to remove it after deciding not to use the class.

The reverse is more often the case; nearly every container has a class, sometimes multiple classes, to provide hooks for the css should the site developer need it. This is common in generic template and theme offerings.

cheers,

gary

If your web page is as clever as you can make it, it's probably too clever for you to debug or maintain.

TheRaven81
TheRaven81's picture
Offline
newbie
Last seen: 7 years 14 weeks ago
Timezone: GMT-4
Joined: 2014-04-21
Posts: 2
Points: 3

<a class="footnoteref"

<a class="footnoteref" href="footnotes.xhtml#fn_046_dagger" id="fnr_fn_046_dagger"><sup>†</sup></a>

it's a link to another page in the book, with footnotes regarding the content. the link to that page is made by the superscripted dagger character.

gary.turner
gary.turner's picture
Offline
Moderator
Dallas
Last seen: 21 weeks 1 day ago
Dallas
Timezone: GMT-6
Joined: 2004-06-25
Posts: 9776
Points: 3858

So, back to my first guess.

So, back to my first guess. It is quite common for developers to explicitly set font size and vertical alignment for superscripted characters. My preference would be to use the selector as .footnoteref sup {...} or simply sup {...}.

I'd guess the author simply didn't use the hook and didn't delete it either.

cheers,

gary

If your web page is as clever as you can make it, it's probably too clever for you to debug or maintain.