I am editing a site that uses mostly tables to format it's sales page. I am not a huge fan of tables, but it's all I have to work with. The webmaster needs to remove the clickable area from the left and right of the Try Now button, which is centered in a table. Everything looks good, except that the viewers can click an invisible "a href" area that extends to the width of the table as a margin on both the left and right of the button. I have included the code and a jsfiddle below.
Here's the HTML:
<table width="930px" align="center" style="margin: -20px 0 20px 0;">
<tbody>
<tr>
<table width="930px" height="300px" style="background-repeat:no-repeat; margin-top:-10px;">
<tbody>
<tr>
<td align="center" valign="top">
<tr>
<td valign="top" align="center">
<a href="#" id="try-now-btn-text">
<div class="try-now-btn" align="center">
TRY NOW
</div>
</a>
</td>
</tr>
Here's the CSS:
a div.try-now-btn {
background-color:#7DC15C;
border-radius:5px;
-webkit-border-radius:5px;
-moz-border-radius:5px;
padding-top:15px;
padding-bottom:10px;
width:200px;
border-bottom: 5px solid #6DA850;
}
a div.try-now-btn:hover {
background-color:#8BD666;
border-radius:5px;
-webkit-border-radius:5px;
-moz-border-radius:5px;
padding-top:15px;
padding-bottom:10px;
width:200px;
border-bottom: 5px solid #6DA850;
}
a#try-now-btn-text {
color:#fff;
font:bold 22px 'Helvetica Neue',sans-serif;
line-height:30px;
text-decoration:none;
margin:none;
}
JSFiddle:
I have tried adding "margin:0!important" to the CSS in multiple areas. I have tried every which way I can think of to center the button withOUT allowing the margin to the left and right to be "clickable." Nothing I have done has worked. Please advise. Not looking for you wonderful people to do my job for me - just hoping that some light is shed on this subject for my enlightenment. I have researched for hours and still cannot seem to get it. Thus, this is my "last resort."
Thanks!