用html和css实现校园网站登录界面

时间: 2024-03-17 13:43:22 浏览: 21
好的,我可以为您提供一份简单的校园网站登录界面的HTML和CSS代码,如下: HTML代码: ```html <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <title>校园网站登录界面</title> <link rel="stylesheet" href="style.css"> </head> <body> <div class="login-box"> <h2>校园网站登录</h2> <form> <div class="user-box"> <input type="text" name="" required=""> <label>用户名</label> </div> <div class="user-box"> <input type="password" name="" required=""> <label>密码</label> </div> <a href="#"> <span></span> <span></span> <span></span> <span></span> 登录 </a> </form> </div> </body> </html> ``` CSS代码: ```css *{ margin: 0; padding: 0; box-sizing: border-box; } body{ background: #1abc9c; font-family: sans-serif; } .login-box{ width: 280px; position: absolute; top: 50%; left: 50%; transform: translate(-50%,-50%); color: #fff; } .login-box h2{ text-align: center; margin-bottom: 20px; } .login-box form{ display: flex; flex-direction: column; justify-content: center; } .user-box{ position: relative; margin-bottom: 20px; } .user-box input{ width: 100%; padding: 10px 0; font-size: 16px; color: #fff; margin-bottom: 30px; border: none; border-bottom: 1px solid #fff; outline: none; background: transparent; } .user-box label{ position: absolute; top: 0; left: 0; padding: 10px 0; font-size: 16px; color: #fff; pointer-events: none; transition: .5s; } .user-box input:focus ~ label, .user-box input:valid ~ label{ top: -20px; left: 0; color: #03a9f4; font-size: 12px; } a{ display: inline-block; background: transparent; border: 2px solid #fff; padding: 14px 80px; color: #fff; font-size: 16px; text-transform: uppercase; letter-spacing: 2px; cursor: pointer; position: relative; overflow: hidden; transition: .5s; } a:hover{ background: #fff; color: #1abc9c; } a span{ position: absolute; display: block; } a span:nth-child(1){ top: 0; left: -100%; width: 100%; height: 2px; background: linear-gradient(90deg,transparent,#fff); } a:hover span:nth-child(1){ left: 100%; transition: 1s; } a span:nth-child(2){ top: -100%; right: 0; width: 2px; height: 100%; background: linear-gradient(180deg,transparent,#fff); } a:hover span:nth-child(2){ top: 100%; transition: .5s; } a span:nth-child(3){ bottom: 0; right: -100%; width: 100%; height: 2px; background: linear-gradient(270deg,transparent,#fff); } a:hover span:nth-child(3){ right: 100%; transition: .5s; } a span:nth-child(4){ bottom: -100%; left: 0; width: 2px; height: 100%; background: linear-gradient(360deg,transparent,#fff); } a:hover span:nth-child(4){ bottom: 100%; transition: .5s; } ``` 您可以将上述代码复制到您的HTML和CSS文件中,并进行一些微调,以适应您的网站需求。

相关推荐

最新推荐

recommend-type

html+css实现数据图表的展示效果

一下收集分享的数据图表的展示效果,是完全用html和css来实现的。通过仔细研究学习这些案例对于我们学习css会有很大帮助的。
recommend-type

HTML+CSS实现单选框、复选框美观的样式

主要介绍了HTML+CSS实现单选框、复选框美观的样式,需要的朋友可以参考下
recommend-type

html+css 实现简易导航栏功能

主要介绍了基于html+css 实现简易导航栏功能,主要就是css(级联样式表)对html的内容做格式化。具体内容详情大家跟随小编一起通过本文学习吧
recommend-type

HTML+CSS实现动态背景登录页面

主要介绍了HTML+CSS实现动态背景登录页面的相关资料,需要的朋友可以参考下
recommend-type

基于html和CSS3制作酷炫的导航栏

 5 使用html + css3 渐变画图 制作背景图片  6 更改颜色透明度  7 DIV制作边框阴影 先看效果图:   CSS Code复制内容到剪贴板 &lt;!doctype html&gt;  html lang="en"&gt;  &lt;head&gt;  &lt;meta ...
recommend-type

zigbee-cluster-library-specification

最新的zigbee-cluster-library-specification说明文档。
recommend-type

管理建模和仿真的文件

管理Boualem Benatallah引用此版本:布阿利姆·贝纳塔拉。管理建模和仿真。约瑟夫-傅立叶大学-格勒诺布尔第一大学,1996年。法语。NNT:电话:00345357HAL ID:电话:00345357https://theses.hal.science/tel-003453572008年12月9日提交HAL是一个多学科的开放存取档案馆,用于存放和传播科学研究论文,无论它们是否被公开。论文可以来自法国或国外的教学和研究机构,也可以来自公共或私人研究中心。L’archive ouverte pluridisciplinaire
recommend-type

MATLAB图像处理算法宝典:从理论到实战

![MATLAB图像处理算法宝典:从理论到实战](https://img-blog.csdnimg.cn/20200717112736401.png?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L2d1emhhbzk5MDE=,size_16,color_FFFFFF,t_70) # 1. MATLAB图像处理基础理论 MATLAB图像处理是一种利用MATLAB编程语言进行图像处理的强大工具。它提供了丰富的函数和工具箱,用于图像获取、增强、分
recommend-type

matlab中1/x的非线性规划

在MATLAB中,可以使用非线性规划函数(`fmincon`)来优化一个包含1/x的非线性目标函数。下面是一个简单的例子: ```matlab % 定义目标函数 fun = @(x) 1/x; % 定义约束函数(这里没有约束) nonlcon = []; % 定义初始点 x0 = 1; % 定义优化选项 options = optimoptions('fmincon', 'Display', 'iter'); % 进行非线性规划 [x, fval] = fmincon(fun, x0, [], [], [], [], [], [], nonlcon, options); ``` 在
recommend-type

JSBSim Reference Manual

JSBSim参考手册,其中包含JSBSim简介,JSBSim配置文件xml的编写语法,编程手册以及一些应用实例等。其中有部分内容还没有写完,估计有生之年很难看到完整版了,但是内容还是很有参考价值的。