《Input 常见Bug 及 解决方法》

开发工具与关键技术:DW 与 Input 标签 常见bug及解决方法
作者:何石涛
撰写时间:2019 年 1 月 17 日
一、讲述内容:
1. $目标完成效果:


点击input框后:

2.利用DW完成目标效果
(1)HTML部分
<div class="rightseach">
<form action="">
<input type="text" id="text">
<div id="weinei">
<a href="#">HTML</a>
<a href="#">修复input</a>
</div>
<div class="seach">
</div>
</form>
</div>
(2) CSS部分
<style>
.rightseach{
float: right: ;
line-height: 35px;
papadding-left: 130px;
}
.rightseach form{
width: 290px;
height: 30px;
background: #f5f5f5;
border-radius: 10px;
}
.seach{
width: 30px;
height: 30px;
background: #656565 url(./../华为商城(VMALL.COM)_华为手机、荣耀手机、官网正品保障_files/search.png) 7px 6px no-repeat;
border-radius: 50%;
position: relative;
margin-left: 260px;
}
#weinei{
font-size: 10px;
position: absolute;
top: 7px;
left: 160px;
}
#weinei a{
color: #dc102b;
padding-right: 15px;
text-decoration: none;
}
.rightseach input{
/*outline: 0;*/
height: 26px;
width: 280px;
position: absolute;
top: 10px;
background: #f5f5f5;
border: 0;
</style>
(3)js部分
<script>
window.onload = function(){
var weinei = document.getElementById("weinei");
text.onclick = function(){
weinei.style.display = "none";
};
};
</script>
到这就已经全部完成了。
二、 刷新网页后得到:


点击后 :

三、解决方法
它会有一层默认的边框效果 ,这时只要在 .rightseach input里加上一句代码:outline:0; 即可解决此问题。代码已经帮你们打好,只要把那个注释去掉就行。

...全文
278 1 打赏 收藏 转发到动态 举报
写回复
用AI写文章
1 条回复
切换为时间正序
请发表友善的回复…
发表回复
hookee 2019-01-22
  • 打赏
  • 举报
回复

61,112

社区成员

发帖
与我相关
我的任务
社区描述
层叠样式表(英文全称:Cascading Style Sheets)是一种用来表现HTML(标准通用标记语言的一个应用)或XML(标准通用标记语言的一个子集)等文件样式的计算机语言。
社区管理员
  • HTML(CSS)社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧