【HTML】:写一个简单的登陆/注册界面

您所在的位置:网站首页 html的登录页面 【HTML】:写一个简单的登陆/注册界面

【HTML】:写一个简单的登陆/注册界面

2023-08-18 00:54| 来源: 网络整理| 查看: 265

先在body中把最基础的标签写出来

现在页面运行出来是这样的

就是一个没有任何样式的基础界面:

接下来我们为这些标签加上样式

首先还是让页面所有元素的padding和margin都设置为0,

清除浏览器本身对界面的影响:

然后加上背景图,并且将字体设置为微软雅黑

接下来给整个登陆框设置样式

并且让登陆框绝对居中,会使用到绝对位置属性

给h1标签加上样式

给两个输入框设置样式,border给输入框设置边框线样式、粗细和颜色;

border-radius属性给边框设置圆角角度,像素越接近10,弧度越大

给登陆和注册按钮设置样式,

样式设置完,界面就是这样的

 

代码实现如下

DOCTYPE html> 登录 *{margin:0; padding:0; box-sizing:border-box; } body { background: url(./img/timg.jpg) no-repeat center 0px fixed; background-size: cover; font-family: "微软雅黑", sans-serif; } .login { position: absolute; top: 50%; left: 50%; margin: -150px 0 0 -150px; width:300px; height:300px; } .login h1 { color:#555555; text-shadow: 0px 10px 10px #CDC673; letter-spacing:2px;text-align:center; margin-bottom:20px; } input{ padding:10px; width:100%; color:white; margin-bottom:10px; background-color:#555555; border: 1px solid black; border-radius:5px; letter-spacing:2px; } form button{ width:100%; padding:10px; margin-bottom:10px; background-color:#CDC673; border:1px solid black; border-radius:5px; cursor:pointer; } Login 登录 注册

若要实现页面跳转可以加入a标签,使跳转到注册界面。

 



【本文地址】


今日新闻


推荐新闻


CopyRight 2018-2019 办公设备维修网 版权所有 豫ICP备15022753号-3