CSS Question

How do you style <a> tags without affecting <button> tags that have a link?

I was wondering as to how you could style

<a>
tags without affecting
<button>
tags.



a:hover{
text-decoration: underline;
}

<link rel="stylesheet" href="http://mrredblob.com/wordpress/wp-content/themes/homework/style.css">
<a href="#"><button>A link</button></a>




Answer Source

Try simply doing this :

<button><a href="#">A link</a></button>

This way you can style the text inside of the button however you want.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download