HTML5 URL Input Type - HTML CSS HTML

HTML CSS examples for HTML:Form Input

Description

HTML5 URL Input Type

Demo Code

ResultView the demo in separate window

Enter URL in the form like http://www.book2s.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;
    }<!--from w w  w  .  j a  v a2  s. 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>

Related Tutorials