本篇文章给大家带来的内容是关于如何使用css布局一个登陆表单,有一定的参考价值,有需要的朋友可以参考一下,希望对你有所帮助。
css布局制作一个登陆表单
这个案例主要制作的是一个登录表单,在这个案例中使用了box-shadow、gradient,transform和transition等属 性,其中最难的地方是输入框被咬的那部分,原本使用纯CSS3的渐变配合多背景制作,但受限于阴影,最终改变使用base的64位图像处理。详细的参考代 码吧:
HTML 结构:
<div class="box"> <form action="#" method="get"> <ul> <li> <label for="username">Email:</label><input type="text" id="username" class="username" placeholder="john.smith@strategysoft.com"/> </li> <li> <label for="password">Password:</label><input type="password" id="password" class="password" placeholder="******"/> </li> </ul> <a href="javascript:;" class="button"/><i class="icon-arrow-right"></i></a> </form> </div> CSS代码: body,ul{ margin: 0; padding: 0 } a { color: rgb(1, 124, 185); text-decoration: none; } input:focus { outline: none 0; } body{ color: #b5b5b5; font: 14px 'Arial'; } body, li:first-child:after, li:last-child:after{ background-image: url(data:image/png;base64,…);/**/ } .box{ position: relative; width: 384px; height: 140px; margin: 50px auto; } .box li{ list-style-type: none; margin-bottom: 10px; border-radius: 5px; overflow: hidden; position: relative; height: 42px; } .box li input{ box-shadow:inset 0 0 5px rgba(0,0,0,.5),-1px 1px 0 rgba(255,255,255,.05); border:0 none; padding:8px 5px 5px; border-radius: 5px; width:300px; height: 28px; -webkit-box-sizing: content-box; -moz-box-sizing: content-box; -o-box-sizing: content-box; -ms-box-sizing: content-box; box-sizing: content-box; background: rgba(0,0,0,.1); color: #fff; } .box li:first-child:after, .box li:last-child:after{ position: absolute; width: 50px; height: 50px; content: ""; border-radius: 25px; z-index: 2; right: -23px; box-shadow: 0 0 8px rgba(0,0,0,.5); } ::-webkit-input-placeholder { color:#fff; font-weight: bold; } .box li:first-child:after{ top: 15px; } .box li:last-child:after{ bottom:15px; } .box label{ width: 70px; display: inline-block; text-align: right; } .box span{ display: block; color: #6296b4; padding-left: 75px; } .button{ position: absolute; top: 24px; right: -30px; width: 44px; height: 44px; border-radius: 22px; border:1px solid #00a1d2; background: -webkit-linear-gradient(top,#029ecd,#0d7796); color: #fff; text-shadow:1px 1px 0 #666; box-shadow:0 0 0 5px #2c2c2c; z-index: 3; text-align: center; line-height: 46px; -webkit-transition: all 0.28s ease-in; -moz--transition: all 0.28s ease-in; } .button:hover{ -webkit-transform:rotate(90deg); } @font-face { font-family: 'FontAwesome'; src: url('font/fontawesome-webfont.eot'); src: url('font/fontawesome-webfont.eot?#iefix') format('embedded-opentype'), url('font/fontawesome-webfont.woff') format('woff'), url('font/fontawesome-webfont.ttf') format('truetype'), url('font/fontawesome-webfont.svg#FontAwesome') format('svg'); font-weight: normal; font-style: normal; } .icon-arrow-right:before { font-family: FontAwesome; font-weight: normal; font-size: 26px; font-style: normal; display: inline-block; text-decoration: inherit; content: "\f061"; }
以上就是对如何使用css布局一个登陆表单的全部介绍,如果您想了解更多有关CSS教程,请关注PHP中文网。
以上是如何使用css布局一个登陆表单的详细内容。更多信息请关注PHP中文网其他相关文章!

Internet Explorer(IE)11与其他所有主要浏览器之间的距离是越来越多的鸿沟。增加对技术过时的支持

莫里斯·马汉(Maurice Mahan)创建了FocusOverlay,这是一个“用于创建重点元素叠加的库”。该描述对您有些困惑,不需要一个库

所有这些网站都想帮助您进行图像。他们做一些事情,例如优化您的图像并帮助您执行表演。那是一件非常好的事情。通过任何指标,图像是资源的主要部分

WordPress在5.0版中运回了Block Editor(又名Gutenberg),然后带来了一个时髦的新帖子预览屏幕,显示WordPress徽标绘图

WordPress生态系统具有大量的插件,可提供从放大器到Zapier集成的所有内容,因此,介于两者之间。


热AI工具

Undresser.AI Undress
人工智能驱动的应用程序,用于创建逼真的裸体照片

AI Clothes Remover
用于从照片中去除衣服的在线人工智能工具。

Undress AI Tool
免费脱衣服图片

Clothoff.io
AI脱衣机

AI Hentai Generator
免费生成ai无尽的。

热门文章

热工具

VSCode Windows 64位 下载
微软推出的免费、功能强大的一款IDE编辑器

EditPlus 中文破解版
体积小,语法高亮,不支持代码提示功能

SublimeText3 Linux新版
SublimeText3 Linux最新版

Dreamweaver CS6
视觉化网页开发工具

DVWA
Damn Vulnerable Web App (DVWA) 是一个PHP/MySQL的Web应用程序,非常容易受到攻击。它的主要目标是成为安全专业人员在合法环境中测试自己的技能和工具的辅助工具,帮助Web开发人员更好地理解保护Web应用程序的过程,并帮助教师/学生在课堂环境中教授/学习Web应用程序安全。DVWA的目标是通过简单直接的界面练习一些最常见的Web漏洞,难度各不相同。请注意,该软件中