css3写的实用表单美化

摘要:
}body{font size;font-family;Arial;background color;color;1em}pre;0.7em;空白区;固体1px#ccc;textarea{margin;padding;font size;outline;font-family;border;padding;}输入[type=“text”];
<!DOCTYPE html>
<!--[if IE 7 ]> <html lang="en" class="ie7"> <![endif]-->
<!--[if IE 8 ]> <html lang="en" class="ie8"> <![endif]-->
<!--[if IE 9 ]> <html lang="en" class="ie9"> <![endif]-->
<!--[if (gt IE 9)|!(IE)]><!--> <html lang="zh"> <!--<![endif]-->
<head>
<meta charset="utf-8">
<title></title>
<style type="text/css" media="screen">
    /* ----------------------------------------------  Layout ----------------------------------------------  */

        html {background-color:#ddd;}
        body {
            font-size:16px; font-family:Arial; 600px; background-color:#fff;
            margin:2em auto; padding:5%; line-height:1.6em;
            -webkit-box-shadow: 0 0 0.5em rgba(0,0,0,0.2);
            box-shadow: 0 0 0.5em rgba(0,0,0,0.2);
            color:#444;}

        a {color:#0181bc;}
        p {margin:0 0 1em;}
        h1 {line-height:1.25em;}
        h2, h3 {margin:0 0 0.5em; font-size:1.2em;}
        h3 {font-size:1em}
        pre, code {font-size:0.7em; background-color:#eee; color:#000; font-family: verdana, monospace;}
        code {padding:0.2em}
        pre {padding:1em; white-space: pre-line;}
        #first ~ h2 {margin-top:2em}
        .small {font-size:0.75em; line-height:1.5em;}
        hr {border:none; height:0; border-top:solid 1px #ccc; margin:1.5em 0;}

    /* ----------------------------------------------  Reset form elements ---------------------------------------------- */

        input, select, textarea {
            margin:0; padding:0; font-size:0.85em; outline:none;
            font-family:inherit;
            -moz-box-sizing:border-box; /* Firefox */
            -webkit-box-sizing:border-box; /* Safari */
            box-sizing:border-box;}

    /* ----------------------------------------------  Inputs, textareas and selects  ---------------------------------------------- */


        input[type="text"], textarea, select, div.styled, input[type="file"] {
            12em; border-radius:2px; border: solid 1px #ccc; padding:0.4em;}

        div.styled, select, input[type="submit"], input[type="button"],
        input[type="file"]:after {
            background: white url(formelements-select.png) no-repeat center right;
            -webkit-box-shadow: 0 1px 3px rgba(0,0,0,0.2);
            box-shadow: 0 1px 3px rgba(0,0,0,0.2);}

        input[type="text"], textarea, input[type="file"] {
            background-color: #f5f5f5;
            -webkit-box-shadow: inset 0 2px 3px rgba(0,0,0,0.2);
            box-shadow: inset 0 2px 3px rgba(0,0,0,0.2);}

            .ie9 input[type="text"] { line-height:normal; } /* Get the stuff to line up right */

        textarea { 100%; height:10em; }

    /* ----------------------------------------------  Select menu  ---------------------------------------------- */

        /* For IE and Firefox */

        div.styled { overflow:hidden; padding:0; margin:0; }

            .ie7 div.styled {border:none;}

        div.styled select {
            115%; background-color:transparent; background-image:none;
            -webkit-appearance: none; border:none; box-shadow:none;}

            .ie7 div.styled select {
                100%; background-color:#fff; border: solid 1px #ccc;
                padding:0.3em 0.5em;}

    /* ----------------------------------------------  File field  ----------------------------------------------  */

        /* Webkit Only */

        input[type="file"] {
            position: relative;
            -webkit-appearance: none;
            -webkit-box-sizing: border-box;
            box-sizing: border-box;  40%; padding:0;}

        input[type=file]::-webkit-file-upload-button {
             0; padding: 0; margin: 0;-webkit-appearance: none; border: none;}

        input[type="file"]:after {
            content: 'Upload File';
            margin:0 0 0 0.5em;
            display: inline-block; left: 100%; position: relative;
            background:white url(formelements-select.png) no-repeat center left;
            padding:0.3em 0.5em; border: solid 1px #ccc !important;
            -webkit-box-shadow: 0 1px 3px rgba(0,0,0,0.2);
            box-shadow: 0 1px 3px rgba(0,0,0,0.2);
            border-radius:4px;}


            input[type="file"]:active:after {box-shadow:none;}


    /* ----------------------------------------------  Checkboxes and Radio inputs  ----------------------------------------------  */

        input[type="radio"],
        input[type="checkbox"] { position: absolute; left: -999em; }

        label:before {
            display: inline-block; position: relative; top:0.25em; left:-2px;
            content:''; 25px; height:25px;
            background-image:url(formelements.png); }

        input[type="checkbox"] + label:before { background-position: 0 -25px;}
        input[type="checkbox"]:checked + label:before {background-position: 0 0 ; }

        input[type="radio"] + label:before { background-position: -25px -25px;}
        input[type="radio"]:checked + label:before { background-position: -25px 0;}

            /* Remove the custom styling for IE 7-8 */

            .ie8 label:before { display:none; content:none; }

            .ie8 input[type="checkbox"],
            .ie8 input[type="radio"],
            .ie7 input[type="checkbox"],
            .ie7 input[type="radio"]{
                position: static; left:0; }

            .ie8 input[type="checkbox"],
            .ie8 input[type="radio"] {
                position:relative; top:5px; margin-right:0.5em;}

        input[type="text"]:focus, textarea:focus {
            border-color:#000;
            }

    /* ---------------------------------------------- Form Submit and Next buttons ---------------------------------------------- */

        input[type="submit"],
        input[type="button"] {
            padding:0.5em 1em; line-height:1em; cursor:pointer;
            border-radius:4px; color:#000; font-weight:bold; font-size:inherit;
            border:solid 1px #ccc;  box-shadow:0 1px 5px rgba(0,0,0,0.2);
            background-position: center bottom;}

            /* Gradient Generator by : http://www.colorzilla.com/gradient-editor/ */

        input[type="submit"]:active,
        input[type="button"]:active {-webkit-box-shadow: none; box-shadow:none;}

            /* IE7 needs you to change the background to transparent when using image background for submit buttons */
</style>

<!-- This is for mobile devices -->
<meta name="viewport" content="width=device-width; initial-scale=1.0; maximum-scale=1.0;"/>

<!-- This makes HTML5 elements work in IE 6-8 -->
<!--[if lt IE 9]><script src="http://html5shiv.googlecode.com/svn/trunk/html5.js"></script><![endif]-->
</head>

<body>
<h2 id="first">Check and Radio inputs (IE9+, FF, Opera, Webkit)</h2>

<p><input type="checkbox"   /><label for="male">Checkbox</label> <br/>
<input type="radio" name="option"   /><label for="female">Radio 1</label>
<input type="radio" name="option"   /><label for="female2">Radio 2</label></p>

<h2>Select Field (IE8+, FF, Webkit)</h2>
<p class="small">Credited to: <a href="http://goo.gl/6XpKq" target="_blank">Bovotasan</a></p>
<div class="styled"><select><option>Explorer</option><option>Firefox</option><option>Webkit</option></select></div>

<h2>File Input (Webkit)</h2>
<p class="small">Adapted from but credited to: <a href="http://goo.gl/HXJCo" target="_blank">The Computer Whiz</a></p>
<p><input type="file"></p>

<h2>Text line and Text paragraph (IE9+, FF, Opera, Webkit)</h2>
<p><input type="text" placeholder="Enter something"></p>
<p><textarea placeholder="Type something in here"></textarea>
<p><input type="button" value="« Previous"> <input type="submit" value="Send »"> </p>

</body>
</html>
css3写的实用表单美化第1张背景图

  

免责声明:文章转载自《css3写的实用表单美化》仅用于学习参考。如对内容有疑问,请及时联系本站处理。

上篇程序员修炼之道阅读笔记02Android SDK +Eclipse+ADT+CDT+NDK 开发环境在windows 7下的搭建下篇

宿迁高防,2C2G15M,22元/月;香港BGP,2C5G5M,25元/月 雨云优惠码:MjYwNzM=

相关文章

动态表单

最近需要做一个动态表单管理,因为以前没什么经验,所以自己做了一个小demo研究了一下,现将自己的整体思路再从头顺一下,也顺便记录一下这次的学习经验,呵呵 1、  首先,要想实现动态表单的管理,自己首先想到的是不就是执行sql语句对数据库表的字段进行增删改嘛,后来想想并不这么简单,因为要关乎到以后用户添加数据时表单的动态生成,以及还要生成动态的js表单验证,...

if的用法

if用法举例:求分数的等级 1 # include <stdio.h> 2 3 int main(void) 4 { 5 float score; //score分数 6 7 printf("请输入您的考试成绩: "); 8 scanf("%f", &score); 9 10 if...

Mybatis-第N篇配置log4j1、log4j2打印执行的sql语句

1、log4j1配置    目录结构:       conf.xml <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE configuration PUBLIC "-//mybatis.org//DTD Config 3.0//EN" "http://mybatis.org/dtd/myba...

使用PL/SQL Developer连接远程数据库

附送PL/SQL Developer11中文版下载地址 1、先到Oracle网站下载Instant Client : http://www.oracle.com/technetwork/database/features/instant-client/index-097480.html 根据你的操作系统选择不同的Instant Client版本 下载会是一...

knockout前端经常用的功能

1.表单序号自增长 data-bind="text:$index()+1" 2.日期格式显示 datetime:字段名 3.实用的判断 <--  ko if: 判断条件 --> //代码块 <-- /ko --> 4.foreach循环,一般用于表格tbody使用遍历集合,形成列表 <tbody data-bind="fore...

Use // eslint-disable-next-line to ignore the next line.

解决 在build/webpack.base.conf.js文件中,注释或者删除掉:module->rules中有关eslint的规则 参考---https://blog.csdn.net/qq_42108487/article/details/89814708...