When To Use Figure and Figcaption HTML Elements In Divi 5

by | Feb 12, 2026 | Etcetera | 0 comments

Maximum pictures to your web page want not anything greater than what Divi already does. Upload an Symbol Module, taste it, and also you’re achieved. However there are occasions when you need to crew a picture with a caption in some way that your HTML explicitly defines as a unmarried unit.

That’s the place determine and figcaption are available. Those HTML parts create a integrated semantic courting that undeniable image-plus-text layouts regularly don’t specific as obviously. The query isn’t whether or not they’re higher, it’s once they’re price the use of. Divi 5 makes including those HTML wrappers simple when your content material wishes that additional construction. Right here’s the right way to come to a decision.

Working out The Determine And Figcaption Components

Each parts come from HTML5 and paintings in combination to mark up content material that advantages from a visual caption. Ahead of you’ll come to a decision when to make use of them, you wish to have to understand what every one in truth does and the way they have interaction with browsers and assistive generation. Let’s ruin down every component one by one, then take a look at why their courting issues:

What Is The Determine Component

The determine component wraps content material that may stand by itself as a self-contained reference. Photographs, diagrams, code blocks, or charts all are compatible this objective. You’ll be able to regularly transfer this content material in different places to your web page with out breaking the waft of your major textual content.

A visual representation of using the figure tag for an image

Browsers disclose a determine as a grouped piece of content material within the accessibility tree, and a figcaption is semantically tied to it. Serps can use surrounding textual content, together with captions, to raised interpret what a picture is set. The use of determine and figcaption makes that courting specific on your markup.

Figures too can wrap movies, audio clips, code samples, and information visualizations. The content material kind doesn’t topic. What issues is whether or not that content material purposes as a self-contained reference that helps your major textual content with out being a part of the studying waft.

What Is The Figcaption Component

The figcaption component provides a visual caption for your determine. Position it as both the primary or ultimate kid within the determine, and browsers will deal with it because the caption (or legend) related to that determine.

A visual representation of using the figcaption wrapper to add captions for an image

This isn’t simply textual content floating close to a picture. Figcaption creates a programmatic hyperlink between the caption and the determine. Many assistive applied sciences will disclose the caption in some way that makes the affiliation transparent, however the precise announcement relies on the browser and display screen reader. When any person the use of assistive generation encounters your determine, they’ll listen the picture’s alt textual content and the caption content material in collection, with the markup indicating that the caption belongs to the determine.

You’ll be able to best use one figcaption consistent with determine. If you happen to upload more than one, browsers will best acknowledge the primary one as the real caption. The remaining simply turns into common textual content. Place issues lower than you’d suppose. Whether or not you set the caption above or underneath your content material, the semantic connection remains intact.

See also  Notion AI: A Full Review & Guide (2023)

The component can include different HTML inside of it as smartly. Hyperlinks, emphasis tags, or inline code all paintings positive inside of a figcaption. Simply stay it related to describing or crediting the determine content material. That centered objective makes the caption helpful for each other folks and machines looking to perceive your content material.

How They Paintings In combination And Why They Subject

Whilst you mix determine and figcaption, you create a semantic bundle that serves other wishes directly. Alt textual content describes the picture itself for display screen readers and serps. The figcaption provides context or attribution that each sighted customers and assistive generation can get admission to. They paintings in tandem, no longer as replacements for every different.

Serps parse this courting another way than they’d free textual content close to a picture. They know the caption describes the determine content material, which is helping them perceive the subject and relevance of your web page. That construction can lend a hand with interpretation and indexing, particularly when captions upload transparent context.

Opting for When To Use Determine Components

You’ve discovered what those parts do. Now comes the more difficult phase: deciding once they’re in truth definitely worth the effort. No longer each and every picture wishes this remedy, and overusing semantic markup will also be simply as problematic as ignoring it. This segment walks via the important thing determination issues:

Determine vs Div With An Symbol

Each approaches can show a picture along textual content. The adaptation lies in what that markup communicates to browsers and assistive tech. Right here’s a snappy desk that can assist you perceive the diversities:

Side Div With Symbol Determine With Symbol
Semantic that means None Self contained content material
Caption strengthen Handbook textual content placement In-built figcaption component
Accessibility No courting introduced Introduced as hooked up unit
search engine marketing worth Symbol and textual content listed one by one Caption listed with picture context

Right here’s a snappy rundown of when to make use of what:

Use Determine When Use Div When
Content material wishes a visual caption Symbol is solely ornamental
Content material references one thing on your textual content Symbol is a part of web page structure
You might want to transfer it with out breaking studying waft Disposing of it might ruin web page construction
Display screen readers must announce it as a unit No semantic courting issues

When No longer To Use Determine

No longer each and every picture merits semantic markup. Many pictures to your web page function ornament, branding, or structure parts. Those don’t reference your content material, so wrapping them in determine tags simply provides noise.

Ornamental pictures fall into this class. Icons, background patterns, and decorative graphics exist purely for visible design. Use CSS backgrounds for purely ornamental visuals, or use a picture with an empty alt characteristic when it’s purely presentational. Trademarks on your header or navigation paintings the similar method. They’re branding parts that shape a part of your web page construction, no longer content material references. Hero pictures and banner graphics strengthen your structure somewhat than explaining your textual content.

Button icons, thumbnail grids, and UI controls serve practical functions. They lend a hand customers navigate or engage along with your web page. Including determine markup to those parts confuses their exact function.

Right here’s A Fast Take a look at…

The best way to come to a decision is to accomplish two easy tests. First, take away the picture mentally. Your content material must nonetheless make entire sense while not having to give an explanation for what was once lacking. A product photograph in an ecommerce grid passes this take a look at. A chart appearing your gross sales knowledge fails it.

See also  SE Ranking Review: Feature-Rich & Affordable? (2024)

2nd, check out relocating the picture. Determine content material must be transportable. Transferring it to another spot at the web page shouldn’t ruin your structure or interrupt the studying waft. Photographs that should keep in a single precise spot to make sense aren’t actually self-contained.

For instance, profile pictures in writer bio sections hardly want determine markup. Screenshots in tutorials regularly take pleasure in it, particularly when a caption provides context.

A visual example of images that should and shouldn't use figure

When To Use Figcaption

You don’t want a figcaption each and every time you upload a determine wrapper. The component turns into helpful in 3 explicit eventualities the place visual textual content is helping customers perceive your content material higher.

Use figcaption when:

  • Attribution issues. Charts sourced from analysis papers, pictures from different websites, or graphics with licensing necessities all want right kind credit score. The caption offers you a blank position to quote your supply the place everybody can see it.
  • Photographs want context past alt textual content. Information visualizations, technical diagrams, or ancient pictures regularly include main points that each sighted customers and display screen reader customers want defined. A map appearing election effects works higher with a caption noting the yr and explicit race.
  • The determine wishes a label that clarifies what the reader is taking a look at, such because the yr of a map, the dataset at the back of a chart, or the segment proven in an architectural diagram.

Skip figcaption when:

  • Your picture already explains itself. Product pictures in a grid, icons subsequent to function descriptions, or screenshots that fit the encircling textual content don’t achieve anything else from visual captions. Alt textual content nonetheless issues for accessibility in those circumstances, and the encircling textual content regularly supplies sufficient context with no visual caption.

The caption exists to serve readers. If including one appears like busywork or simply repeats what other folks can already see, depart it out.

What Content material Is going Within Figcaption

Write in undeniable language. “The Brooklyn Bridge at sundown” works positive. Keep away from overly flowery captions like “A panoramic view of the long-lasting Brooklyn Bridge bathed in golden night time gentle.”

One or two sentences in most cases do it. Anything else longer belongs on your major textual content. You’ll be able to nest hyperlinks, emphasis tags, or different HTML when wanted, like wrapping photographer credit in an anchor tag or highlighting key phrases.

Position the figcaption as both the primary or ultimate kid inside of your determine component. Each positions paintings the similar method for browsers and display screen readers.

The use of Determine And Figcaption In Divi 5 The use of Semantic HTML

You employ the Visible Builder to construct your web pages, however including semantic HTML for your parts manner opting for between a visible workflow and right kind markup. You might want to construct within the Visible Builder or write semantic markup through hand, however doing each used to take additional steps.

Divi 5 adjustments that with its fresh function free up: Custom HTML Wrappers. This selection places semantic keep watch over without delay within the Visible Builder, the place you already paintings. With out enhancing theme information, writing customized code, disrupting your structure, or leaping between interfaces.

Each and every Divi component now contains an HTML possibility crew within the Complicated tab. The Component Kind dropdown comprises the tags you wish to have for right kind semantic construction:

  • div (default wrapper)
  • determine (for self-contained content material)
  • segment (for thematic grouping)
  • article (for unbiased content material)
  • apart (for tangential content material)

And extra.

Plus, underneath the Component Kind, there are two fields referred to as HTML Ahead of and HTML After. Those can help you inject customized markup round any module with out touching your theme information.

See also  10 Very best WordPress PayPal Plugins for Simply Accepting Bills

A screenshot of HTML before and after fields in Divi 5

The Visible Builder updates in actual time as you’re employed, so you spot precisely what your semantic construction produces. This setup works for determine and figcaption parts identical to another semantic markup. Your pictures get right kind semantic wrappers whilst staying a part of your visible workflow.

Including A Determine And Figcaption Wrapper

Choose the Symbol Module you need to wrap and open its settings panel. Navigate to the Complicated tab, scroll to the HTML possibility crew, and click on the Component Kind dropdown.

Choose determine from the checklist. Your picture now sits inside of right kind semantic markup as an alternative of a generic div.

A screenshot of setting the figure tag to an image in Divi 5

Upload a Textual content or Heading Module proper underneath your picture. Divi AI can generate succinct descriptions for every picture without delay within the Textual content Modules.

A screenshot of adding a caption with a text module using Divi AI for an image in Divi 5

As soon as finalized, open its settings, head to the Complicated tab, and in finding the HTML possibility crew once more. Set its Component Kind to figcaption.

A screenshot of setting a text module as figcaption for an image in Divi 5

The 2 modules now serve as as a hooked up semantic unit that browsers and assistive generation acknowledge robotically. On the other hand, the figcaption module behaves like another Textual content or Heading Module in Divi.

Taste it with complete design keep watch over over fonts, colours, and spacing. Design Variables can help you hyperlink captions for your typography scales and emblem colours. Alternate the ones core values as soon as, and each and every caption to your web page updates robotically.

A screenshot of using dynamic variables for a figcaption styling of an image in Divi 5

Option Group Presets and Element Presets stay your captions constant with out guide copying. Practice one preset, and your entire pictures and captions inherit the similar HTML wrapper and styling.

Your markup remains blank and obtainable whilst your waft remains visible, fast, and most significantly, precisely the place you’re employed.

A Few Use Circumstances

Determine and figcaption paintings perfect when development explicit web page varieties in Divi. Listed here are some concepts:

  • About pages with staff member pictures: Headshots paired with captions that come with names, titles, or temporary credentials create right kind semantic connections between the picture and the individual’s knowledge. That’s the manner used on this submit’s instance.
  • Touchdown pages with statistics or metrics: Charts appearing buyer delight rankings, expansion percentages, or comparability knowledge get determine wrappers. The figcaption cites the supply and provides credibility for your claims.
  • Gross sales pages with product function comparisons: Facet-by-side pictures appearing other plan tiers, function units, or bundle choices get clearer when captions specify which model seems in every shot.

Those situations proportion one trait: you’re development a particular web page the place particular person pictures want visual context that serves each sighted customers and display screen readers.

Take a look at Development In Divi 5 Nowadays!

Determine and figcaption resolve actual issues when pictures want attribution or require clarification past alt textual content. They invent a semantic connection that is helping each readers and machines interpret the content material.

Divi 5 places the HTML controls the place you already make design selections. Including semantic wrappers turns into a part of web page development somewhat than a separate process that calls for customized code. Get started including semantic construction the place it issues. Obtain Divi 5 and construct obtainable websites with clearer, extra descriptive content material.

The submit When To Use Figure and Figcaption HTML Elements In Divi 5 gave the impression first on Elegant Themes Blog.

WordPress Maintenance Plans | WordPress Hosting

read more

0 Comments

Submit a Comment

DON'T LET YOUR WEBSITE GET DESTROYED BY HACKERS!

Get your FREE copy of our Cyber Security for WordPress® whitepaper.

You'll also get exclusive access to discounts that are only found at the bottom of our WP CyberSec whitepaper.

You have Successfully Subscribed!