Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Centering content blocks with buttons #22732

Closed
ghost opened this issue Jun 1, 2017 · 6 comments
Closed

Centering content blocks with buttons #22732

ghost opened this issue Jun 1, 2017 · 6 comments
Labels

Comments

@ghost
Copy link

ghost commented Jun 1, 2017

The center-block class is fine to achieve a centered button only if it is really a button element. Applying to a link button does not work.

Examples (both cases):

  • <button type="button" class="btn btn-default center-block">Pure button</button>.
  • <a href="#" class="btn btn-default center-block">Link button</a>.
@patrickhlauke
Copy link
Member

do you have a reduced test case example? (also, center-block has been replaced with mx-auto)

@ghost
Copy link
Author

ghost commented Jun 1, 2017

This is in version 3.

@Johann-S Johann-S added v3 and removed v4 labels Jun 1, 2017
@Johann-S
Copy link
Member

Johann-S commented Jun 1, 2017

Bootstrap 3 is essentially in maintenance mode as we focus on working towards a stable v4. As such, we're only accepting changes to v3's code on a case-by-case basis, usually only for critical bug fixes or docs improvements.

@Johann-S Johann-S closed this as completed Jun 1, 2017
@ghost
Copy link
Author

ghost commented Dec 22, 2017

Here is a solution.

A CSS declaration like a.center-block { display: table; } is usefull.

@mdo
Copy link
Member

mdo commented Dec 22, 2017

Buttons are inline-block, use text-align on the parent to change their alignment.

@ghost
Copy link
Author

ghost commented Dec 27, 2017

Using center-block class, buttons are not inline-block. This class has not to be applied to buttons or links? Only devised for images and resized divs?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants