• trying to get images centered (not in a gallery), i found no option in the block editor (why not?!), so tried the Code Editor, adding <div id=”center”> above the images and </div> below the images. I was going to then add to Additional CSS:
    #center {margin:0 auto;}
    but when I clicked update, the </div> was moved to the same line as <div id=”center”>, so nothing was inside that div.

    Why is such a basic task so difficult now?

    Without waiting for a future update to WordPress, what can I do now?

    I know HTML5 offers alternatives to the div tag. If I used “section” in the code editor, would that work? (The combination of my old full laptop + slow internet + slow website makes me very reluctant to just try that.)

    danceorangeville.com/gift-cards

Viewing 1 replies (of 1 total)
  • trying to get images centered (not in a gallery), i found no option in the block editor (why not?!),

    The image block in WordPress’ default block editor certainly has alignment options. If you don’t see this, then something is broken on your site.

    Additionally, the image block provides ample CSS classes that you can target to style the image any way you want. You can even add any arbitrary class(es) in the ADVANCED section of the image block’s settings. So there’s absolutely no need for what you’re asking or what you’re trying to do viss custom HTML.

    And if, for whatever season, you must surely enclose an image block inside a parent container, there are already ROW and COLUMN blocks that can do exactly this: first, insert a single ROW (or COLUMN) block, then insert your image into the ROW (or COLUMN) block.

Viewing 1 replies (of 1 total)
  • The topic ‘enable image centering or adding divs around images when using the Code Editor’ is closed to new replies.