HTML CSS examples for HTML:Form Input
HTML5 URL Input Type
Enter URL in the form like http://www.java2s.com <!DOCTYPE html> <html lang="en"> <head> <title>HTML5 URL Input Type</title> <style type="text/css"> input[type="url"]:valid{ outline: 2px solid green; }<!-- w w w .j a va2s . com--> input[type="url"]:invalid{ outline: 2px solid red; } </style> </head> <body> <form> <label> Website URL: <input type="url" name="mywebsite" required> </label> </form> </body> </html>