How to give the border to text box on focus | Sanwebcorner

How to give the border to text box on focus

How to give the border to text box on focus

This post is helps you to create a border and border color for textbox and textarea when clicking it(on focus state) and also it helps to remove the default glow effect of the textbox or input fields.This is one of the simple method to give border on focus state. The below demo shows the result of this program.


index.html

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>text box on focus</title>
<style>
.text1
{
-moz-transition: all 0.3s ease-in-out;
-o-transition: all 0.3s ease-in-out;
-webkit-transition: all 0.3s ease-in-out;
transition: all 0.3s ease-in-out;
outline: none;
height:45px;
width:332px;
border:1px solid #999;
margin-bottom:10px;
/*text-indent:22px;*/
margin-left:30px;
font-size:14px;
font-family: Georgia;
}

.text1:focus
{
border: 1px solid #2FAA44;
}

.message
{
-moz-transition: all 0.3s ease-in-out;
-o-transition: all 0.3s ease-in-out;
-webkit-transition: all 0.3s ease-in-out;
transition: all 0.3s ease-in-out;
outline: none;
border:1px solid #999;
margin-left:30px;

/*text-indent:22px;*/
font-size:14px;
font-family: Georgia;

}
.message:focus
{
border: 1px solid #F00;
}
</style>
</head>
<body>
<form name="contact" action="" onsubmit="">
<input class="text1" type="text1" name="salonname" id='salonname' placeholder="Enter Salon Name" /><br />
<input class="text1" type="text1" name="firstname" id='firstname' placeholder="Contact Person" /><br />
<input class="text1" type="text1" name="Email" id='Email' placeholder="Enter your Email" /><br />
<input class="text1" type="text1" name="Phone" id="Phone" placeholder="Enter your Mobile Number" /><br />
<textarea rows="6" cols="51" class="message" id="Address" name="Address" placeholder="Address">
</textarea>
<br><br>
<center><input type="submit" name="submit" value="REGISTER" id="popUpYes" /></center>
</form>
</body>
</html>

Post a Comment

Labels

360 degree view product image 3d rotate 3d text 3step-form Accordion menu ajax All Browsers Animated Background Gradient animation audio controller auto complete Best accordion menu bootstrap border bounce effect on hover Breadcrumb calculate age by dob calendar Captcha change image on mouse move color chooser countdown Counter on scroll Css css animation css buttons css hover css3 customized upload Button Date picker delete data from table Different scroll speed email otp verification email verifier Embed eventlist Expanding Menu feedbck form flash news section close button full screen menu Google custom search Google Maps Google reCAPTCHA Google site search gradient hide menu Horizontal News ticker Hover Htm Html html dropdown html form html5 html5 form validation Iframe image hover increment decrement textbox value based on select box Javascript Jquery js Layered image effect on mouse hover lock & unlock page scroll marquee marquee with close button mobile number validation mobile otp login Multi-level-drop-down-menu multi-level-form Multi-Step-form mysql News ticker on hover change text to image our team page password strength checker Photoshop PHP populate html selectbox Popup image on click the link pure css Question type form Random password Redirect page Based on the select box while submit the form responsive responsive menu responsive popup box Responsive Vertical Time line design rotate image selectbox based on select box simple coming soon page simple countdown based on end date simple typing effect slider sliding tab sms otp login statistic counter on scroll switch tag shape team member Time picker toggle toggle view transparent button underline animation up down slide validation vertical fixed sidebar Webtips Youtube