Say in CSS all i have is this: <div id="name"></div> #name{ margin-left: 20px; margin-top: 10px; width: 387px; height: 78px; background-image: url(images/Name.png); } How could i make the whole div a link? Thanks, in advance.
#name a{ margin-left: 20px; margin-top: 10px; width: 387px; height: 78px; background-image: url(images/Name.png); display:block; } #name { } and the html: <div id="name"> <a href="#"></a> </div>
You can simulate a block level element such as a div by making the anchor which is by nature inline, block. <a id="anchor" href="file.html">foo</a> a#anchor { margin:10px 0 0 20px; display:block; width:387px; height:78px; background:url(images/name.png) no-repeat; }
soulscratch's method would have been better here - both ways work, just less code whilst same result his way.
Sure you have the right URL? That anchor isn't expanding in any browser I throw at it, so the header is NOT clickable. Sorry Charlie.
Sorry 'bout that. Check this page - It opens up fine now, but my original problem still persists. Thanks