首页 技术 正文
技术 2022年11月12日
0 收藏 339 点赞 3,776 浏览 1586 个字

首先来张完工的效果图。

CSS样式案例(2)-制作一个简单的登录界面

一、html文件如下:

<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>登录界面</title>
<link rel="stylesheet" type="text/css" href="css/login.css" rel="external nofollow" />
</head>
<body> <div class="content">
<div class="panel">
<div class="group">
<ul>
<li><label>账号</label></li>
<li><input type="text" placeholder=" 请输入账号" /></li>
</ul>
<ul>
<li><label>密码</label></li>
<li><input type="password" placeholder=" 请输入密码" /></li>
</ul>
</div>
<div class="login">
<button type="button">登录</button>
</div>
</div>
<div class="register">
<button type="button">注册</button>
<button type="button">找回密码</button>
</div>
</div>
</body>
</html>

二、对应的login.css文件如下,需要将CSS文件放到对应的CSS文件夹中:

*{
margin:0 auto;
padding:;
}
/*添加一个浅灰色背景*/
body{
background-color:#eee;
}.content{
/*border:1px solid red;*/
width:300px;
margin-top:50px;
}.content .panel{
border:1px solid #ccc;
border-radius:5px;
height:220px;
background-color:#fff;
}
.content .panel .group{
margin:30px 10px 10px 20px;
}
.content .panel .group ul{
list-style: none;
margin-top:15px;
}.content .panel .group ul li{
margin-top:2px;
}.content .panel .group ul li input{
line-height:22px;
width:250px;
font-size: 14px;
font-family: "微软雅黑","宋体";
}
.content .panel .group ul li label{
font-size: 14px;
font-family: "黑体","微软雅黑","宋体";
font-weight: bold;
}.content .panel .login{
text-align: center;
/*border:1px solid red;*/
margin-top:20px;}
.content button{
width:255px;
height:30px;
background-color:#008000;
border:none;
color:#fff;
font-size:16px;
font-weight: bold;
cursor:pointer;
}.content .register{
margin-top:15px;
text-align: center;
}.content .register button{
width:80px;
height:30px;
border:none;
font-size:14px;
background-color:#4c6bb2;
color:#fff;
font-family: "微软雅黑";
text-align: center;
margin-left:30px;}
相关推荐
python开发_常用的python模块及安装方法
adodb:我们领导推荐的数据库连接组件bsddb3:BerkeleyDB的连接组件Cheetah-1.0:我比较喜欢这个版本的cheeta…
日期:2022-11-24 点赞:878 阅读:9,489
Educational Codeforces Round 11 C. Hard Process 二分
C. Hard Process题目连接:http://www.codeforces.com/contest/660/problem/CDes…
日期:2022-11-24 点赞:807 阅读:5,904
下载Ubuntn 17.04 内核源代码
zengkefu@server1:/usr/src$ uname -aLinux server1 4.10.0-19-generic #21…
日期:2022-11-24 点赞:569 阅读:6,737
可用Active Desktop Calendar V7.86 注册码序列号
可用Active Desktop Calendar V7.86 注册码序列号Name: www.greendown.cn Code: &nb…
日期:2022-11-24 点赞:733 阅读:6,490
Android调用系统相机、自定义相机、处理大图片
Android调用系统相机和自定义相机实例本博文主要是介绍了android上使用相机进行拍照并显示的两种方式,并且由于涉及到要把拍到的照片显…
日期:2022-11-24 点赞:512 阅读:8,128
Struts的使用
一、Struts2的获取  Struts的官方网站为:http://struts.apache.org/  下载完Struts2的jar包,…
日期:2022-11-24 点赞:671 阅读:5,291