PDA

View Full Version : <input> Border Colour Change



Verrou
23-10-2007, 12:06 PM
Ok so i've got this script:

<html>
<head>
<style type="text/css">
input:active {
background-color: white;
border: 1px solid #66FF00;
}

input{
background-color: white;
border: 1px solid black;
}
</style>
</head>

<body>
<input name="hello" type="text">
</body>

</html>
And it's just a quickie to test it, but when you click on the text area i want the border to stay green while it is selected, because atm it's only green when you click on it.

Please help.

Thanks,
Ver.

EDIT: Test it here: http://www.w3schools.com/css/tryit.asp?filename=trycss_border

Invent
23-10-2007, 01:03 PM
<html>
<head>
<style type="text/css">
input:focus {
background-color: white;
border: 1px solid #66FF00;
}

input{
background-color: white;
border: 1px solid black;
}
</style>
</head>

<body>
<input name="hello" type="text">
</body>

</html>

Verrou
24-10-2007, 06:15 AM
Ahh, thanks lol i tried onFocus and everything i could think of! +REP

Dentafrice,
24-10-2007, 07:22 PM
onfocus="this.style.border='1px solid green';" Or something like that :s

Want to hide these adverts? Register an account for free!