I have a html file and I want to put an image in. The image should be transparent. The way I am doing now - first comes the image, and after it finishes, there comes the text and the other images. How to add transparent image in html? This is my code now:
<img src="result_files\image003.png" alt="some_text"/>
First, we create a <div> element (class="background") with a background image, and a border. Then we create another <div> (class="transbox") inside the first <div>. The <div class="transbox"> have a background color, and a border - the div is transparent.
Transparency is not done in HTML, but is a part of the image itself. The browser will see the image as a PNG and display it as a PNG automatically. To add transparency to the image, you will have to edit the file with a graphics editor like Photoshop. Save this answer.
Try using opacity
(and filter
for IE).
<img src="result_files\image003.png" alt="some_text" style="opacity:0.4;filter:alpha(opacity=40);"/>
Now, I understand your question, the answer is something like this:
<div style="background:url(image.jpg)"> the content here </div>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With