In the HTML web design, how to write the code for a "login" button?
The "login" button as a column is displayed in the HTML code, which is required to identify whether to enter the username and password!
5 thoughts on “HTML web design: a simple login interface code!”
Leave a Comment
You must be logged in to post a comment.
u003C! Doctype html>
u003Chtml>
u003Chead>
u003Cmeta charset = "utf-8">
u003Clink href = "main.css" type = "text /css "rel =" ">
u003CTitle> Login interface u003C/title>
u003C/head>
u003Cbody>
u003Cdiv class =" login_ico ">
u003Cimg src =" images/login_ico.png ">
u003C/div>
u003Cdiv class =" login_putin ">
u003Cul>
li> u003Cinput type = "text"> u003C/li>
u003Cli> u003Cinput type = "password"> u003C/li>
u003C/ul>
u003C/div>
u003Cdiv class = "login_btn">
u003Cinput type = "submit" value = "login">
u003C/div>
u003C/body>
u003C/ html>
style:
*{
margin: 0;
padding: 0;}
nli {
list- STYLE-TYPE: None;
margin: 0;
padding: 0;} r {
text-: none;
color:#000;}
/*------------------------------------------------------------------------------------------ ----------*/
.login_putin ul li input {
margin: 0;
width: 70%;
padding: 1EM 2em 1EM 5.4em;
-webkit-border-radius:. 3em;
-moz-border-radius: .3em;
border: 1px solid #999;
} r r
.login_btn {
width: 300px;
margin: 40px auto 0 auto;
}
n.log in_btn input {
width: 100%;
margin: 0;
padding: .5em 0;
-webkit -border -radius: .3em;
-moz -Border-radius:. .3em;
border:#1263be solid 1px;
:#1b85fd;
color: #fff;
font-size: 17px;
FONT-Weight: Bolder;
Letter-spacing: 1em;
} r
.login_btn input: Hover {
:#1263be;
}
Is this the effect?
u003C! Doctype html public "-// W3C // dtd xhtml 1.0 // en" /tr/xhtml1/dtdml1-.dtd"> rmitml xmlns = " /1999/xhtml ">
u003Chead>
u003CTitle> 3 u003C/title>
u003CScript>
Function r () n {
var username = document. ("username");
var pass = document. ("password");
if (username.value == "") {
alert ("Please enter the user name");
username.focus ();
return;
}
if (pass.value == "")
{
alert ("Please enter the password");
return;
}
Rturn true;
}
u003C/script>
u003C/head>
u003Cbody>
u003CFORM>
u003Ctable width = "350" bgcolor = "#ccffcc" style = "border-color" border = "1">
u003Ctr align = center>
u003Ctd> Username u003C/td> u003Ctd> u003Cinput type = "text" name = "username" id = "username"> u003C/td>
u003C/tr>
u003Ctr align = center> u003Ctd> password u003C/td> u003Ctd> u003Cinput type = "password" name = "password" id = "password"> u003C/td> u003C/td> /tr>
u003Ctr align = center> u003Ctd> verification code u003C/td> u003Ctd> u003Cinput type = "text" name = "yanzheng"> u003C/td> u003C/tr> n u003Ctr align = center> u003Ctd colorpan = "2"> u003Cin put type = "Button" value = "Login" onClick = "R (); n u003C/table>
u003C/form>
u003C/body>
u003C/html>
The general form should be like this:
u003C! Doctype html public "-// W3C // dtd xhtml 1.0 // en" /tr/xhtml1/dtdml1-.dtd"> rmitml xmlns = "//1999/xhtml">
u003Chead>
u003CTitle> 3 u003C/title>
u003C/head>
u003Cbody>
u003Cdiv Align = "center">
u003Cform action = "" name = "myform">
u003Ctable>
u003Ctr>
u003Ctd> Username: u003C/td>
u003Ctd> u003Cinput type = "text" id = "user"/> u003C/td>
u003C/tr>
u003Cl>
u003CTD> Password: u003C/ td>
u003Ctd> u003Cinput type = "text" id = "password"/> u003C/td>
u003C/tr>
u003Cl>
u003CTD> Verification verification Code: u003C/td>
u003Ctd align = "left"> u003Cinput type = "text" size = "5" id = "code"/> u003C/td> n u003C/tr>
u003C/table>
u003C/form>
u003CTable>
u003Ctr>
u003Ctd>
u003Cinput type = "submit" value = " Submit "OnClight = MyFun_submit () />
u003C /td>
u003Ctd>
u003Cinput type =" submit "value =" reset "onClick = myfun_reset () />
u003C/td>
u003C/tr>
u003C/table>
u003C/div>
u003Cscript type = "text/">
Function myfun_submit () {
var user_val = document. ("user"). Value;
var password_val = document. ("password"). Value;
if (user_val == "") R n
alert ("Username cannot be empty !!");
} else if (password_val == "") Is empty! Intersection Intersection ");
}
}
Function myfun_reset () {
docume. ("password"). Value = "" ";
document. (" code "). Value =" "";
n}
u003C/script>
u003C/ Body>
u003C/html>
00:00 / 09: 1770% shortcut keys to describe space: Play / suspend ESC: exit full screen ↑: increase volume 10% ↓: reduced volume decrease by 10% →: single fast forward 5 seconds ←: single fast retreat 5 seconds Press hold up and hold it up. Here you can drag no longer appear in the player settings to reopen the small window shortcut key description
In fact, this is quite complicated