View Full Version : Button code not working in a div

05-09-2011, 11:10 AM
My url:www.accidentinsuranceforfree.com
I am using nested divs and wanted to put a button. I used the following in my custom_functions.php file:

function sButton($atts, $content = null) {
extract(shortcode_atts(array('link' => '#'), $atts));
return '<a class="button" href="'.$link.'"><span>' . do_shortcode($content) . '</span></a>';
add_shortcode('button', 'sButton');

as for the CSS:
a.button {
display: inline-block;
font-size: 13px;
font-weight: bold;
height: 31px;
padding-right: 10px;
color: #183f4c;
background: transparent url(images/sm_a.png) no-repeat top right;
text-decoration: none;

a.button:hover {
color: #fff;
background-position: bottom right;
text-decoration: none;

a.button span {
display: block;
line-height: 14px;
padding: 8px 0 9px 10px;
background: transparent url(images/sm_span.png) no-repeat top left;

a.button:hover span {
color: #fff;
background-position: bottom left;

then I used the following for generating the button:
Go to Google

On normal pages, this does generate a button, but inside my divs it goes uninterpreted and displayed as it is. Any help please? Thanks.