0

I am using WordPress 6.2 and the Twenty Twenty-Three theme. I am using a local version of WordPress so I am able to edit the style.css and other files.

How can I make the left-aligned image blocks appear to the left of the content text rather than all the way to the left of the screen? That is, how can I constrain the align-left and align-right so that they do not exceed the body content width?

enter image description here

Steps to reproduce:

  • Use the Twenty Twenty-Three theme.
  • Make a regular post with an image.
  • Align the image to the left using the Gutenberg post editor.

I know I can use the FSE and group the post content and set a maximum width. However, this will also constrain the full width images.

2
  • This sounds like a CSS question. By the way, although you can edit theme files directly, it's best practice to create a child theme. All that means is you create a new theme folder with a style.css file, add comments to name your child theme and define its parent, and you can then enter your own styles which can override the parent theme. For the CSS itself, you can ask on StackOverflow or check a site like CSSTricks to find specifics.
    – WebElaine
    Apr 4 at 14:03
  • Sure I can make a child theme if that helps, but the problem is not only CSS-related. It depends on how one goes about it. One could for example solve this by adding a wrapper DIV which would require PHP. It is also strongly related to the blocks functionality, but I am simply not sure what the best approach is here.
    – Arete
    Apr 4 at 16:05

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Browse other questions tagged or ask your own question.