View Full Version : [CSS] Increase link hit area
NeoDreamer
September 3rd, 2007, 11:42 AM
I have a generic button graphic that I can set as the background to a DIV. I'm going to place a hyperlink in this DIV to label the button. My question is, how do I increase the hit area of the hyperlink so that it is as large as the button in the background?
MTsoul
September 3rd, 2007, 02:37 PM
a#your_link_id {
width: 100%;
height: 100%;
display: block;
}
NeoDreamer
September 3rd, 2007, 04:44 PM
That code made my text go below the button DIV:
http://img53.imageshack.us/img53/8190/untitled1ci3.gif
#groupSelect {
margin: auto;
padding-top: 5px;
padding-bottom: 5px;
width: 182px;
background-image: url(groupSelectBG.gif);
}
#groupSelect a:link,
#groupSelect a:hover,
#groupSelect a:visited {
color: #333333;
text-decoration: none;
}
#groupSelect a {
width: 100%;
height: 100%;
display: block;
}
MTsoul
September 4th, 2007, 02:03 PM
I guess you want your text positioned at a very specific location within that div. You'll have to play around with the height, width, and padding to get it exactly there. As long as the display is block, padding for a link will work and you could make it as tall / wide as you want.
Powered by vBulletin® Version 4.1.10 Copyright © 2012 vBulletin Solutions, Inc. All rights reserved.