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

php中文网
发布: 2016-06-24 11:17:19
原创
1491人浏览过

阿里云-虚拟数字人
阿里云-虚拟数字人

阿里云-虚拟数字人是什么? ...

阿里云-虚拟数字人 2
查看详情 阿里云-虚拟数字人


回复讨论(解决方案)

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

<!DOCTYPE html><html><head>    <title>demo</title>    <script type="text/javascript" src="http://seventh77.com/view/publicjs/jquery-2.1.4.min.js"></script>    <meta charset="utf-8">    <style>        .input{            background-color: white;            cursor: auto;            padding: 1px 0px;            border: 1px solid #aaa;            display: inline-block;            text-align: start;            margin: 0em 0em 0em 0em;            font: 13.3333px Arial;        }        .input input{            border: none;            outline-style:none;        }    </style></head><body>    <div class="input">账号:<input></div></body></html>
登录后复制

同意楼上观点

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部分
<div class="form-box">	<div class="form-section">		<label for="username">邮箱</label>		<input type="text" name="username" placeholder='请输入邮箱'>	</div>	<div class="form-section">		<label for="password">密码</label>		<input type="password" name="password" placeholder='请输入密码'>	</div>	<div class="form-section">		<input class='submit-btn' type="submit" value="登录">	</div></div>
登录后复制

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

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

HTML速学教程(入门课程)
HTML速学教程(入门课程)

HTML怎么学习?HTML怎么入门?HTML在哪学?HTML怎么学才快?不用担心,这里为大家提供了HTML速学教程(入门课程),有需要的小伙伴保存下载就能学习啦!

下载
来源:php中文网
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系admin@php.cn
最新问题
开源免费商场系统广告
热门教程
更多>
最新下载
更多>
网站特效
网站源码
网站素材
前端模板
关于我们 免责申明 举报中心 意见反馈 讲师合作 广告合作 最新更新 English
php中文网:公益在线php培训,帮助PHP学习者快速成长!
关注服务号 技术交流群
PHP中文网订阅号
每天精选资源文章推送
PHP中文网APP
随时随地碎片化学习

Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号