Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

How can I apply a fore-ground css stylling rather than a back-ground stylling to text?

I have some text in HTML lets assume inside a <p> Element,
and I want to add some color for example rgba(0,0,0,0.1) but
above or else on-top of the text and not below or else
behind the text.

Question: How can I achieve that? ( Feel free to answer using both css or javascript if needed ).

Thanks in advance for your time and efforts,
Periklis

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

>Solution :

As Stated In This Question Click Here This Is Not Possible Natively With CSS. But We Can Have A Work Around For This And Here’s How You Do It.

<p>Here is the random paragraph. Here <span style = "color:transparent;background-color:blue;">You Cannot Read Me</span> But You Can Read Me.</p>

This Is Done By Removing The color Of The text and adding A background color. Also you can replace the background to a image if you want.

Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading