Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to make image in html transparent?

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"/>
like image 210
petko_stankoski Avatar asked Nov 16 '11 11:11

petko_stankoski


People also ask

How do I make an image transparent in HTML?

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.

How do I make a transparent PNG in HTML?

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.


1 Answers

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>
like image 111
Martin Borthiry Avatar answered Oct 02 '22 04:10

Martin Borthiry