I want to have an image as a button, on an aspx page. It seems natural to have the link to the button file in the css file, as the image may change. But should the link url also be in the css file? How would that be done code-wise? Or if the url should be in the aspx file, then how to make the button referenced in css-file to have this link?
EDIT:
<div id="somelink"><a href="....." /></div>
#somelink a
{
background: url(/Images/button.jpg) no-repeat;
display: block;
width: 235px;
height: 37px;
}
CSS is for styling only. You can’t have the Link URL stored there as well. That belongs in the Markup.
As for linking the button to the CSS, you would either use a class or an id:
And in the markup: