Summarizing Your Topic Using the Summary Markup Element in HTML5 Web Pages
WEBINAR: On-demand webcast
How to Boost Database Development Productivity on Linux, Docker, and Kubernetes with Microsoft SQL Server 2017 REGISTER >
One of the new markup elements introduced in HTML5 is the summary markup element.
The HTML5 specification says…
The HTML5 specification for summary markup element http://www.w3.org/TR/html-markup/summary.html specifies that the element can be used to represent a summary, caption or legend.
It also mandates that the summary markup element must have both a starting and an ending tag.
The summary markup element can also be inside a details markup element. When inside a details markup element, the summary element is visible irrespective of whether the open attribute of the details markup element is specified or not.
Let us write a simple HTML5 web page that uses a summary markup element.
<h1>Summary markup element sample</h1>
<p>Demo showing summary markup element</p>
<summary>Summary element outside details markup element.</summary>
<summary>Another Summary markup element inside details markup element</summary>
The web page is rendered in Google Chrome as under.
In this article, we saw how simple it was to use the summary markup element in a HTML5 web page. You can download the sample code from <download link>.
About the author
Vipul Patel is a Program Manager currently working at Amazon Corporation. He has formerly worked at Microsoft in the Lync team and in the .NET team (in the Base Class libraries and the Debugging and Profiling team). He can be reached at email@example.com