Hello, I can not center a link.
#Anyadir-Rutina-btn {
background-color: #21211d;
color: #FFF;
padding: 10px;
border-radius: 20px;
text-decoration: none;
cursor: pointer;
}
<div id="Power-Contenedor">
<a href="#" id="Anyadir-Rutina-btn"> Añadir entreno </a>
</div>
What is the reason why you won't let me?
Health
You must define a width to the container
#Power-Contenedor
, and then if you center it.You should simply assign the property
text-align: center
to your container to center the link, since this is an elementinline
.CLARIFICATION: When taking the block elements (
display: block
) 100% of the width available by default, in this case you will not need to define a width since it will take 100% of the width of the page.Your modified example: