欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页  >  web前端

html+css 这种登陆效果怎么做成的,把邮箱放到text框里面,但又不影响输入_html/css_WEB-ITnose

程序员文章站 2022-04-06 12:46:37
...

回复讨论(解决方案)

你检查一下就知道了,实际上文本框还是和“账号”这些文字分开的,只是看起来在一起,等下帮你写个demo吧。

demo
账号:

同意楼上观点

label for input
CSS部分

input{outline: none; border: 0;}.form-box{font-size: 12px; color: #000;}.form-section{position: relative; margin-bottom: 5px;}.form-section label{	position: absolute;	width: 30px;	left: 0;	height: 30px;	line-height: 30px;	padding:0 5px;	font-family: 'Microsoft Yahei';	font-weight: bold;}.form-section input{padding-left: 32px; height: 30px; width: 200px; border: 1px solid #ccc;}.submit-btn{	padding-right: 32px;	color: #fff;	background-color: #F33737;	text-align: center;	font-family: 'Microsoft Yahei';	font-weight: bold;	cursor: pointer;}

HTML部分

懂了 实际上是不是去掉input的边框,然后用个div包起来加上个边框。

div内放个文字div和文本框 按百分比设置宽度