I'm trying to make a white button with rounded corners and with a little transparency. The text should not be transparent. I tried to use opacity: initial
for <p>
style but it seems to not work. Take a look at my snippet to understand better.
body {
background-color: #264D38;
}
.button {
display: inline-block;
width: 150px;
border-radius: 2px;
margin-top: 20px;
margin-bottom: 20px;
background-color: #898989;
opacity: 0.4;
filter: alpha(opacity=40); /* Para IE8 e anteriores */
}
span.button > p {
opacity: initial;
padding: 10px;
color: #ffffff;
font-weight: bold;
text-align: center;
}
.button:hover {
background-color: #000000;
}
<body>
<a href="#"><span class="button"><p>BUY NOW</p></span></a>
</body>
` with a `` to begin with? Your markup will be invalid if you wrap block level elements with inline elements. If you need another element use another `` or something else like ``, ``, ``, ``, etc.
– hungerstar Apr 08 '16 at 13:26