jquery - Anchor goes to whole width when centered -


i've 1 paragraph , 1 button in container

<div class="container">        <div class="row">           <p class="text-center text-muted">text</p>           <a class="btn btn-danger  center" href="">             download pdf           </a >         </div>              </div> 

code center class

.center{     display: block !important;     margin-left: auto !important;     margin-right: auto !important; } 

and how output looks while expecting in center small button should wide per value download pdf

enter image description here

your style should like:

.center {     display: block !important;     width: 250px; //change accordingly;     margin-left: auto !important;     margin-right: auto !important; } 

margin auto works fixed width container.

or try:

<div style='text-align:center'>     <a class="btn btn-danger" href="">         download pdf      </a > </div> 

just advice, avoid using many !important


Comments

Popular posts from this blog

resizing Telegram inline keyboard -

command line - How can a Python program background itself? -

php - "cURL error 28: Resolving timed out" on Wordpress on Azure App Service on Linux -