I'm trying to achieve button links with an image overlay, but so far I've only been able to do it using CSS:
section a:link, section a:visited {
width: 150px;
-moz-border-radius: 10px;
-webkit-border-radius: 10px;
border-radius: 10px;
-khtml-border-radius: 10px;
color: white;
background: #03c;
padding: 10px 10px 10px 60px;
display: block;
text-decoration: none;
}
section div {
margin-left: 5px;
margin-top: -9px;
width: 50px;
height: 50px;
float: left;
}
.pdf div {
background: transparent url('pdf.png') no-repeat 0 50%;
}
Here's the HTML structure I used:
<section class="pdf">
<div></div>
<a href="#">Sheet music (PDF)</a>
</section>
However, negative margins are causing issues in IE7. Is there a better solution for this that works across all browsers? I attempted adding a margin-top
in the section a
tags, but due to collapsing margins, that didn't solve the problem.
(Unfortunately, embedding images and adding more external links is restricted based on my current reputation.)