Jump to content
newcoder1010

How to apply opacity to background only

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

Share this post


Link to post
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

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...

×
×
  • Create New...