Jump to content

how to get 100% opacity on text and 40% on background arround text.


pioneerx01

Recommended Posts

Basically I am working with this code:

 

p {
background-color:white;
filter:alpha(opacity=40);
opacity: 0.40;
margin:0px;
border-radius: 10px;
padding:10px;
text-align:justify;
color:black;
font-size:16px;
}

 

But this puts both black text and white background at 40%. How do I get text back up to 100%?

Link to comment
Share on other sites

there are 3 ways to do this:

 

1) is to make a small transparent png and use that as background image  for the container. Not only is that much more cross browser compatible (until ie6), but it also a tiny bit easier.

 

2) second use rgba on the container

 

3)If you want to stick with these opacity properties you need as said 2 containers, which are overlapping each other. In order to make that work you need to play with position relative, position absolute and a the z-index property.

 

I prefer the first since not everybody has great browsers yet

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

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.   Restore formatting

  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.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.