Comments on: Hello, summary and figcaption elements https://stevefaulkner.github.io/html5doctored/summary-figcaption-element/ helping you implement HTML5 today Fri, 01 Jul 2016 15:47:51 +0000 hourly 1 By: Alex Bondarev https://stevefaulkner.github.io/html5doctored/summary-figcaption-element/#comment-149360 Thu, 24 Jul 2014 07:57:46 +0000 http://html5doctor.com/?p=1343#comment-149360 Wow, it all started at least four years ago that everybody was talking about hiding/showing content. Feel like I’ve been living in a cave and wish I had read this article earlier :)

I thought about it as well, only I tried incorporating the existing elements for such tasks. The final variant that I had was to use <dl>, <dt> and <dd> to markup the widget, summary and additional (hidden) info respectively. Although to get some more functionality I decided to use the <a> tag as well. Using a combination of the html tabindex attribute (to aid keyboard navigation) and some JS (like opening, preventing the hash change (if unneeded) and other things) we can get the same result. It is described in more details (pun) in my article on anchor tags versus buttons. There I take an interactive FAQ section (a simple accordion) as an example which resulted in this code.

<dl>
<dt><a href="#answer1" tabindex="1">Question 1</a></dt>
<dd id="answer1">Answer 1</dd>
<dt><a href="#answer2" tabindex="1">Question 2</a></dt>
<dd id="answer2">Answer 2</dd>
<dt><a href="#answer3" tabindex="1">Question 3</a></dt>
<dd id="answer3">Answer 3</dd>
</dl>

Please feel free to give a comment whether it’s OK either here or in a comment to my blog post.

]]>
By: [分享]The details and summary elements « NeverBest!我还能做的更好 – 007boy | im007boy https://stevefaulkner.github.io/html5doctored/summary-figcaption-element/#comment-17166 Sun, 14 Aug 2011 09:08:33 +0000 http://html5doctor.com/?p=1343#comment-17166 […] Hello, summary and figcaption elements […]

]]>
By: Bruce Lawson https://stevefaulkner.github.io/html5doctored/summary-figcaption-element/#comment-10034 Tue, 03 Aug 2010 17:26:05 +0000 http://html5doctor.com/?p=1343#comment-10034 Anon- it depends on the implementation. Nothing like this is required or forbidden by the specification.

]]>
By: anon https://stevefaulkner.github.io/html5doctored/summary-figcaption-element/#comment-10032 Tue, 03 Aug 2010 17:08:46 +0000 http://html5doctor.com/?p=1343#comment-10032 Will the implementation include an automatic scroll down when the content is not visible in the viewport (only if the summary+details max height < viewport height)?

]]>
By: Adam Boarman's dot com » Blog Archive » The figure & figcaption elements https://stevefaulkner.github.io/html5doctored/summary-figcaption-element/#comment-5655 Thu, 24 Jun 2010 08:14:13 +0000 http://html5doctor.com/?p=1343#comment-5655 […] readers will know that a new element was recently introduced, namely <figcaption>. Who knows if it’ll stick, but for now here’s what the spec […]

]]>
By: New HTML5 elements: summary & figcaption - Gurushala https://stevefaulkner.github.io/html5doctored/summary-figcaption-element/#comment-2329 Sun, 28 Feb 2010 00:29:33 +0000 http://html5doctor.com/?p=1343#comment-2329 […] two new HTML elements: summary and figcaption were added to HTML5 project. The creation of these new elements to the […]

]]>
By: Alohci https://stevefaulkner.github.io/html5doctored/summary-figcaption-element/#comment-2317 Thu, 25 Feb 2010 00:43:32 +0000 http://html5doctor.com/?p=1343#comment-2317 @fjpoblam – The figcaption needs to be a direct child of figure. You can put the <a> tags outside the <figure> tags to achieve what you’re trying to do in a valid way.

]]>
By: fjpoblam https://stevefaulkner.github.io/html5doctored/summary-figcaption-element/#comment-2312 Wed, 24 Feb 2010 16:12:38 +0000 http://html5doctor.com/?p=1343#comment-2312 Probably, I misunderstand the intent of <figure> and should be using <section> instead, as I see the W3 validator rejects what I’m trying:

<figure>
<a href=”http://[…rest of URL…]”>
<img […stuff…] >
<figcaption>
[text]
</figcaption>
</a>
</figure>

The W3 validator wants an <a> for the <img> and a separate <a> inside the <figcaption>.

]]>
By: bractus https://stevefaulkner.github.io/html5doctored/summary-figcaption-element/#comment-2276 Thu, 18 Feb 2010 17:33:35 +0000 http://html5doctor.com/?p=1343#comment-2276 Hi Bruce

Do you have any document shows logic order of html5 tags? I mean shows what is the best practice using tags within each other.
For example, I saw a developer is using <section first and then <article but others use vice versa.

]]>
By: Bruce Lawson https://stevefaulkner.github.io/html5doctored/summary-figcaption-element/#comment-2218 Mon, 08 Feb 2010 09:34:06 +0000 http://html5doctor.com/?p=1343#comment-2218 JoshS

my reading is same as yours. But I think that they way details is currently specified is enough for the 80% of authorial needs.

]]>