Flexbox – Inspect Mode what is that in WordPress Theme?

Hello everyone,

I'm currently stuck. I've installed a WordPress theme and want to customize the layout using CSS. Now I'm seeing a flexbox, which is divided into two sections, as shown in this image:

And I want to center the headline in the container. However, I can't align it, and I don't know how this area is defined on the right side (according to Flexbox).

I'm excited and thank you in advance!

greeting

(1 votes)
Loading...

Similar Posts

Subscribe
Notify of
1 Answer
Oldest
Newest Most Voted
Inline Feedbacks
View all comments
regex9
1 year ago

For centering the heading element within the black box, you can make the box yourself a flexbox.

.black-box {
  align-items: center;
  display: flex;
  justify-content:center;
}

For centering in the entire container, over both columns, you could use an absolute positioning for the horizontal plane.

.container {
  position: relative;
}

.title {
  align-self: center;
  left: 50%;
  position: absolute;
  transform: translateX(-50%);
}

In order for the vertical alignment to engage, the element for the header must in any case be within a flexbox.

(…) and does not know how this area is defined on the right side (lt. Flexbox)

You should see that in the HTML code. If there is only one child element (the black box), the rest is unused / empty space. The container itself will have an explicit width on which it stretches.