核心属性
::placeholder 改变输入框中占位文字的样式
:focus + width + color + text-align 鼠标点击输入框后改变它和占位文字的样式
text-indent: -9999px 隐藏按钮中的文字
:focus + display + background-size 鼠标点击输入框后出现右边的图标按钮
-
<div class="wrapper">
-
<div class="middle">
-
<input type="email" value="" name="EMAIL" class="email-field" id="email-field" placeholder="输入文字">
-
<input type="submit" value="Subscribe" name="subscribe" id="subscribe-button" class="">
-
</div>
-
</div>
-
body { -
color: #efaa9d;
-
background-color: #f05133;
-
text-align: center;
-
}
-
::placeholder { -
color: #f4f2ca;
-
opacity: .8;
-
}
-
.email-field { -
display: inline-block;
-
width: 80px;
-
padding: .9em 1.8em;
-
color: #f4f2ca;
-
background-color: #d8492e;
-
border: none;
-
border-radius: 4px;
-
outline: none;
-
cursor: pointer;
-
text-align: center;
-
transition: all .1s linear;
-
}
-
.email-field:hover { -
background-color: #d0432a;
-
}
-
.email-field:focus { -
width: 200px;
-
color: #efaa9d;
-
outline: none;
-
text-align: left;
-
cursor: inherit;
-
}
-
#subscribe-button { -
display: none;
-
width: 35px;
-
height: 35px;
-
border: none;
-
background: url(https://pics.codecolor.cn/morphing-input/arrow-circle-on-right.svg) no-repeat;
-
background-size: 13px;
-
background-position: 0 1px;
-
text-indent: -9999px;
-
opacity: .25;
-
cursor: pointer;
-
transition: all .2s linear;
-
}
-
#subscribe-button:hover { -
opacity: .33;
-
}
-
.email-field:focus + #subscribe-button { -
display: inline-block;
-
background-size: 33px;
-
}
以上就是本文的全部内容,希望对大家的学习有所帮助,也希望大家多多支持 码农网
本站部分资源来源于网络,本站转载出于传递更多信息之目的,版权归原作者或者来源机构所有,如转载稿涉及版权问题,请联系我们。
Python算法教程
[挪威] Magnus Lie Hetland 赫特兰 / 凌杰、陆禹淳、顾俊 / 人民邮电出版社 / 2016-1-1 / 69.00元
本书用Python语言来讲解算法的分析和设计。本书主要关注经典的算法,但同时会为读者理解基本算法问题和解决问题打下很好的基础。全书共11章。分别介绍了树、图、计数问题、归纳递归、遍历、分解合并、贪心算法、复杂依赖、Dijkstra算法、匹配切割问题以及困难问题及其稀释等内容。本书在每一章结束的时候均有练习题和参考资料,这为读者的自我检查以及进一步学习提供了较多的便利。在全书的最后,给出了练习题的提......一起来看看 《Python算法教程》 这本书的介绍吧!