一个简单的注册页面,如有错误请指正(2.css)

2023-10-28 10:36

本文主要是介绍一个简单的注册页面,如有错误请指正(2.css),希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!

这段CSS代码定义了页面的样式,让我逐个解释其功能:

1. `* {}`:通配符选择器,用于将页面中的所有元素设置统一的样式。这里将margins和paddings设置为0,以去除默认的边距。

2. `div img {}`:选择页面中所有div元素内的img元素,并设定其样式。这里设置img元素的宽度为视窗宽度的100%(即铺满整个屏幕宽度),高度为15视口高度。

3. `.head`:定义一个类选择器,用于对位于页头的元素进行样式设置。

4. `.head-left`和`.head-right`:这两个类选择器分别用于对页头左侧和右侧的元素进行样式设置。设置了宽度、高度、字体大小、颜色、显示方式、背景颜色和底部边框等样式。

5. `.acc`和`.acc div`:这两个选择器分别用于对显示账号的元素进行样式设置。

6. `.name`和`.name input`:用于对显示姓名的元素进行样式设置。

7. `.add`和`.add div`:用于对显示地址的元素进行样式设置。

8. `.code`和`.code input`:用于对显示邮编的元素进行样式设置。

9. `.names`和`.names div`:用于对显示名字的元素进行样式设置。

10. `.gender span`和`.gender input`:用于对显示性别的元素进行样式设置。

11. `.gan-left`和`.print`:用于对显示性格和印象的元素进行样式设置。

12. `#imgs`:对ID为`imgs`的元素进行样式设置。

13. `.footer`和`.footer-f div`:用于对页脚的元素进行样式设置。

14. `#alert`:对ID为`alert`的元素进行样式设置,包括宽度、高度、背景色、显示和定位等。

15. `.popup-container`、`.popup-container h2`、`.popup-container p`和`.popup-container button`:用于对弹出框的元素进行样式设置,包括定位、背景色、边框、内边距、字体颜色等。

这段代码定义了页面的布局和各种元素的样式,通过对不同的元素应用不同的类选择器或ID选择器,实现了个性化的样式设置。

* {margin: 0;padding: 0;
}div img {width: 100vw;height: 15vh;
}.head {width: 100%;display: flex;
}.head-left {width: 50%;height: 40px;font-size: 12px;color: rgb(162, 162, 162);display: flex;background-color: #ebebeb;justify-content: center;align-items: center;border-bottom: 1px solid rgb(235, 235, 235);
}.head-left div {/* margin-top: 8%; */
}.head-right {width: 50%;height: 40px;font-size: 12px;color: rgb(162, 162, 162);display: flex;justify-content: center;align-items: center;border-bottom: 1px solid rgb(235, 235, 235);
}.head-right div {font-size: 15px;justify-content: center;/* margin-top: 4%; */
}.acc {width: 100%;margin-top: 10%;
}.acc div {width: 50%;font-size: 15px;text-align: center;
}.name {width: 80%;margin-left: 5%;
}.name input {width: 100%;margin-top: 10%;border: none;margin-left: 10%;border-bottom: 1px solid #b1b1b1;outline: none;
}.add {width: 100%;margin-top: 10%;
}.add div {width: 50%;font-size: 15px;text-align: center;
}.code {width: 80%;margin-left: 5%;
}.code input {width: 100%;margin-top: 10%;border: none;margin-left: 10%;border-bottom: 1px solid #b1b1b1;outline: none;
}.names {width: 100%;
}.names div {width: 50%;margin-top: 10%;font-size: 15px;text-align: center;
}.names input {width: 80%;margin-top: 10%;border: none;margin-left: 13%;border-bottom: 1px solid #b1b1b1;outline: none;
}.gender {width: 100%;margin-top: 10%;display: flex;
}.gender span {font-size: 15px;
}.gender input {width: 15px;margin-left: 2%;border-radius: 100%;font-size: 10vh;
}.gan-left {width: 30%;margin-left: 10%;font-size: 15px;
}.print {display: flex;align-items: flex-end;width: 60%;margin-top: 10%;font-size: 15px;margin-left: 10%;
}#imgs {width: 15vw;height: 10vh;border-radius: 50%;display: flex;align-items: center;
}.footer {width: 85%;height: 50px;position: relative;margin-top: 1%;margin-left: 10%;justify-content: center;background-color: #66b1ff;
}.footer-f {width: 100%;position: absolute;}.footer-f div {color: #fff;font-size: 15px;margin-top: 5%;text-align: center;justify-content: center;
}#alert {width: 80%;height: 50px;margin-left: 8%;background-color: #66b1ff;display: none;text-align: center;padding: 10px;text-align: center;position: fixed;top: 100px;
}.popup-container {position: fixed;top: 50%;left: 50%;transform: translate(-50%, -50%);background-color: #fff;border: 1px solid #ccc;padding: 20px;z-index: 9999;
}.popup-container h2 {margin: 0;color: #333;
}.popup-container p {margin: 10px 0;color: #555;
}.popup-container button {padding: 5px 10px;background-color: #66b1ff;color: #fff;border: none;cursor: pointer;
}

 

这篇关于一个简单的注册页面,如有错误请指正(2.css)的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!



http://www.chinasem.cn/article/292621

相关文章

CSS place-items: center解析与用法详解

《CSSplace-items:center解析与用法详解》place-items:center;是一个强大的CSS简写属性,用于同时控制网格(Grid)和弹性盒(Flexbox)... place-items: center; 是一个强大的 css 简写属性,用于同时控制 网格(Grid) 和 弹性盒(F

CSS实现元素撑满剩余空间的五种方法

《CSS实现元素撑满剩余空间的五种方法》在日常开发中,我们经常需要让某个元素占据容器的剩余空间,本文将介绍5种不同的方法来实现这个需求,并分析各种方法的优缺点,感兴趣的朋友一起看看吧... css实现元素撑满剩余空间的5种方法 在日常开发中,我们经常需要让某个元素占据容器的剩余空间。这是一个常见的布局需求

CSS Anchor Positioning重新定义锚点定位的时代来临(最新推荐)

《CSSAnchorPositioning重新定义锚点定位的时代来临(最新推荐)》CSSAnchorPositioning是一项仍在草案中的新特性,由Chrome125开始提供原生支持需... 目录 css Anchor Positioning:重新定义「锚定定位」的时代来了! 什么是 Anchor Pos

CSS中的Static、Relative、Absolute、Fixed、Sticky的应用与详细对比

《CSS中的Static、Relative、Absolute、Fixed、Sticky的应用与详细对比》CSS中的position属性用于控制元素的定位方式,不同的定位方式会影响元素在页面中的布... css 中的 position 属性用于控制元素的定位方式,不同的定位方式会影响元素在页面中的布局和层叠关

HTML5 getUserMedia API网页录音实现指南示例小结

《HTML5getUserMediaAPI网页录音实现指南示例小结》本教程将指导你如何利用这一API,结合WebAudioAPI,实现网页录音功能,从获取音频流到处理和保存录音,整个过程将逐步... 目录1. html5 getUserMedia API简介1.1 API概念与历史1.2 功能与优势1.3

全面解析HTML5中Checkbox标签

《全面解析HTML5中Checkbox标签》Checkbox是HTML5中非常重要的表单元素之一,通过合理使用其属性和样式自定义方法,可以为用户提供丰富多样的交互体验,这篇文章给大家介绍HTML5中C... 在html5中,Checkbox(复选框)是一种常用的表单元素,允许用户在一组选项中选择多个项目。本

HTML5 搜索框Search Box详解

《HTML5搜索框SearchBox详解》HTML5的搜索框是一个强大的工具,能够有效提升用户体验,通过结合自动补全功能和适当的样式,可以创建出既美观又实用的搜索界面,这篇文章给大家介绍HTML5... html5 搜索框(Search Box)详解搜索框是一个用于输入查询内容的控件,通常用于网站或应用程

SpringBoot排查和解决JSON解析错误(400 Bad Request)的方法

《SpringBoot排查和解决JSON解析错误(400BadRequest)的方法》在开发SpringBootRESTfulAPI时,客户端与服务端的数据交互通常使用JSON格式,然而,JSON... 目录问题背景1. 问题描述2. 错误分析解决方案1. 手动重新输入jsON2. 使用工具清理JSON3.

CSS3中的字体及相关属性详解

《CSS3中的字体及相关属性详解》:本文主要介绍了CSS3中的字体及相关属性,详细内容请阅读本文,希望能对你有所帮助... 字体网页字体的三个来源:用户机器上安装的字体,放心使用。保存在第三方网站上的字体,例如Typekit和Google,可以link标签链接到你的页面上。保存在你自己Web服务器上的字

基于Python实现一个简单的题库与在线考试系统

《基于Python实现一个简单的题库与在线考试系统》在当今信息化教育时代,在线学习与考试系统已成为教育技术领域的重要组成部分,本文就来介绍一下如何使用Python和PyQt5框架开发一个名为白泽题库系... 目录概述功能特点界面展示系统架构设计类结构图Excel题库填写格式模板题库题目填写格式表核心数据结构