How to create a transparent layer to write text over a picture with html?

70 Views Asked by At

Could you guys please tell me how can I create a transparent layer over a product picture to be able to write the name and price of a product on sales screen of a Point of Sale software just like this my problem is the text and price on the product picture aren't visible see here

this is the screen where I write the html code, I tried this code <html><center><div style=background-color:#fafafa;color:#0;padding-left:10px;padding-right:10px;>Product name but the layer is not transparent and is not fitting the button, either it's to small or it's placement is incorrect, I wanted to be as I shared the pic above. Please let me know what can I do?

1

There are 1 best solutions below

3
wesley weinberg On

try setting the background-color value to background-color:rgba(245,245,245,.2); the 0 value controls the alpha of the color, so 1 is opaque and 0 is translucent :)

https://developer.mozilla.org/en-US/docs/Web/CSS/color_value/rgb