当前位置: 首页 > news >正文

网站的基本知识wordpress 去掉左上角

网站的基本知识,wordpress 去掉左上角,网络工程师考试报名官网,保洁公司开发app在前端开发中#xff0c;登录注册页面是最常见的需求之一。一个设计精美、交互友好的登录注册页面不仅能提升用户体验#xff0c;还能增加产品的专业度。本文将详细介绍如何使用 Tailwind CSS 开发一个现代化的登录注册页面。 设计思路 在开始编码之前#xff0c;我们先明…在前端开发中登录注册页面是最常见的需求之一。一个设计精美、交互友好的登录注册页面不仅能提升用户体验还能增加产品的专业度。本文将详细介绍如何使用 Tailwind CSS 开发一个现代化的登录注册页面。 设计思路 在开始编码之前我们先明确设计要点 视觉层次 使用合适的间距和阴影创造层次感重要信息突出显示次要信息适当弱化 响应式设计 移动端优先适配各种屏幕尺寸合理的布局变化 用户体验 清晰的视觉反馈平滑的动画过渡友好的错误提示 可访问性 语义化 HTML 结构键盘操作支持屏幕阅读器支持 基础结构实现 首先我们来实现登录表单的基础结构 !-- login.html -- div classmin-h-screen bg-gray-50 flex flex-col justify-center py-12 sm:px-6 lg:px-8div classsm:mx-auto sm:w-full sm:max-w-md!-- Logo --img classmx-auto h-12 w-auto src/logo.svg altLogoh2 classmt-6 text-center text-3xl font-extrabold text-gray-900登录您的账号/h2p classmt-2 text-center text-sm text-gray-600或者a href# classfont-medium text-indigo-600 hover:text-indigo-500注册新账号/a/p/divdiv classmt-8 sm:mx-auto sm:w-full sm:max-w-mddiv classbg-white py-8 px-4 shadow sm:rounded-lg sm:px-10form classspace-y-6 action# methodPOST!-- 表单内容 --/form/div/div /div 这个结构使用了以下 Tailwind CSS 类 min-h-screen: 确保容器至少占满整个视口高度bg-gray-50: 设置浅灰色背景营造柔和的视觉效果flex flex-col justify-center: 使用 Flexbox 居中内容sm:max-w-md: 在小屏幕以上限制最大宽度shadow sm:rounded-lg: 添加阴影和圆角提升层次感 表单组件开发 1. 输入框组件 divlabel foremail classblock text-sm font-medium text-gray-700邮箱地址/labeldiv classmt-1 relative rounded-md shadow-sminputidemailnameemailtypeemailrequiredclassappearance-none block w-full px-3 py-2 border border-gray-300 rounded-md placeholder-gray-400 focus:outline-none focus:ring-indigo-500 focus:border-indigo-500 sm:text-sm transition duration-150 ease-in-outplaceholderyourexample.com!-- 错误提示 --div classhidden absolute inset-y-0 right-0 pr-3 flex items-center pointer-events-nonesvg classh-5 w-5 text-red-500 fillcurrentColor viewBox0 0 20 20path fill-ruleevenodd dM18 10a8 8 0 11-16 0 8 8 0 0116 0zm-7 4a1 1 0 11-2 0 1 1 0 012 0zm-1-9a1 1 0 00-1 1v4a1 1 0 102 0V6a1 1 0 00-1-1z clip-ruleevenodd //svg/div/div!-- 错误消息 --p classhidden mt-2 text-sm text-red-600请输入有效的邮箱地址/p /div 输入框的样式设计要点 使用 shadow-sm 添加细微阴影通过 focus:ring 实现聚焦时的光环效果添加 transition 实现平滑的状态切换使用相对定位放置错误图标 2. 密码输入框 divlabel forpassword classblock text-sm font-medium text-gray-700密码/labeldiv classmt-1 relativeinputidpasswordnamepasswordtypepasswordrequiredclassappearance-none block w-full px-3 py-2 border border-gray-300 rounded-md placeholder-gray-400 focus:outline-none focus:ring-indigo-500 focus:border-indigo-500 sm:text-sm transition duration-150 ease-in-out!-- 显示/隐藏密码按钮 --buttontypebuttonclassabsolute inset-y-0 right-0 pr-3 flex items-center text-gray-400 hover:text-gray-500οnclicktogglePassword()svg classh-5 w-5 fillnone viewBox0 0 24 24 strokecurrentColorpath stroke-linecapround stroke-linejoinround stroke-width2 dM15 12a3 3 0 11-6 0 3 3 0 016 0z /path stroke-linecapround stroke-linejoinround stroke-width2 dM2.458 12C3.732 7.943 7.523 5 12 5c4.478 0 8.268 2.943 9.542 7-1.274 4.057-5.064 7-9.542 7-4.477 0-8.268-2.943-9.542-7z //svg/button/div /divscript function togglePassword() {const password document.getElementById(password);password.type password.type password ? text : password; } /script 3. 记住登录选项 div classflex items-center justify-betweendiv classflex items-centerinputidremember_menameremember_metypecheckboxclassh-4 w-4 text-indigo-600 focus:ring-indigo-500 border-gray-300 rounded transition duration-150 ease-in-outlabel forremember_me classml-2 block text-sm text-gray-900记住登录/label/divdiv classtext-sma href# classfont-medium text-indigo-600 hover:text-indigo-500 transition duration-150 ease-in-out忘记密码/a/div /div 4. 登录按钮 divbuttontypesubmitclassw-full flex justify-center py-2 px-4 border border-transparent rounded-md shadow-sm text-sm font-medium text-white bg-indigo-600 hover:bg-indigo-700 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-indigo-500 transition duration-150 ease-in-outspan classrelative!-- Loading 状态 --svgclasshidden absolute -left-6 h-5 w-5 animate-spin text-whitexmlnshttp://www.w3.org/2000/svgfillnoneviewBox0 0 24 24circle classopacity-25 cx12 cy12 r10 strokecurrentColor stroke-width4/circlepath classopacity-75 fillcurrentColor dM4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z/path/svg登录/span/button /div 社交登录集成 div classmt-6div classrelativediv classabsolute inset-0 flex items-centerdiv classw-full border-t border-gray-300/div/divdiv classrelative flex justify-center text-smspan classpx-2 bg-white text-gray-500或通过以下方式登录/span/div/divdiv classmt-6 grid grid-cols-3 gap-3divahref#classw-full inline-flex justify-center py-2 px-4 border border-gray-300 rounded-md shadow-sm bg-white text-sm font-medium text-gray-500 hover:bg-gray-50 transition duration-150 ease-in-outspan classsr-onlySign in with GitHub/spansvg classw-5 h-5 fillcurrentColor viewBox0 0 20 20path fill-ruleevenodd dM10 0C4.477 0 0 4.484 0 10.017c0 4.425 2.865 8.18 6.839 9.504.5.092.682-.217.682-.483 0-.237-.008-.868-.013-1.703-2.782.605-3.369-1.343-3.369-1.343-.454-1.158-1.11-1.466-1.11-1.466-.908-.62.069-.608.069-.608 1.003.07 1.531 1.032 1.531 1.032.892 1.53 2.341 1.088 2.91.832.092-.647.35-1.088.636-1.338-2.22-.253-4.555-1.113-4.555-4.951 0-1.093.39-1.988 1.029-2.688-.103-.253-.446-1.272.098-2.65 0 0 .84-.27 2.75 1.026A9.564 9.564 0 0110 4.844c.85.004 1.705.115 2.504.337 1.909-1.296 2.747-1.027 2.747-1.027.546 1.379.203 2.398.1 2.651.64.7 1.028 1.595 1.028 2.688 0 3.848-2.339 4.695-4.566 4.942.359.31.678.921.678 1.856 0 1.338-.012 2.419-.012 2.747 0 .268.18.58.688.482A10.019 10.019 0 0020 10.017C20 4.484 15.522 0 10 0z clip-ruleevenodd //svg/a/divdivahref#classw-full inline-flex justify-center py-2 px-4 border border-gray-300 rounded-md shadow-sm bg-white text-sm font-medium text-gray-500 hover:bg-gray-50 transition duration-150 ease-in-outspan classsr-onlySign in with Google/spansvg classw-5 h-5 viewBox0 0 24 24path fillcurrentColor dM12.48 10.92v3.28h7.84c-.24 1.84-.853 3.187-1.787 4.133-1.147 1.147-2.933 2.4-6.053 2.4-4.827 0-8.6-3.893-8.6-8.72s3.773-8.72 8.6-8.72c2.6 0 4.507 1.027 5.907 2.347l2.307-2.307C18.747 1.44 16.133 0 12.48 0 5.867 0 .307 5.387.307 12s5.56 12 12.173 12c3.573 0 6.267-1.173 8.373-3.36 2.16-2.16 2.84-5.213 2.84-7.667 0-.76-.053-1.467-.173-2.053H12.48z//svg/a/divdivahref#classw-full inline-flex justify-center py-2 px-4 border border-gray-300 rounded-md shadow-sm bg-white text-sm font-medium text-gray-500 hover:bg-gray-50 transition duration-150 ease-in-outspan classsr-onlySign in with WeChat/spansvg classw-5 h-5 viewBox0 0 24 24path fillcurrentColor dM8.691 2.188C3.891 2.188 0 5.476 0 9.53c0 2.212 1.17 4.203 3.002 5.55a.59.59 0 0 1 .213.665l-.39 1.48c-.019.07-.048.141-.048.213 0 .163.13.295.29.295a.326.326 0 0 0 .167-.054l1.903-1.114a.864.864 0 0 1 .717-.098 10.16 10.16 0 0 0 2.837.403c.276 0 .543-.027.811-.05-.857-2.578.157-4.972 1.932-6.446 1.703-1.415 3.882-1.98 5.853-1.838-.576-3.583-4.196-6.348-8.596-6.348zM5.785 5.991c.642 0 1.162.529 1.162 1.18a1.17 1.17 0 0 1-1.162 1.178A1.17 1.17 0 0 1 4.623 7.17c0-.651.52-1.18 1.162-1.18zm5.813 0c.642 0 1.162.529 1.162 1.18a1.17 1.17 0 0 1-1.162 1.178 1.17 1.17 0 0 1-1.162-1.178c0-.651.52-1.18 1.162-1.18zm5.34 2.867c-1.797-.052-3.746.512-5.28 1.786-1.72 1.428-2.687 3.72-1.78 6.22.942 2.453 3.666 4.229 6.884 4.229.826 0 1.622-.12 2.361-.336a.722.722 0 0 1 .598.082l1.584.926a.272.272 0 0 0 .14.047c.134 0 .24-.111.24-.247 0-.06-.023-.12-.038-.177l-.327-1.233a.49.49 0 0 1-.011-.165.496.496 0 0 1 .189-.39C23.088 18.255 24.1 16.557 24.1 14.66c0-3.475-3.246-5.802-7.162-5.802zm-2.786 3.079c.535 0 .969.44.969.982a.976.976 0 0 1-.969.983.976.976 0 0 1-.969-.983c0-.542.434-.982.97-.982zm4.844 0c.535 0 .969.44.969.982a.976.976 0 0 1-.969.983.976.976 0 0 1-.969-.983c0-.542.434-.982.969-.982z//svg/a/div/div /div 响应式适配 我们的设计采用移动优先的原则使用 Tailwind CSS 的响应式前缀来处理不同屏幕尺寸 div classmin-h-screen bg-gray-50 flex flex-col justify-center py-12 sm:px-6 lg:px-8!-- 容器宽度控制 --div classsm:mx-auto sm:w-full sm:max-w-md!-- Logo 尺寸控制 --img classmx-auto h-10 w-auto sm:h-12 src/logo.svg altLogo!-- 标题字体大小控制 --h2 classmt-6 text-center text-2xl sm:text-3xl font-extrabold text-gray-900登录您的账号/h2/div!-- 表单容器 --div classmt-8 sm:mx-auto sm:w-full sm:max-w-mddiv classbg-white py-8 px-4 shadow sm:rounded-lg sm:px-10!-- 表单内容 --/div/div /div 深色模式支持 Tailwind CSS 提供了优秀的深色模式支持我们只需添加 dark: 前缀 div classmin-h-screen bg-gray-50 dark:bg-gray-900div classbg-white dark:bg-gray-800 shadow sm:rounded-lgh2 classtext-gray-900 dark:text-gray-100登录您的账号/h2inputclassborder-gray-300 dark:border-gray-700 bg-white dark:bg-gray-800 text-gray-900 dark:text-gray-100/div /div 动画效果 为了提升用户体验我们添加了一些细微的动画效果 !-- 错误提示动画 -- div classtransform transition-all duration-300 ease-in-outtranslate-y-0 opacity-100 scale-100p classtext-red-600请输入有效的邮箱地址/p /div!-- 加载动画 -- svg classanimate-spin h-5 w-5 text-white!-- 省略 SVG 内容 -- /svg!-- 按钮悬停效果 -- button classtransform transition hover:scale-105 active:scale-95登录 /button 表单验证 使用 HTML5 原生验证配合自定义样式 form classspace-y-6 novalidatedivinputtypeemailrequiredpattern[a-z0-9._%-][a-z0-9.-]\.[a-z]{2,}$classpeer ...!-- 使用 peer 类实现依赖验证的样式 --p classmt-2 invisible peer-invalid:visible text-red-600 text-sm请输入有效的邮箱地址/p/div /formstyleinput:invalid {apply border-red-500 focus:border-red-500 focus:ring-red-500;} /style 性能优化 按需加载 // tailwind.config.js module.exports { purge: [./src/**/*.html,./src/**/*.vue,./src/**/*.jsx, ], // ... } 预加载关键样式 link relpreload href/css/critical.css asstyle 延迟加载非关键样式 link relstylesheet href/css/non-critical.css mediaprint οnlοadthis.mediaall 可访问性增强 !-- 添加 ARIA 标签 -- form roleform aria-label登录表单label foremail classsr-only邮箱地址/labelinputidemailnameemailtypeemailaria-requiredtruearia-invalidfalsearia-describedbyemail-errordiv idemail-error rolealert aria-livepolite!-- 错误消息 --/div /form 写在最后 本文详细介绍了如何使用 Tailwind CSS 开发一个现代化的登录注册页面包括 基础结构搭建表单组件开发社交登录集成响应式适配深色模式支持动画效果表单验证性能优化可访问性增强 通过合理使用 Tailwind CSS 的原子类我们不仅实现了美观的界面还确保了良好的用户体验和可维护性。这些代码和最佳实践可以直接应用到实际项目中。 如果觉得这篇文章对你有帮助别忘了点个赞
http://www.sczhlp.com/news/196614/

相关文章:

  • 大学生网站建设心得无代码制作网页
  • 建立网站的主机方式wordpress 免插件
  • 图库网站模板网站开发的原理
  • 怎样在百度上做推广网站新乡seo顾问
  • 网站降权不收录深圳市保障房申请网站
  • 做设计什么兼职网站建设万网站建设
  • 做游戏的网站有哪些免费毕业设计网站建设
  • 网站备案后怎么建网站外包网站开发合同
  • 网站后台邮箱设置网站建设开发数据库
  • 济南网站改版青岛网
  • 做网站要几天国内手机app开发公司
  • html5导航网站源码下载建设网站需要什么资质
  • 曼斯特(北京)网站建设公司提供营销单页网站
  • 怎样找素材做网站中国建设银行网站下载
  • 服务器主机管理系统建好后如何用它搭建网站seo管理工具
  • 如何在百度上建网站直播app开发要多少钱
  • 做网站所需知识网站开发能怎么赚钱
  • 佳易网页王广州seo关键词优化外包
  • aso搜索排名优化seo软件优化工具软件
  • 腾讯网站开发汕尾海丰建设规划局网站
  • 广东知名网站建设软件著作权含金量
  • 江西省住房和城乡建设厅的网站如何搭建php视频网站
  • 网站 提示建设中wordpress用户管理
  • 合肥知名网站建设公司巴塘网站建设
  • 网站 模板 html泊头做网站的
  • php网站安装包制作房产网签是什么意思 网签的意义是什么
  • 娄底网站设计做服装最好的网站建设
  • 外贸整合营销网站建站有哪些公司
  • 何时无需AI:数学与统计的实用价值
  • 云防护栏理论:应对云配置错误的安全防护策略