figure and div elements

  • This topic has 1 reply, 2 voices, and was last updated 1 year, 6 months ago by b.keith.
Viewing 2 posts - 1 through 2 (of 2 total)
figure and div elements thread
Author Posts
krollans

Me again!

I’m doing some QA on our EPUBs, and am noticing that the figures in this text are placed with <div> tags rather than <figure> tags (and, for that matter, the figure caption is set with a <p> tag rather than the <figcaption> element).

The code looks like this:

<div class=”figure” id=”f00_001″>
<div class=”imgscaler-100″>Historical photo: A bearded man with white hair standing in front of a horse and holding up a card with the letter E.</div>
<p class=”figcaption”>
<b>Figure 0.1</b> Wilhelm von Osten training his stallion, Clever Hans.
</p>
</div>

 

I’m thinking it should look like this:

<figure id=”f00_001″ class=”imgscaler-100″>Historical photo: A bearded man with white hair standing in front of a horse and holding up a card with the letter E.
<figcaption class=”figcaption”>
<b>Figure 0.1</b> Wilhelm von Osten training his stallion, Clever Hans.
</figcaption>
</figure>

When I do this, though (or even when I wrap the whole shebang in <figure> tags), the figure no longer scales properly. Clearly, writing the code this way doesn’t jive with the CSS somehow.

So my questions are: is it okay to use <div> for figures, as in the first example above? And if not, what do I need to tell my conversion house to sort it out?

b.keith

What’s the css for imgscaler-100? Because there is no reason that a figure won’t work instead of a div. Note the first example has nested div’s so that might also be causing something different to happen because you eliminated the figure class…

Viewing 2 posts - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.

Want to join the discussion?

a wooden table with a white keyboard on top, and a persons hand writing on a piece of paper

View our current resources