zoukankan      html  css  js  c++  java
  • 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;
       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;
    	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="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="728px; margin:200px auto 0"></div>
    <script src="js/jquery.min.js"></script>
    </body>
    </html>
    

      

  • 相关阅读:
    常规放大电路和差分放大电路
    二级管工作原理(PN结原理)学习
    数字图像处理(MATLAB版)学习笔记(2)——第2章 灰度变换与空间滤波
    数字图像处理(MATLAB版)学习笔记(1)——第1章 绪言
    PPT制作线条动画
    MOSFET使用与H桥驱动问题
    WPF自定义控件(1)——仪表盘设计[1]
    WPF自定义控件(2)——图表设计[1]
    c# lamp表达式例子
    HashCode和equal方法的区别和联系
  • 原文地址:https://www.cnblogs.com/geovindu/p/10170034.html
Copyright © 2011-2022 走看看