I have an <img>
logo that is wrapped inside a link, and the link is wrapped in a <div>
.
My code below results in the clickable area for my link to extend 100% horizontally to both edges of the viewport.
How can I make the clickable area for my link to be the size of my logo?
My HTML:
<div id="logo-container">
<div id="logo">
<a href="dashboard.php"><img src="http://placehold.it/350x150" /></a>
</div>
</div>
My CSS:
#logo-container{
width:100%;
float:left;
height:auto;
margin:0 auto 0 auto;
background:#ECECEA;
}
#logo{
margin:0 auto;
height:auto;
}
#logo img {
display:block;
margin:6px auto 10px auto;
}
#logo img{
width:330px;
height:auto;
}