When To Use Figure and Figcaption HTML Elements In Divi 5

by | Feb 12, 2026 | Etcetera | 0 comments

Maximum pictures in 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 workforce 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 in. Those HTML parts create a integrated semantic dating that undeniable image-plus-text layouts frequently don’t specific as obviously. The query isn’t whether or not they’re higher, it’s once they’re value the usage of. Divi 5 makes including those HTML wrappers easy when your content material wishes that further construction. Right here’s how you can make a decision.

Figuring 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. Earlier than you’ll make a decision when to make use of them, you wish to have to understand what every one if truth be told does and the way they have interaction with browsers and assistive generation. Let’s damage down every component one after the other, then take a look at why their dating issues:

What Is The Determine Component

The determine component wraps content material that may stand by itself as a self-contained reference. Pictures, diagrams, code blocks, or charts all have compatibility this objective. You’ll be able to frequently transfer this content material somewhere else in your web page with out breaking the glide 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. Engines like google can use surrounding textual content, together with captions, to higher interpret what a picture is ready. The use of determine and figcaption makes that dating specific on your markup.

Figures too can wrap movies, audio clips, code samples, and knowledge visualizations. The content material sort doesn’t subject. 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 glide.

What Is The Figcaption Component

The figcaption component provides a visual caption in your determine. Position it as both the primary or final 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 actual announcement relies on the browser and display screen reader. When any individual the usage of assistive generation encounters your determine, they will pay attention 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 in keeping with determine. In the event you upload more than one, browsers will best acknowledge the primary one as the true caption. The remainder simply turns into common textual content. Place issues not up to you’d suppose. Whether or not you place the caption above or beneath your content material, the semantic connection remains intact.

See also  6 advertising takeaways from Longlegs’ marketing campaign of terror

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

How They Paintings In combination And Why They Subject

While you mix determine and figcaption, you create a semantic package deal that serves other wishes directly. Alt textual content describes the picture itself for display screen readers and search engines like google and yahoo. The figcaption provides context or attribution that each sighted customers and assistive generation can get entry to. They paintings in tandem, now not as replacements for every different.

Engines like google parse this dating otherwise 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 if truth be told definitely worth the effort. Now not each picture wishes this remedy, and overusing semantic markup will also be simply as problematic as ignoring it. This segment walks thru the important thing determination issues:

Determine vs Div With An Symbol

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

Facet Div With Symbol Determine With Symbol
Semantic that means None Self contained content material
Caption beef up Guide textual content placement In-built figcaption component
Accessibility No dating introduced Introduced as attached unit
search engine marketing price Symbol and textual content listed one after the other 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 only ornamental
Content material references one thing on your textual content Symbol is a part of web page format
That you must transfer it with out breaking studying glide Getting rid of it could damage web page construction
Display readers must announce it as a unit No semantic dating issues

When Now not To Use Determine

Now not each picture merits semantic markup. Many pictures in your web page function ornament, branding, or format 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, now not content material references. Hero pictures and banner graphics beef up your format reasonably than explaining your textual content.

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

Right here’s A Fast Check…

One of the simplest ways to make a decision is to accomplish two easy exams. First, take away the picture mentally. Your content material must nonetheless make whole sense without having to provide an explanation for what was once lacking. A product picture in an ecommerce grid passes this take a look at. A chart appearing your gross sales knowledge fails it.

See also  The entirety You Want to Know About Webinar Advertising

2nd, take a look at relocating the picture. Determine content material must be transportable. Shifting it to another spot at the web page shouldn’t damage your format or interrupt the studying glide. Pictures that will have to keep in a single actual spot to make sense aren’t in reality self-contained.

For instance, profile pictures in creator bio sections infrequently want determine markup. Screenshots in tutorials frequently get pleasure from 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 time you upload a determine wrapper. The component turns into helpful in 3 particular scenarios 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 correct credit score. The caption will provide you with a blank position to quote your supply the place everybody can see it.
  • Pictures want context past alt textual content. Knowledge visualizations, technical diagrams, or historic pictures frequently 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 particular race.
  • The determine wishes a label that clarifies what the reader is having a look at, such because the yr of a map, the dataset at the back of a chart, or the section 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 encompassing textual content don’t achieve the rest from visual captions. Alt textual content nonetheless issues for accessibility in those instances, and the encompassing textual content frequently supplies sufficient context with out a visual caption.

The caption exists to serve readers. If including one looks like busywork or simply repeats what other people can already see, go away it out.

What Content material Is going Inside of Figcaption

Write in undeniable language. “The Brooklyn Bridge at sundown” works high-quality. Steer clear of overly flowery captions like “A panoramic view of the long-lasting Brooklyn Bridge bathed in golden night gentle.”

One or two sentences generally 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 final kid within 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 sites, however including semantic HTML in your parts manner opting for between a visible workflow and correct markup. That you must construct within the Visible Builder or write semantic markup via hand, however doing each used to take further steps.

Divi 5 adjustments that with its contemporary function liberate: Custom HTML Wrappers. This selection places semantic keep an eye on immediately within the Visible Builder, the place you already paintings. With out modifying theme recordsdata, writing customized code, disrupting your format, or leaping between interfaces.

Each Divi component now contains an HTML choice workforce within the Complex tab. The Component Kind dropdown comprises the tags you wish to have for correct 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, beneath the Component Kind, there are two fields known as HTML Earlier than and HTML After. Those can help you inject customized markup round any module with out touching your theme recordsdata.

See also  Information Breaches: Reasons, Results, And The right way to Save you Them

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 some other semantic markup. Your pictures get correct 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 Complex tab, scroll to the HTML choice workforce, and click on the Component Kind dropdown.

Choose determine from the listing. Your picture now sits within correct semantic markup as a substitute 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 beneath your picture. Divi AI can generate succinct descriptions for every picture immediately 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 Complex tab, and in finding the HTML choice workforce 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 attached semantic unit that browsers and assistive generation acknowledge routinely. On the other hand, the figcaption module behaves like some other Textual content or Heading Module in Divi.

Taste it with complete design keep an eye on over fonts, colours, and spacing. Design Variables can help you hyperlink captions in your typography scales and emblem colours. Trade the ones core values as soon as, and each caption in your web page updates routinely.

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. Observe one preset, and your entire pictures and captions inherit the similar HTML wrapper and styling.

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

A Few Use Instances

Determine and figcaption paintings absolute best when development particular web page sorts in Divi. Listed here are some concepts:

  • About pages with group member pictures: Headshots paired with captions that come with names, titles, or temporary credentials create correct semantic connections between the picture and the individual’s data. That’s the method used on this put up’s instance.
  • Touchdown pages with statistics or metrics: Charts appearing buyer pride rankings, enlargement percentages, or comparability knowledge get determine wrappers. The figcaption cites the supply and provides credibility in your claims.
  • Gross sales pages with product function comparisons: Facet-by-side pictures appearing other plan tiers, function units, or package deal 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 person pictures want visual context that serves each sighted customers and display screen readers.

Check out Development In Divi 5 Lately!

Determine and figcaption remedy actual issues when pictures want attribution or require rationalization past alt textual content. They devise 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 choices. Including semantic wrappers turns into a part of web page development reasonably than a separate activity that calls for customized code. Get started including semantic construction the place it issues. Obtain Divi 5 and construct available websites with clearer, extra descriptive content material.

The put up 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!