Kali ini saya akan memberi contoh cara Form Login User
seperti gambar di atas, oke langsung kita mulai :
- Pertama :
atau kamu cari sendiri,dan
dowload avatarnya di sini.
siapkan folder untuk images untuk menyimpan gambar
- Kedua :
membuat halaman index ,
copy code di bawah untuk halaman index.html :
<!DOCTYPE html>
<html>
<head>
<title>User Login Flat Responsive widget Template</title>
<meta name="viewport" content="width=device-width,
initial-scale=1">
<script type="application/x-javascript">
addEventListener("load", function()
{ setTimeout(hideURLbar, 0); }, false); function hideURLbar()
{ window.scrollTo(0,1); } </script>
<meta name="keywords" content="User Login Form Responsive Templates, Iphone Widget Template,
Smartphone login forms,Login form, Widget Template,
Responsive Templates, a Ipad 404 Templates, Flat Responsive Templates" />
<link href="css/style.css" rel='stylesheet'
type='text/css' />
<!--web-fonts-->
<link href='http://fonts.googleapis.com/css?family=Montserrat:400,700'
rel='stylesheet' type='text/css'>
<!--/web-fonts-->
</head>
<body>
<!--User-Login-->
<h1>User Login</h1>
<div class="avtar">
<img src="images/avtar.png" />
</div>
<div class="login-form">
<p>New user?<a href="#">Register here!</a></p>
<form>
<div class="form-text">
<input type="text" class="text" value="USERNAME" onfocus="this.value = '';" onblur="if
(this.value == '') {this.value = 'USERNAME';}" >
<input type="password" value="Password"
onfocus="this.value = '';" onblur="if (this.value == '')
{this.value = 'Password';}"></div>
<input type="submit"value="GO" >
</form></div>
<!--/User-Login-->
<!--start-copyright-->
<div class="copy-right">
<p>by <a href="http://devclod.blogspot.com">Devclod</a>
</p>
</div>
<!--//end-copyright-->
</body>
</html>
Ketiga :
buat folder CSS untuk menyimpan file css yang bernama style.css
langsung copy code di bawah untuk css :
html,body,div,span,applet,object, iframe,h1,h2,h3,h4,h5,h6,p ,blockquote,pre,a,abbr,acronym, address,big,cite,code,del,dfn,em, img,ins,kbd,q,s,samp,small,strike, strong,sub,sup,tt,var,b,u,i,dl,dt,dd,ol,nav ul,nav li,fieldset,form,label,legend ,table,caption,tbody,tfoot, thead,tr,th,td,article,aside, canvas,details,embed,figure, figcaption,footer,header,hgroup, menu,nav,output,ruby,section,summary, time,mark,audio, video{margin:0;padding:0;border:0;font-size:100%;font:inherit;vertical-align:baseline;} article, aside, details, figcaption, figure,footer, header, hgroup, menu, nav, section {display: block;} ol,ul{list-style:none;margin: 0px;padding:0px;} blockquote,q{quotes:none;} blockquote :before,blockquote:after, q:before, q:after{content:'';content:none;} table {border-collapse:collapse;border-spacing:0;} /* start editing from here */ a{text-decoration:none;} .txt-rt{text-align:right;} /* text align right */ .txt-lt{text-align:left;} /* text align left */ .txt-center{text-align:center;} /* text align center */ .float-rt{float:right;} /* float right */ .float-lt{float:left;} /* float left */ .clear{clear:both;} /* clear float */ .pos-relative{position:relative;} /* Position Relative */ .pos-absolute{position:absolute;} /* Position Absolute */ .vertical-base{ vertical-align:baseline;} /* vertical align baseline */ .vertical-top{ vertical-align:top;} /* vertical align top */ nav.vertical ul li{ display:block;}/* vertical menu */ nav.horizontal ul li{ display: inline-block;} /* horizontal menu */ img{max-width:100%;} /*end reset*/ body{ background: url(../images/bg.jpg)no-repeat; font-family: 'Montserrat', sans-serif; background-size: 100% 135%; } .wrap{ margin: 0 auto; width: 80%; } body a,form li,input[type="submit"], input[type="text"], .sixth-login input[type="submit"],.third-login input[type="submit"]{ transition: 0.1s all; -webkit-transition: 0.1s all; -moz-transition: 0.1s all; -o-transition: 0.1s all; } h1 { text-align: center; color: #ffffff; font-size: 3em; font-weight: 100; padding-top: 2em; } .avtar{ width: 177px; height: 220px; margin: 2% auto 0 auto; padding-bottom: 1em; background-size: 100%; } .login-form { width: 33%; height: 100%; margin: 0 auto; text-align: center; position: relative; } form { padding-top: 1em; background: #dee1e8; border-radius: .4em; } form li{ list-style: none; margin-bottom: 25px; width: 100%; background: #b73338; border-radius: 0.3em; -webkit-border-radius: 0.3em; -o-border-radius: 0.3em; -moz-border-radius: 0.3em; } input[type="text"] { font-family: 'Open Sans', sans-serif; width: 40%; padding: 1em 1em 1em 1em; color: #3D3E6A; font-size: 14px; outline: none; background: #f5f6f7; border: none; font-weight: 100; margin-bottom: 1em; border: 1px solid#A8AEC5; border-radius: .4em; -webkit-border-radius: 0.4em; -o-border-radius: 0.4em; -moz-border-radius: 0.4em; } input[type="password"]{ font-family: 'Open Sans', sans-serif; width: 40%; padding: 1em 1em 1em 1em; color: #3D3E6A; font-size: 14px; outline: none; background: #f5f6f7; border: none; margin-bottom: 1em; border: 1px solid#A8AEC5; border-radius: .4em; -webkit-border-radius: 0.4em; -o-border-radius: 0.4em; -moz-border-radius: 0.4em; } input[type="submit"] { background: #ff6600; padding: .8em .6em .8em .6em; outline: none; border: none; font-size: 1em; cursor: pointer; width: 8%; color: #fff; text-transform: uppercase; font-weight: bold; border-top-right-radius: .4em; -webkit-border-top-right-radius: .4em; -o-border-top-right-radius: .4em; -moz-border-top-right-radius: .4em; border-bottom-right-radius: .4em; -webkit-border-bottom-right-radius: .4em; -o-border-bottom-right-radius: .4em; -moz-border-bottom-right-radius: .4em; position: absolute; top: 57%; right: -8%; } input[type="submit"]:hover { background: #1B2E68; color: #fff; } .login-form p { padding-bottom: 2em; color: #fff; font-weight: 100; font-size: 1.2em; } .login-form p a { text-decoration: underline; font-weight: 600; margin-left: 7px; color:#fff; } .login-form p a:hover { color: #1B2E68; } .copy-right { text-align: center; padding-top: 10em; color: #fff; } .copy-right p a { color: #FFF; } .copy-right p a:hover { color: #ff6600; } /*--start-responsive-design--*/ @media (max-width:1440px){ } @media (max-width:1366px){ input[type="submit"] { width: 10%; right: -10%; } .copy-right { padding-top: 5em; } } @media (max-width:1024px){ .login-form { width: 48%; } h1 { padding-top: 1em; } } @media (max-width:768px){ .login-form { width: 60%; } body { background-size: 100% 160%; } .avtar { margin: 8% auto 0 auto; } h1 { padding-top: 3em; } } @media (max-width:640px){ .login-form { width: 70%; } .avtar { margin: 8% auto 0 auto; } } @media (max-width:480px){ .login-form { width: 84%; margin: 2% 0% 0% 4%; text-align: center; } } @media (max-width:320px){ .avtar img { width: 60%; } .avtar { text-align: center; width: 160px; height: 105px; margin: 10% auto 0 auto; padding-bottom: 0; background-size: 0; } input[type="text"] { width: 38%; padding: 1em 1em 1em 1em; font-size: 10px; } input[type="password"] { width: 38%; font-size: 10px; } input[type="submit"] { width: 12%; right: -12%; font-size: 10px; top: 64%; padding: .9em .6em .9em .6em; } .copy-right { padding-top: 5em; } h1 { padding-top: 1em; font-size: 2em; } .login-form p { margin-left: 1em; } } oke selesai, tinggal lihat hasilnya aja di browser.
0 comments: