I know that this question has already been answered, but here is another way to do it.
<!DOCTYPE html> <html> <head> <style> #text_container { padding: 1px; border: 1px solid activeborder; } #text_container > label { color: activeborder; background-color: white; -webkit-touch-callout: none; -webkit-user-select: none; -khtml-user-select: none; -moz-user-select: none; -ms-user-select: none; } #text_container > input { border: none; } </style> </head> <body> <span id="text_container"> <label>http://www.</label><input type="text" /> </span> </body> </html>
I checked this code with.
Firefox 22 Google Chrome 28 Internet Explorer 10 Safari 5 Opera 15
source share