Centering content blocks with buttons
See original GitHub issueThe 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>
.
Issue Analytics
- State:
- Created 6 years ago
- Reactions:1
- Comments:6 (3 by maintainers)
Top Results From Across the Web
How to center a button with HTML & CSS
You can center a block level element by setting margin-left and margin-right to auto . We can use the shorthand margin: 0 auto...
Read more >Why do we need display block to center a button [duplicate]
If you want to center button without making it a block , you can use text-align: center on it's parent. Also, button don't...
Read more >How To Center a Button in a DIV Element
Learn how to center a button element vertically and horizontally with CSS. ... Tip: Go to our CSS Align Tutorial to learn more...
Read more >Centered buttons aligning left
Click on button in editor; Click “Change Block Type or Style”; Under “Transfer To” select “Buttons”; “Change Content Justification” to “Justify Center” ...
Read more >Center a Button in an Image Block on Squarespace
In this video, I show you how to quickly center a button in an image block on your Squarespace website.
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
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 resizeddiv
s?Here is a solution.
A CSS declaration like
a.center-block { display: table; }
is usefull.