Reputation: 47
how do i get it so that i reduce the opacy only for the BG color and not the content, and not the border.
css:
.ghost-btn-small {
text-decoration: none;
text-align: center;
margin: 320px auto 0 auto;
background-color: #000000;
opacity: 0.3;
border: 1px solid #fff;
height: 70px;
width: 280px;
line-height: 36px;
}
there has to be a quick and easy way?
Upvotes: 0
Views: 56
Reputation: 191
Instead of copying codes why don't you read this:
When working with CSS colors, you can specify the color in several ways:
background-color: red;
background-color: #ff0000;
background-color: rgb(255,0,0); background-color: rgb(100%,0,0);
background-color:rgba(255,0,0,0.5); background-color:rgba(100%,0,0,0.2);
background-color: hsl(0,100%, 50%);
Of course you could as well set the opacity property to set the amount of transparency an element has.
Hope this will help.
Upvotes: 1
Reputation: 23
.ghost-btn-small {
text-decoration: none;
text-align:center;
margin: 320px auto 0 auto;
background-color:rgba(0,0,0,0.3);
border: 1px solid #fff;
height: 70px;
width:280px;
line-height: 36px;
}
Just Copy this it will work. If you will give opacity attribute to class it will apply for whole class that is why your border was catching the opacity.
Upvotes: 1
Reputation: 7207
Try
background-color:rgba(0,0,0,.3);
instead of
background-color:#000000;
opacity: 0.3;
This applies only for background-color, not for content
Upvotes: 1