• Hi,

    after upgrading to WP 6.1 all centered buttons align left.

    In the block-editor I can see the buttons correctly centered, but if I show the block-html, I found this:

    <div class=”wp-block-buttons”><!– wp:button {“className”:”is-style-primary”} –>
    <div class=”wp-block-button is-style-primary”>ÜBER DIE AKTION</div>
    <!– /wp:button –>

    The class “is-content-justification-center” is missing in the code

    If I look on the resulting HTML in Browser, i see this:
    <div class=”is-horizontal is-content-justification-center is-layout-flex wp-container-1 wp-block-buttons”>

    But Buttons are not centered

    I have tested this issue on other sites on WP 6.1. with different themes (Neve and Affinity), it’s always the same, so it seems to have nothing to do with the theme.

    Best
    Kai-Uwe

    The page I need help with: [log in to see the link]

Viewing 6 replies - 1 through 6 (of 6 total)
  • Kai Uwe, Uwe Kai

    da passen die Styles nicht, probier mal das Ganze neu zu bauen im Editor

    wp-block-buttons.wp-container-6, .wp-block-buttons.wp-container-23
    hat aktuell die Eigenschaft:
    justify-content: flex-start;

    das bedeutet die Buttons sind links,
    dieser Wert müsste geändert werden auf
    justify-content: center;
    damit das dann noch greift müsste noch angegeben werden
    display:flex;

    Diese Eigenschaften scheinen verloren gegangen zu sein also probiers mal neu zu machen

    Thread Starter kub0711

    (@kub0711)

    Problem: Ich habe das schon auf einer Testseite komplett neu gebaut.
    Mit demselben Ergebnis:

    Im Block-Editor sieht es richtig aus, in der Vorschau ist es linksbündig.

    Hi, bei manchen deiner Buttons sieht das HTML noch so aus:
    <div class=”is-horizontal is-content-justification-left is-layout-flex wp-container-1 wp-block-buttons”>

    Das is-content-justifivation-left müsstest du irgendwie ändern zu center

    Unten bei dem “Ich will Mitmachen” Button ist das schon richtig, da hast du irgendeine Einstellung wsl falsch.

    Wenn das dann überall passt dann würd ich vorschlagen machst du den Rest mit Custom CSS, Custom CSS solltest du in deinem Theme setzen können, gib da einfach das ein:

    .wp-block-buttons.is-content-justification-center {
      display: flex;
      justify-content: center !important;
    }
    • This reply was modified 3 years, 7 months ago by Benedikt Ledl.
    Thread Starter kub0711

    (@kub0711)

    Für die Live-Seite bin ich weiter:
    Die konkreten Buttons liegen in einem Cover-Block.
    Wenn ich den auf zentriert stelle, sind auch die Buttons zentriert.

    Auf ner Testseite ohne Cover-Block funktioniert es trotzdem nicht.

    Gruß
    Kai-Uwe

    naja dann nimm den cover-block 😀

Viewing 6 replies - 1 through 6 (of 6 total)

The topic ‘Buttons centered or aligned right doesn’t work’ is closed to new replies.