Hello, I've got a button element that I'd like to process with php. I figured the best way would be to put a link in the button. For some reason the text turns blue but nothing happens when I click the button. Not even when I click right on the text. I figured I would have to find css to make the link fill the button, but not sure why clicking directly on the text isn't working. <button class="btn btn-default btn-block top-buffer"><a href="php/scripts/follow_user.php?following='.$profileUser->return_username().'&follower='.$user->return_username().'">Follow</a></button> Code (markup):
My suggestion could be totally off, but why do you even need a <button>? Just do something like: <a href="php/scripts/follow_user.php?following='.$profileUser->return_username().'&follower='.$user->return_username().' " class="button">Follow</a> Code (markup): And then turn that class into any button you want: .button { background-color :#0043FF; border: 0.1em solid #0043FF; border-radius: 0.2em; display: inline-block; cursor: pointer; color: #ffffff !important; font-size: 1.2em; text-decoration: none; padding: 0.2em 0.4em 0.2em 0.4em; vertical-align: middle; } .button:hover { background-color: #003DE5; border: 0.1em solid #003DE5; color: #ffffff !important; text-decoration:none; } Code (markup): Working fiddle: http://jsfiddle.net/30tsjc4e/15/
That's my take, if it's not a FORM ELEMENT why in blazes are you wrapping it in a button tag?!? Just style the anchor and let the anchor do what an anchor does.