So I want the text [buy] to be centered but when I use text-align: center, it doesn't work. Here is the code:
.buy {
background-color: rgb(73, 73, 247);
font-weight: bold;
padding-left: 15px;
padding-right: 15px;
padding-top: 7px;
padding-bottom: 7px;
color: white;
border-radius: 30px;
}
.f {
text-align: center;
margin-top: 0;
margin-bottom: 0;
}
.pros {
font-weight: bold;
text-align: center;
font-size: 42px;
margin-top: 3px;
margin-bottom: 15px;
}
.mac {
text-align: center;
font-weight: bold;
font-size: 25px;
margin-top: 5px;
margin-bottom: 0;
}
.new {
text-align: center;
font-weight: bold;
color: orangered;
margin-bottom: 0;
}
.p {
font-family: Arial;
text-align: center;
}
<p class="new">
New
</p>
<p class="mac">
MacBook Pro
</p>
<p class="pros">
Supercharged for pros.
</p>
<p class="f">
From $1999
</p>
<p>
<span class="buy">Buy</span>
</p>