Jump to content

How to apply opacity to background only


newcoder1010

Recommended Posts

Hello,

HTML:

<div class="text-inner text-left text-white">
                  
<h1>MULTI-FAMILY</h1>
<h1>REAL ESTATE INVESTMENTS</h1>
<p><span style="font-size: 140%;">x x x x x  x x.</span></p>
<a href="http://examplesite.com/" target="_self" class="button secondary">
    <span>xxx With us</span>
  </a>

<a href="http://examplesite.com/" target="_self" class="button white is-outline">
    <span>xxx Portal</span>
  </a>

              </div>

CSS:

.text-white {
    color: #ffffff;
    background: #0808f3;
    opacity: .5;
}

Opacity now applied to the texts as well. I only like to apply opacity to background class only. How can I do it?

Thanks!

Edited by newcoder1010
Link to comment
Share on other sites

The last digits represent the level of opacity the same as opacity property. 0 to 1.

HEX colour also has an alpha in hex numbering you the solid 6 color characters(#00FF00), then by adding two extra hex characters, these will also change transparency (#00FF00A5).

The last two character representing alpha values can be found by googling.

 

Edited by dsonesuk
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...