Table of Contents

How to align a <button> element?

How to align a <button> element inside a <fieldset> with CSS? (E.g. you use the bureaucracy plugin.)

Variant 1

One way is to set the CSS property “text-align” of a tag which wraps the button tag:

.dokuwiki form.bureaucracy__plugin fieldset {
   text-align: center;
}

But this solution takes effect to other inline elements inside the fieldset (e.g. text) too. :-(

Variant 2

An alternative without side-effects on other elements and with more flexibility is to redefine <button> to a block element 1) und than you can apply the margin property. The following CSS rule centered only the button and nothing else:

.dokuwiki form.bureaucracy__plugin button {
    display: block;
    margin: auto;
}

Example of how to modify CSS

Small CSS changes like this can be made via the Advanced plugin. It must be installed first.

The Advanced plugin edits the file userstyle.css and if it does not exist, it is created beforehand. After installing the plugin go to:



1)
By default the display-property of a button tag is 'inline'.