HTML CSS examples for HTML Tag:figcaption
The figure element can optionally contain a figcaption element, which marks a caption for the figure.
The figcaption Element summary
Item | Value |
---|---|
Element | figcaption |
Element Type | N/A |
Permitted Parents | figure |
Local Attributes | None |
Contents | Flow content |
Tag Style | Start and end tag |
New in HTML5 | Yes |
Changes in HTML5 | N/A |
Style Convention
figcaption { display: block; }
Using the figure and figcaption Elements
<!DOCTYPE html> <html> <head> <title>Example</title> </head> <body> <figure> <figcaption> Listing of code </figcaption> <pre> <!--from w w w. j a v a2s. c o m--> <code> var items = ["A", "B", "C", "D"]; <br> document.writeln("I like " + items.length + " items"); </code> </pre> </figure> </body> </html>