Back
Syntax
Study
Editor
Mode:
HTML
CSS
JavaScript
PHP
Reset
Run »
HTML / CSS / JS
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <title>Figure and Figcaption</title> <style> figure { margin: 0; display: inline-block; text-align: center; border: 1px solid #ddd; padding: 8px; border-radius: 4px; } figcaption { margin-top: 6px; font-size: 0.875rem; color: #555; font-style: italic; } </style> </head> <body> <figure> <img src="grand-canyon.jpg" alt="Aerial view of the Grand Canyon at sunset" width="600" height="400"> <figcaption> Fig. 1 — The Grand Canyon, Arizona, USA. Photographed at sunset from the South Rim. </figcaption> </figure> <figure> <pre><code>const sum = (a, b) => a + b;</code></pre> <figcaption>Listing 1 — Arrow function for addition.</figcaption> </figure> </body> </html>
Result
Open