• Hi,
    when adding pictures in twenty-twenty-one, I noticed that they are added as <figure>, not wrapped in a <div>, except when I add a positioning, like centre, left or right. CSS rules are not the same in both cases, when the <figure> is wrapped in a <div> or not.
    Is this expected behaviour? Wouldn’t it make more sense to wrap them anyway?
    Thanks for comments

Viewing 2 replies - 1 through 2 (of 2 total)
  • <figure> element was probably used in combination with <figcaption>, or to make the HTML markdown more semantic and less generic (when using just nested <div> elements).

    If there’s no issue with your pages layout, you shouldn’t add more HTML elements.

    Only if you want to customize your layout further, and need a parent <div> element to target with CSS styling, then add it.

    Thread Starter myheart61

    (@myheart61)

    Thanks Ivan,

    In fact I did not want to add any HTML. I just noticed when a picture is added in the WP editor, its figure tag is wrapped in a div, yes or no, depending on the fact if the picture is positioned or not.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘pictures are not always wrapped in’ is closed to new replies.