CSS
-Tricks
treehouse :
what would you like to learn today?
Web Design
Web Development
iOS Development
Show search box
Search
Search in:
All
Articles
Forums
Snippets
Videos
✕
Home
Forums
Snippets
Gallery
Videos
Almanac
Demos
Lodge
Navigation 'n' Search
Forums
Illustration by Nick Sirotich
Forums
»
CSS Combat
targetting & styling a button tag
misemefein
Permalink to comment
#
August 2012
I know it is not a link or anchor tag, but is it possible to activate a 'hover state' to a
<button>
tag?
for example I want to add a simple underline upon hovering a button
chrisburton
Permalink to comment
#
August 2012
You mean the text inside it or the actual button?
misemefein
Permalink to comment
#
August 2012
actually im referring to the text inside.
see example here for clarity:
http://jsfiddle.net/misemefein/k3dKz/12/
misemefein
Permalink to comment
#
August 2012
ah I was too impatient. and stupid.
.slide button:hover{
text-decoration: underline;
}
jurotek
Permalink to comment
#
August 2012
since it is a button, you could get little fancier by changing the background of the button and font color like so:
.btn:hover{color:#fff;background:#368;font-weight:700}
Add a Comment
<button>tag?for example I want to add a simple underline upon hovering a button
see example here for clarity:
http://jsfiddle.net/misemefein/k3dKz/12/
.slide button:hover{
text-decoration: underline;
}