Adaptive Placeholders
https://wisdmlabs.com/blog/create-adaptive-placeholders-using-css/
https://circleci.com/blog/adaptive-placeholders/
https://stackoverflow.com/questions/47983822/css-operator-adaptive-placeholder-contact-form-7-wordpress
<!DOCTYPE html>
<html lang="zh-cn">
<head>
<meta http-equiv="Content-type" content="text/html; charset=utf-8" />
<title>Adaptive Placeholder – 自适应的占位符效果</title> <style type="text/css"> body {
background-color: #FAFAFA;
}
.top-banner {
background: #555;
}
input[type=text] {
-webkit-box-sizing: border-box;
-moz-box-sizing: border-box;
box-sizing: border-box;
width: 100%;
height: -webkit-calc(3em + 2px);
height: calc(3em + 2px);
margin: 0 0 1em;
padding: 1em;
border: 1px solid #cccccc;
border-radius: 1.5em;
background: #fff;
resize: none;
outline: none;
}
input[type=text][required]:focus {
border-color: #00bafa;
}
input[type=text][required]:focus + label[placeholder]:before {
color: #00bafa;
}
input[type=text][required]:focus + label[placeholder]:before, input[type=text][required]:valid + label[placeholder]:before {
-webkit-transition-duration: .2s;
transition-duration: .2s;
-webkit-transform: translate(0, -1.5em) scale(0.9, 0.9);
-ms-transform: translate(0, -1.5em) scale(0.9, 0.9);
transform: translate(0, -1.5em) scale(0.9, 0.9);
}
input[type=text][required]:invalid + label[placeholder][alt]:before {
content: attr(alt);
}
input[type=text][required] + label[placeholder] {
display: block;
pointer-events: none;
line-height: 2.3em;
margin-top: -webkit-calc(-3em - 2px);
margin-top: calc(-3em - 2px);
margin-bottom: -webkit-calc((3em - 1em) + 2px);
margin-bottom: calc((3em - 1em) + 2px);
}
input[type=text][required] + label[placeholder]:before {
content: attr(placeholder);
display: inline-block;
margin: 0 -webkit-calc(1em + 2px);
margin: 0 calc(1em + 2px);
padding: 0 2px;
color: #898989;
white-space: nowrap;
-webkit-transition: 0.3s ease-in-out;
transition: 0.3s ease-in-out;
background-image: -webkit-gradient(linear, left top, left bottom, from(#ffffff), to(#ffffff));
background-image: -webkit-linear-gradient(top, #ffffff, #ffffff);
background-image: linear-gradient(to bottom, #ffffff, #ffffff);
-webkit-background-size: 100% 5px;
background-size: 100% 5px;
background-repeat: no-repeat;
background-position: center;
} *, *:after, *:before { -webkit-box-sizing: border-box; -moz-box-sizing: border-box; box-sizing: border-box; }
.clearfix:after{visibility:hidden;display:block;font-size:0;content:" ";clear:both;height:0}
.clearfix{*zoom:1}
.fl{float:left}
.fr{float:right}
.fl,.fr{_display:inline}
.top-banner {
position:absolute;
z-index: 999;
left:0;
top:0;
height:40px;
line-height:40px;
padding:0 30px;
width:100%;
font-size: 13px;
background-color: rgba(255, 255, 255, 0.15);
color: #fff;
font-family: "宋体","Microsoft Yahei","Helvetica Neue",Helvetica,Arial,sans-serif;
font-size: 15px;
/*text-shadow: 1px 1px 3px #333;*/
/*box-shadow: 0 1px 0 #999;*/
}
.top-banner a {
color: #fff;
text-decoration: none;
}
</style>
<script type="text/javascript">
$(function() {
$("input[id$=address]").qtip({
content: '涂聚文告诉你,好样的'
});
});
</script> </head> <body>
<div style="width:400px;height:100px;margin:300px auto">
<form>
<input required='必须填写' type='text' class="name" id="name">
<label alt='请输入姓名' placeholder='姓名'></label>
<input required='必须填写' type='text' class="address" id="address">
<label alt='请输入地址' placeholder='地址'></label> </form>
</div>
<div class="footer-banner" style="width:728px; margin:200px auto 0"></div>
<script src="js/jquery.min.js"></script>
</body>
</html>

Adaptive Placeholders的更多相关文章
- 移动端web自适应解决方案: adaptive.js
代码有更新,最好直接查看github github:https://github.com/finance-sh/adaptive adaptivejs利用rem解决移动端页面开发的自适应问题 页面模板 ...
- 【Win 10应用开发】Adaptive磁贴模板的XML文档结构
在若干天之前,老周给大家讲了Adaptive Toast通知的XML模板,所以相应地,今天老周给大家介绍一下Adaptive磁贴的新XML模板. 同样道理,你依旧可以使用8.1时候的磁贴模板,在win ...
- [MySQL] Buffer Pool Adaptive Flush
Buffer Pool Adaptive Flush 在MySQL的帮助文档中Tuning InnoDB Buffer Pool Flushing提到, innodb_adaptive_flushin ...
- Adaptive Placeholder – 自适应的占位符效果
在早期,我们都是通过使用 JavaScript 来实现占位符功能.而现在,HTML5 原生提供的 placeholder 属性让我们在现代浏览器轻松就能实现这样的功能.这里向大家分享一个自适应的占位符 ...
- Adaptive Backgrounds – jQuery 自适应背景插件
Adaptive Backgrounds 是一款很特别的 jQuery 插件,可以从图像中提取主导颜色并将它应用到它的父元素.这个插件利用 Canvas 元素和 ImageData 对象.需要注意的是 ...
- Adaptive Code Via C#读书笔记
原书链接: http://www.amazon.com/Adaptive-Code-via-principles-Developer-ebook/dp/B00OCLLYTY/ref=dp_kinw_s ...
- Win 10 开发中Adaptive磁贴模板的XML文档结构,Win10 应用开发中自适应Toast通知的XML文档结构
分享两篇Win 10应用开发的XML文档结构:Win 10 开发中Adaptive磁贴模板的XML文档结构,Win10 应用开发中自适应Toast通知的XML文档结构. Win 10 开发中Adapt ...
- Correlation Filter in Visual Tracking系列一:Visual Object Tracking using Adaptive Correlation Filters 论文笔记
Visual Object Tracking using Adaptive Correlation Filters 一文发表于2010的CVPR上,是笔者所知的第一篇将correlation filt ...
- [Notes] Reading Notes on [Adaptive Robot Control – mxautomation J. Braumann 2015]
Reading sources: 1.Johannes Braumann, Sigrid Brell-Cokcan, Adaptive Robot Control (ARC ) Note: buil ...
随机推荐
- Edge Intelligence: On-Demand Deep Learning Model Co-Inference with Device-Edge Synergy
边缘智能:按需深度学习模型和设备边缘协同的共同推理 本文为SIGCOMM 2018 Workshop (Mobile Edge Communications, MECOMM)论文. 笔者翻译了该论文. ...
- ndk编译ffmpeg
#!/bin/bash NDK=/opt/android-ndk-r9d SYSROOT=$NDK/platforms/android-9/arch-arm/ TOOLCHAIN=$NDK/toolc ...
- Roslyn还出现这么低级的错误,不应该呀!
前几天对Dora.Interception作了简单的重构,想提供C#脚本来定义Interception Policy,毫无疑问微软提供的编译平台Roslyn使C#脚本化提供了支持.但是没有想到随便尝试 ...
- JavaScript 异步编程的前世今生(上)
前言 提到 JavaScript 异步编程,很多小伙伴都很迷茫,本人花费大约一周的业余时间来对 JS 异步做一个完整的总结,和各位同学共勉共进步! 目录 part1 基础部分 什么是异步 part2 ...
- Spring AOP实现 Bean字段合法性校验
使用SpringAop 验证方法参数是否合法 先定义两个注解类ValidateGroup 和 ValidateFiled ValidateGroup .java package com.zf.an ...
- [Swift]LeetCode162. 寻找峰值 | Find Peak Element
A peak element is an element that is greater than its neighbors. Given an input array nums, where nu ...
- [Swift]LeetCode210. 课程表 II | Course Schedule II
There are a total of n courses you have to take, labeled from 0 to n-1. Some courses may have prereq ...
- [Swift]LeetCode402. 移掉K位数字 | Remove K Digits
Given a non-negative integer num represented as a string, remove k digits from the number so that th ...
- Linux指令装图像化界面
1.对yum进行配置安装.//这是重点 [root@localhost ~]# yum groupinstall "GNOME Desktop" "Graphical A ...
- 关于 redis.properties配置文件及rule
当你配置的 FinanceRlue 的path为/count/users时,redis.properties中就必须也配置一个/users=redis://localhost:6379/2?keyle ...