Is there a way that I can add text-align:center
to all div.wpb_wrapper
which have h1
as the first child? One of the reasons I need this is that there are multiple div.wpb_wrapper
that have the same parent, but not all have <h1>
as the first child.
In the example below I only want to style the second div.
<div class="wpb_wrapper">
<h2>Other text</h2>
<p>Other text</p>
</div>
<div class="wpb_wrapper">
<h1>Text</h1>
<h2>Other text</h2>
<p>Other text</p>
</div>
EDIT: I can't apply text-align center
to h1 because it is has display: inline-block;
already applied. That's why I need to style the parent.