Forums

The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums CSS Best way to overlay a link button to a .png image? Reply To: Best way to overlay a link button to a .png image?

#197144
donaldmedina
Participant

Hi,
I am a professional web designer working in a reputed website design company and have tried this code. It works:
Change your html to:
<a class="image"></a>
Then add your css to:

.image:before {
content:url('http://LinkToMyImage');
// You should also be able to safely eliminate
display: block;// when settingposition: absolute, but included it just in case you
// experienced problems setting width and height
display: block;
height: 169px;
width: 220px;
position: absolute;
// top 0 is usually inferred when setting position: absolute;
// you should be able to remove this
top: 0px;
right: 0px;
}