input标签的按钮效果
https://codepen.io/anon/pen/EOPMNy
<div class="row">
<p>Click every input.</p>
</div>
<div class="row">
<span>
<input class="basic-slide" id="name" type="text" placeholder="Your best name" /><label for="name">Name</label>
</span>
<span>
<input class="basic-slide" id="email" type="text" placeholder="Your favorite email" /><label for="email">Email</label>
</span>
<span>
<input class="basic-slide" id="phone" type="text" placeholder="You can trust us" /><label for="phone">Phone</label>
</span>
</div>
<div class="row">
<span>
<input class="clean-slide" id="age" type="text" placeholder="Go for the high score!" /><label for="age">Age</label>
</span>
<span>
<input class="clean-slide" id="height" type="text" placeholder="Heels count" /><label for="height">Height</label>
</span>
<span>
<input class="clean-slide" id="weight" type="text" placeholder="Go ahead and lie" /><label for="weight">Weight</label>
</span>
</div>
<div class="row">
<span>
<input class="gate" id="class" type="text" placeholder="Wizard!" /><label for="class">Class</label>
</span>
<span>
<input class="gate" id="element" type="text" placeholder="Five to choose from" /><label for="element">Element</label>
</span>
<span>
<input class="gate" id="move" type="text" placeholder="Secret book attack!" /><label for="move">Move</label>
</span>
</div>
<div class="row">
<span>
<input class="skinny" id="english" type="text" placeholder="Do you speak it?" /><label for="english">English</label>
</span>
<span>
<input class="skinny" id="burger" type="text" placeholder="A Royale with cheese?" /><label for="burger">Burger</label>
</span>
<span>
<input class="skinny" id="wallet" type="text" placeholder="Bad Mother****er" /><label for="wallet">Wallet</label>
</span>
</div>
<div class="row">
<span>
<input class="slide-up" id="card" type="text" placeholder="Fund me!" /><label for="card">Credit Card</label>
</span>
<span>
<input class="slide-up" id="expires" type="text" placeholder="Month Day, Year" /><label for="expires">Expires</label>
</span>
<span>
<input class="slide-up" id="security" type="text" placeholder="Public" /><label for="security">Security Code</label>
</span>
</div>
<div class="row">
<span>
<input class="card-slide" id="knock" type="text" placeholder="Who's there?" /><label for="knock">Knock knock</label>
</span>
<span>
<input class="card-slide" id="max" type="text" placeholder="Max who?" /><label for="max">Max</label>
</span>
<span>
<input class="card-slide" id="out" type="text" placeholder="Sunuva..." /><label for="out">Maxed out card ;)</label>
</span>
</div>
<div class="row">
<span>
<input class="swing" id="artist" type="text" placeholder="BO$$" /><label for="artist">Artist</label>
</span>
<span>
<input class="swing" id="song" type="text" placeholder="I don't give a ****" /><label for="song">Song</label>
</span>
<span>
<input class="swing" id="eyes" type="text" placeholder="Crazy" /><label for="eyes">Eyes</label>
</span>
</div>
<div class="row">
<span>
<input class="balloon" id="state" type="text" placeholder="Liquid, solid, gaseous..." /><label for="state">State</label>
</span>
<span>
<input class="balloon" id="planet" type="text" placeholder="Probably Earth" /><label for="planet">Planet</label>
</span>
<span>
<input class="balloon" id="galaxy" type="text" placeholder="Milky Way?" /><label for="galaxy">Galaxy</label>
</span>
</div>
@import "compass/css3";
@import url(https://fonts.googleapis.com/css?family=Open+Sans:400,700,600,300,800);
* {
box-sizing: border-box;
}
html,
body {
overflow-x: hidden;
font-family: "Open Sans", sans-serif;
font-weight: 300;
color: #fff;
background: #efefef;
}
@mixin epic-sides() { // https://codepen.io/MichaelArestad/pen/qltuk
position: relative;
z-index: 1;
&:before {
position: absolute;
content: "";
display: block;
top: 0;
left: -5000px;
height: 100%;
width: 15000px;
z-index: -1;
@content;
}
}
.row {
max-width: 800px;
margin: 0 auto;
padding: 60px 30px;
background: #032429;
@include epic-sides() {background: inherit;}
text-align: center;
&:first-child {
padding: 40px 30px;
}
&:nth-child(2),
&:nth-child(8),
&:nth-child(10){
background: #134A46;
}
&:nth-child(3),
&:nth-child(7) {
background: #377D6A;
}
&:nth-child(4),
&:nth-child(6) {
background: #7AB893;
}
&:nth-child(5) {
background: #B2E3AF;
}
span {
position: relative;
display: inline-block;
margin: 30px 10px;
}
}
.basic-slide {
display: inline-block;
width: 215px;
padding: 10px 0 10px 15px;
font-family: "Open Sans", sans;
font-weight: 400;
color: #377D6A;
background: #efefef;
border: 0;
border-radius: 3px;
outline: 0;
text-indent: 70px; // Arbitrary.
transition: all .3s ease-in-out;
&::-webkit-input-placeholder {
color: #efefef;
text-indent: 0;
font-weight: 300;
}
+ label {
display: inline-block;
position: absolute;
top: 0;
left: 0;
padding: 10px 15px;
text-shadow: 0 1px 0 rgba(19,74,70,.4);
background: #7AB893;
transition: all .3s ease-in-out;
border-top-left-radius: 3px;
border-bottom-left-radius: 3px;
}
}
.basic-slide:focus,
.basic-slide:active {
color: #377D6A;
text-indent: 0;
background: #fff;
border-top-left-radius: 0;
border-bottom-left-radius: 0;
&::-webkit-input-placeholder {
color: #aaa;
}
+ label {
transform: translateX(-100%);
}
}
.clean-slide {
position: relative;
display: inline-block;
width: 215px;
padding: 10px 0 10px 15px;
font-family: "Open Sans", sans;
font-weight: 400;
color: #377D6A;
background: #efefef;
border: 0;
border-radius: 3px;
outline: 0;
text-indent: 60px; // Arbitrary.
transition: all .3s ease-in-out;
&::-webkit-input-placeholder {
color: #efefef;
text-indent: 0;
font-weight: 300;
}
+ label {
display: inline-block;
position: absolute;
transform: translateX(0);
top: 0;
left: 0;
bottom: 0;
padding: 13px 15px;
font-size: 11px;
font-weight: 700;
text-transform: uppercase;
color: #032429;
text-align: left;
text-shadow: 0 1px 0 rgba(255,255,255,.4);
transition: all .3s ease-in-out, color .3s ease-out;
border-top-left-radius: 3px;
border-bottom-left-radius: 3px;
overflow: hidden;
&:after {
content: "";
position: absolute;
top: 0;
right: 100%;
bottom: 0;
width: 100%;
background: #7AB893;
z-index: -1;
transform: translate(0);
transition: all .3s ease-in-out;
border-top-left-radius: 3px;
border-bottom-left-radius: 3px;
}
}
}
.clean-slide:focus,
.clean-slide:active {
color: #377D6A;
text-indent: 0;
background: #fff;
border-top-left-radius: 0;
border-bottom-left-radius: 0;
&::-webkit-input-placeholder {
color: #aaa;
}
+ label {
color: #fff;
text-shadow: 0 1px 0 rgba(19,74,70,.4);
transform: translateX(-100%);
&:after {
transform: translate(100%);
}
}
}
.gate {
display: inline-block;
width: 215px;
padding: 10px 0 10px 15px;
font-family: "Open Sans", sans;
font-weight: 400;
color: #377D6A;
background: #efefef;
border: 0;
border-radius: 3px;
outline: 0;
text-indent: 65px; // Arbitrary.
transition: all .3s ease-in-out;
&::-webkit-input-placeholder {
color: #efefef;
text-indent: 0;
font-weight: 300;
}
+ label {
display: inline-block;
position: absolute;
top: 0;
left: 0;
padding: 10px 15px;
text-shadow: 0 1px 0 rgba(19,74,70,.4);
background: #7AB893;
transition: all .4s ease-in-out;
border-top-left-radius: 3px;
border-bottom-left-radius: 3px;
transform-origin: left bottom;
z-index: 99;
&:before,
&:after {
content: "";
position: absolute;
top: 0;
right: 0;
bottom: 0;
left: 0;
border-radius: 3px;
background: #377D6A;
transform-origin: left bottom;
transition: all .4s ease-in-out;
pointer-events: none;
z-index: -1;
}
&:before {
background: rgba(3,36,41,.2);
z-index: -2;
right: 20%;
}
}
}
span:nth-child(2) .gate {
text-indent: 85px;
}
span:nth-child(2) .gate:focus,
span:nth-child(2) .gate:active{
text-indent: 0;
}
.gate:focus,
.gate:active {
color: #377D6A;
text-indent: 0;
background: #fff;
border-top-right-radius: 3px;
border-bottom-right-radius: 3px;
&::-webkit-input-placeholder {
color: #aaa;
}
+ label {
transform: rotate(-66deg);
border-radius: 3px;
&:before {
transform: rotate(10deg);
}
}
}
.skinny {
display: inline-block;
width: 215px;
padding: 10px 0 10px 15px;
font-family: "Open Sans", sans;
font-weight: 400;
color: #377D6A;
background: #efefef;
border: 0;
border-radius: 3px;
outline: 0;
text-indent: 75px; // Arbitrary.
transition: all .3s ease-in-out;
&::-webkit-input-placeholder {
color: #efefef;
text-indent: 0;
font-weight: 300;
}
+ label {
display: inline-block;
position: absolute;
transform: translateX(0);
top: 0;
left: 0;
padding: 10px 15px;
text-shadow: 0 1px 0 rgba(19,74,70,.4);
transition: all .3s ease-in-out;
border-top-left-radius: 3px;
border-bottom-left-radius: 3px;
overflow: hidden;
&:before,
&:after {
content: "";
position: absolute;
right: 0;
left: 0;
z-index: -1;
transition: all .3s ease-in-out;
}
&:before {
// Skinny bit here
top: 5px;
bottom: 5px;
background: #377D6A; // change this to #134A46
border-top-left-radius: 3px;
border-bottom-left-radius: 3px;
}
&:after {
top: 0;
bottom: 0;
background: #377D6A;
}
}
}
.skinny:focus,
.skinny:active {
color: #377D6A;
text-indent: 0;
background: #fff;
&::-webkit-input-placeholder {
color: #aaa;
}
+ label {
transform: translateX(-100%);
&:after {
transform: translateX(100%);
}
}
}
.slide-up {
display: inline-block;
width: 215px;
padding: 10px 0 10px 15px;
font-family: "Open Sans", sans;
font-weight: 400;
color: #377D6A;
background: #efefef;
border: 0;
border-radius: 3px;
outline: 0;
text-indent: 80px; // Arbitrary.
transition: all .3s ease-in-out;
&::-webkit-input-placeholder {
color: #efefef;
text-indent: 0;
font-weight: 300;
}
+ label {
display: inline-block;
position: absolute;
transform: translateX(0);
top: 0;
left: 0;
padding: 10px 15px;
text-shadow: 0 1px 0 rgba(19,74,70,.4);
transition: all .3s ease-in-out;
border-top-left-radius: 3px;
border-bottom-left-radius: 3px;
overflow: hidden;
&:before,
&:after {
content: "";
position: absolute;
right: 0;
left: 0;
z-index: -1;
transition: all .3s ease-in-out;
}
&:before {
// Skinny bit here
top: 6px;
left: 5px;
right: 5px;
bottom: 6px;
background: #377D6A; // change this to #134A46
}
&:after {
top: 0;
bottom: 0;
background: #377D6A;
}
}
}
span:nth-child(1) .slide-up {
text-indent: 105px;
}
span:nth-child(3) .slide-up {
text-indent: 125px;
}
span:nth-child(1) .slide-up:focus,
span:nth-child(1) .slide-up:active,
span:nth-child(3) .slide-up:focus,
span:nth-child(3) .slide-up:active {
text-indent: 0;
}
.slide-up:focus,
.slide-up:active {
color: #377D6A;
text-indent: 0;
background: #fff;
&::-webkit-input-placeholder {
color: #aaa;
}
+ label {
transform: translateY(-100%);
&:before {
border-radius: 5px;
}
&:after {
transform: translateY(100%);
}
}
}
.card-slide {
display: inline-block;
width: 215px;
padding: 10px 0 10px 15px;
font-family: "Open Sans", sans;
font-weight: 400;
color: #377D6A;
background: #efefef;
border: 0;
border-radius: 3px;
outline: 0;
text-indent: 115px; // Arbitrary.
transition: all .3s ease-in-out;
&::-webkit-input-placeholder {
color: #efefef;
text-indent: 0;
font-weight: 300;
}
+ label {
display: block;
position: absolute;
top: 0;
left: 0;
padding: 10px 15px;
text-shadow: 0 1px 0 rgba(19,74,70,.4);
background: #7AB893;
transition: all .3s ease-in-out;
border-top-left-radius: 3px;
border-bottom-left-radius: 3px;
transform-origin: right center;
transform: perspective(300px) scaleX(1) rotateY(0deg);
}
}
span:nth-child(2) .card-slide {
text-indent: 55px;
}
span:nth-child(3) .card-slide {
text-indent: 150px;
}
span:nth-child(2) .card-slide:focus,
span:nth-child(2) .card-slide:active,
span:nth-child(3) .card-slide:focus,
span:nth-child(3) .card-slide:active {
text-indent: 0;
}
.card-slide:focus,
.card-slide:active {
color: #377D6A;
text-indent: 0;
background: #fff;
border-top-left-radius: 0;
border-bottom-left-radius: 0;
&::-webkit-input-placeholder {
color: #aaa;
}
+ label {
transform: perspective(600px) translateX(-100%) rotateY(80deg);
}
}
.swing {
display: inline-block;
width: 215px;
padding: 10px 0 10px 15px;
font-family: "Open Sans", sans;
font-weight: 400;
color: #377D6A;
background: #efefef;
border: 0;
border-radius: 3px;
outline: 0;
text-indent: 60px; // Arbitrary.
transition: all .3s ease-in-out;
&::-webkit-input-placeholder {
color: #efefef;
text-indent: 0;
font-weight: 300;
}
+ label {
display: inline-block;
position: absolute;
top: 0;
left: 0;
padding: 10px 15px;
text-shadow: 0 1px 0 rgba(19,74,70,.4);
background: #7AB893;
border-top-left-radius: 3px;
border-bottom-left-radius: 3px;
transform-origin: 2px 2px;
transform: rotate(0);
// There should be a better way
animation: swing-back .4s 1 ease-in-out;
}
}
@keyframes swing {
0% {
transform: rotate(0);
}
20% {
transform: rotate(116deg);
}
40% {
transform: rotate(60deg);
}
60% {
transform: rotate(98deg);
}
80% {
transform: rotate(76deg);
}
100% {
transform: rotate(82deg);
}
}
@keyframes swing-back {
0% {
transform: rotate(82deg);
}
100% {
transform: rotate(0);
}
}
.swing:focus,
.swing:active {
color: #377D6A;
text-indent: 0;
background: #fff;
border-top-left-radius: 0;
border-bottom-left-radius: 0;
&::-webkit-input-placeholder {
color: #aaa;
}
+ label {
animation: swing 1.4s 1 ease-in-out;
transform: rotate(82deg);
}
}
.balloon {
// As suggested by https://twitter.com/dbox/status/365888496486985728
display: inline-block;
width: 215px;
padding: 10px 0 10px 15px;
font-family: "Open Sans", sans;
font-weight: 400;
color: #377D6A;
background: #efefef;
border: 0;
border-radius: 3px;
outline: 0;
text-indent: 60px; // Arbitrary.
transition: all .3s ease-in-out;
&::-webkit-input-placeholder {
color: #efefef;
text-indent: 0;
font-weight: 300;
}
+ label {
display: inline-block;
position: absolute;
top: 8px;
left: 0;
bottom: 8px;
padding: 5px 15px;
color: #032429;
font-size: 11px;
font-weight: 700;
text-transform: uppercase;
text-shadow: 0 1px 0 rgba(19,74,70,0);
transition: all .3s ease-in-out;
border-radius: 3px;
background: rgba(122,184,147,0);
&:after {
position: absolute;
content: "";
width: 0;
height: 0;
top: 100%;
left: 50%;
margin-left: -3px;
border-left: 3px solid transparent;
border-right: 3px solid transparent;
border-top: 3px solid rgba(122,184,147,0);
transition: all .3s ease-in-out;
}
}
}
.balloon:focus,
.balloon:active {
color: #377D6A;
text-indent: 0;
background: #fff;
&::-webkit-input-placeholder {
color: #aaa;
}
+ label {
color: #fff;
text-shadow: 0 1px 0 rgba(19,74,70,.4);
background: rgba(122,184,147,1);
transform: translateY(-40px);
&:after {
border-top: 4px solid rgba(122,184,147,1);
}
}
}
input标签的按钮效果的更多相关文章
- input标签(按钮)
按钮: <input type="button" name="..." value="..." /> <input typ ...
- html移动应用 input 标签 清除按钮功能如何实现(不触发键盘)
有个需求是:输入框有文本的时候就显示清除按钮,没有文本则隐藏清除按钮,点击清除按钮不能影响键盘弹出的状态. 网上有css实现自动显示和隐藏清除按钮的方案,但是考虑到兼容性,我们还是使用js来实现. c ...
- 一个input标签搞定含内外描边及阴影的按钮~
自从怀孕以来,我就变得很是轻松,偶尔写一两个页面,或者偶尔调试一个两个bug,或者偶尔给做JS的同事打打下手,修改个bug什么......一个习惯于忙碌的工作的人,这一闲下来,感觉还真TM很不舒服-怎 ...
- input/select/textarea标签的readonly效果实现
首先说一下readonly属性的应用场景 表单中,不能编辑对应的文本,但是仍然可以聚焦焦点 在提交表单的时候,该输入项会作为form的一项提交(目的) 这里要说一下disabled和readonly的 ...
- 使用<input>标签做了两个按钮, 按钮之间间距如何去掉
遇到的问题: 使用<input>标签做了两个按钮, 按钮之间有个间距不知道怎么去掉. 如下图: 问题解决: <input>是内联块状元素(inline-block); 内联元素 ...
- [移动端WEB] 移动端input标签按钮为什么在苹果手机上还有一层白色?
移动端input标签按钮为什么在苹果手机上还有一层白色? 解决办法:其实蛮简单的,就加一个属性就好了 input { outline:0px ; -webkit-appearance: none; } ...
- 遭遇input与button按钮背景图失效不显示的解决办法
笔者从事网页前端代码页面工程师已有多年,作为一个网页重构人员常常会遇到一些莫名其妙的DIV+CSS(正确的说法是XHTML+CSS)在 IE.FireFox火狐. 谷歌浏览器CHROME.苹果浏览器S ...
- html <input>标签类型属性type(file、text、radio、hidden等)详细介绍
html <input>标签类型属性type(file.text.radio.hidden等)详细介绍 转载请注明:文章转载自:[169IT-最新最全的IT资讯] html <inp ...
- input与button按钮背景图失效不显示的解决办法
今天做公司的某个网站前端网页页面的时候笔者又遇到了难解决的网页前端DIVCSS代码问题,一个平时不会发生的怪事情发生了:为网页代码中的Form表单中的input 和 button 按钮标签在CSS样式 ...
随机推荐
- opencv常用函数备忘
//显示图片 IplImage * src = cvLoadImage("xx.JPG"); cvNamedWindow(); cvShowImage("show_ima ...
- 命令行执行 mvn package 和常见mvn命令
cmd 打开命令提示符, 然后打开代码所在目录,例如 d: cd d:/code 执行 mvn package Maven常用命令: 1. 创建Maven的普通java项目: mvn arc ...
- recv函数的用法详解
recv函数 int recv( SOCKET s, char FAR *buf, int len, int flags ); 不论是客户还是服务器应用程序都用rec ...
- Delphi XE8 iOS与Android移动应用开发(APP开发)教程[完整中文版]
https://item.taobao.com/item.htm?id=536584650957&toSite=main
- mybatis 起别名
mybatis.xml文件 typeAliases 节点进行配置别名(有两种配置方法:1.typeAlias 2.package 这个方式比较简单) 也可以省略不写
- Oracle数据表转换为Shapefile(一)
严格来说,文章标题中的“转换”并不完全合适.本文的主要内容是基于Oracle数据表的数据来生产出Shapefile文件.进行该工作的一个前提条件是:Oracle数据表中包含坐标数值字段,一般来说就是x ...
- Backup--如何快速截断日志
--在SQL Server 2005 中,可用使用 BACKUP LOG WITH TRUNCATE_ONLY来迅速清理日志,该命令在 SQL Server2008 及更高版本上被去除. --BACK ...
- 如何使用OpenGL中的扩展
如果你在Windows平台下开发OpenGL程序,那么系统中自带的OpenGL库就是1.1的,如果想使用1.2或者更高版本的OpenGL库,那么只能使用OpenGL扩展,在网上关于如何使用OpenGL ...
- code::blocks学习(2)
转自: http://blog.csdn.net/sinat_27088253/article/details/52137855 http://jingyan.baidu.com/article/0b ...
- kali linux之Msf
目前最流行,最强大,最具扩展性的渗透测试平台软件 基于metasploit进行渗透测试和漏洞分析的流程和方法 框架集成了渗透测试标准(PETS)思想 一定程度上统一了渗透测试和漏洞研究的工作环境 新的 ...