html - Center tag works on link but not CSS or align attribute -


i'm trying center button <a> tag. however, thing work <center> tag. i've tried using <a style="text-align: center">button</a> , <a align="center">button</a>, none of 2 worked. why center tag works?

my css this:

.btn {     color: white;     background-color: orange;     padding: 5px;     border-radius: 10px;     -webkit-border-radius: 10px;     -moz-border-radius: 10px;     text-decoration: none;     transition: 200ms all; }  .btn:hover {     background-color: #ffc964;     color: white;     cursor: pointer; } 

html:

<a href="http://example.com" class="btn">button</a> 

the <center> tag deprecated , removed in browsers. , <a> tag inline in nature, text-align: center should given it's parent block element:

.make-center {text-align: center;}
<div class="make-center">    <a href="#">i link</a>  </div>

in above code, <div class="make-center"> tag acts <center> tag.


Comments

Popular posts from this blog

powershell Start-Process exit code -1073741502 when used with Credential from a windows service environment -

twig - Using Twigbridge in a Laravel 5.1 Package -

c# - LINQ join Entities from HashSet's, Join vs Dictionary vs HashSet performance -