/ Published in: CSS
I switched the h1 to a span to stop the hover from being effective from the other side of the page. Take a look at it [here](http://jsbin.com/okepo4/6/,\"here\")
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"> <title>Sort of Lame CSS Text Changing</title> <style> span { position: relative; } span:hover { color: transparent; } span:hover:after { content: attr(data-hover-response); width: 250px; color: black; position: absolute; left: 0; } </style> </head> <body> <span data-hover-response="I Said Don't Touch Me!"> Don't Touch Me </span> </body> </html>