- HTML Tutorial
- HTML - Home
- HTML - Introduction
- HTML - Editors
- HTML - Basic Tags
- HTML - Elements
- HTML - Attributes
- HTML - Headings
- HTML - Paragraphs
- HTML - Fonts
- HTML - Blocks
- HTML - Style Sheet
- HTML - Formatting
- HTML - Quotations
- HTML - Comments
- HTML - Colors
- HTML - Images
- HTML - Image Map
- HTML - Iframes
- HTML - Phrase Elements
- HTML - Meta Tags
- HTML - Classes
- HTML - IDs
- HTML - Backgrounds
- HTML Tables
- HTML - Tables
- HTML - Headers & Caption
- HTML - Table Styling
- HTML - Table Colgroup
- HTML - Nested Tables
- HTML Lists
- HTML - Lists
- HTML - Unordered Lists
- HTML - Ordered Lists
- HTML - Definition Lists
- HTML Links
- HTML - Text Links
- HTML - Image Links
- HTML - Email Links
- HTML Color Names & Values
- HTML - Color Names
- HTML - RGB
- HTML - HEX
- HTML - HSL
- HTML Forms
- HTML - Forms
- HTML - Form Attributes
- HTML - Form Control
- HTML - Input Attributes
- HTML Media
- HTML - Video Element
- HTML - Audio Element
- HTML - Embed Multimedia
- HTML Header
- HTML - Head Element
- HTML - Adding Favicon
- HTML - Javascript
- HTML Layouts
- HTML - Layouts
- HTML - Layout Elements
- HTML - Layout using CSS
- HTML - Responsiveness
- HTML - Symbols
- HTML - Emojis
- HTML - Style Guide
- HTML Graphics
- HTML - SVG
- HTML - Canvas
- HTML APIs
- HTML - Geolocation API
- HTML - Drag & Drop API
- HTML - Web Workers API
- HTML - WebSocket
- HTML - Web Storage
- HTML - Server Sent Events
- HTML Miscellaneous
- HTML - MathML
- HTML - Microdata
- HTML - IndexedDB
- HTML - Web Messaging
- HTML - Web CORS
- HTML - Web RTC
- HTML Demo
- HTML - Audio Player
- HTML - Video Player
- HTML - Web slide Desk
- HTML Tools
- HTML - Velocity Draw
- HTML - QR Code
- HTML - Modernizer
- HTML - Validation
- HTML - Color Picker
- HTML References
- HTML - Cheat Sheet
- HTML - Tags Reference
- HTML - Attributes Reference
- HTML - Events Reference
- HTML - Fonts Reference
- HTML - ASCII Codes
- ASCII Table Lookup
- HTML - Color Names
- HTML - Entities
- MIME Media Types
- HTML - URL Encoding
- Language ISO Codes
- HTML - Character Encodings
- HTML - Deprecated Tags
- HTML Resources
- HTML - Quick Guide
- HTML - Useful Resources
- HTML - Color Code Builder
- HTML - Online Editor
HTML - <figcaption> Tag
A caption for figur element can be added using the <figcaption> element. It is an optional tag that may come before or after the content included within the <figure> tag.
Despite the fact that the <figure> element itself may include numerous other elements like <img> or <code>, only one <figcaption> element may nested within a <figure> tag. The <figcaption> element is used with the <figure> element and can be positioned as either the first or last child of the <figure> element.
Syntax
<figcaption> figure caption... </figcaption>
Attribute
HTML figcaption tag supports Global and Event attributes of HTML.
Examples og HTML figcapton Tag
Bellow examples will illustrate the usage of figcapton tag. Where, when and how to use figcapton tag and how we can manupulate figcapton element using CSS.
Adding caption using figcaption tag
Following is an example where we are going to use the <figcaption> tag and add the caption to the image.
<!DOCTYPE html> <html> <body> <figure> <img src= "https://www.tutorialspoint.com/cg/images/logo.png" alt="logo" style="width:50%"> <figcaption> Tutorialspoint Logo </figcaption> </figure> </body> </html>
Styling the figcaption element
Considering another scenario where we are going to use the <figcaption> tag with CSS.
<!DOCTYPE html> <html> <style> figure { border: 4px #D5F5E3 solid; padding: 4px; margin: auto; } figcaption { background-color: #E8DAEF; color: #DE3163; font-style: italic; padding: 2px; text-align: center; } </style> <body> <figure> <img src= "https://upload.wikimedia.org/wikipedia/commons/7/70/Mahendra_Singh_Dhoni_January_2016_%28cropped%29.jpg" alt="Trulli" style="width:100%"> <figcaption>MAHENDRASINGH DHONI</figcaption> </figure> </body> </html>
Supported Browsers
Tag | |||||
---|---|---|---|---|---|
figcaption | Yes | Yes | Yes | Yes | Yes |
To Continue Learning Please Login
Login with Google