一款不错的表单样式

一款不错的表单样式
主要学习表单的HTML结构

Paste_Image.png
<!DOCTYPE html>
<html>
<head>
    <meta charset=utf-8>
    <meta name=viewport content="width=device-width, initial-scale=1">
    <link rel="stylesheet" type="text/css" href="form.css">
    <title>表单</title>

</head>
<body>
<div class="basic-grey">
    <form action="" method="post" class="STYLE-NAME">
        <h1>Contact Form
            <span>Please fill all the texts in the fields.</span>
        </h1>

        <label>
            <span>Your Name :</span>
            <input id="name" type="text" name="name" placeholder="Your Full Name" />
        </label>

        <label>
            <span>Your Email :</span>
            <input id="email" type="email" name="email" placeholder="Valid Email Address" />
        </label>

        <label>
            <span>Message :</span>
            <textarea id="message" name="message" placeholder="Your Message to Us"></textarea>
        </label>

        <label>
            <span>Subject :</span><select name="selection">
            <option value="Job Inquiry">Job Inquiry</option>
            <option value="General Question">General Question</option>
            </select>
        </label>

        <label>
            <span>&nbsp;</span>
            <input type="button" class="button" value="Send" />
        </label>
    </form>
</div>

</body>
</html>

CSS样式:

/* Basic Grey */
.basic-grey {
    margin-left:auto;
    margin-right:auto;
    max-width: 500px;
    background: #F7F7F7;
    padding: 25px 15px 25px 10px;
    font: 12px Georgia, "Times New Roman", Times, serif;
    color: #888;
    text-shadow: 1px 1px 1px #FFF;
    border:1px solid #E4E4E4;
}
.basic-grey h1 {
    font-size: 25px;
    padding: 0px 0px 10px 40px;
    display: block;
    border-bottom:1px solid #E4E4E4;
    margin: -10px -15px 30px -10px;;
    color: #888;
}
.basic-grey h1>span {
display: block;
font-size: 11px;
}
.basic-grey label {
display: block;
margin: 0px;
}
.basic-grey label>span {
float: left;
width: 20%;
text-align: right;
padding-right: 10px;
 margin-top: 10px;
color: #888;

}
.basic-grey input[type="text"], .basic-grey input[type="email"], .basic-grey textarea, .basic-grey select {
border: 1px solid #DADADA;
color: #888;
height: 30px;
 margin-bottom: 16px;
 margin-right: 6px;
 margin-top: 2px;
 outline: 0 none;
 padding: 3px 3px 3px 5px;
 width: 70%;
 font-size: 12px;
 line-height:15px;
 box-shadow: inset 0px 1px 4px #ECECEC;
 -moz-box-shadow: inset 0px 1px 4px #ECECEC;
 -webkit-box-shadow: inset 0px 1px 4px #ECECEC;
}
 .basic-grey textarea{
 padding: 5px 3px 3px 5px;
 }
.basic-grey select {
background: #FFF url('down-arrow.png') no-repeat right;
background: #FFF url('down-arrow.png') no-repeat right);
appearance:none;
-webkit-appearance:none;
-moz-appearance: none;
 text-indent: 0.01px;
 text-overflow: '';
 width: 70%;
 height: 35px;
 line-height: 25px;
 }
 .basic-grey textarea{
 height:100px;
 }
 .basic-grey .button {
 background: #E27575;
 border: none;
 padding: 10px 25px 10px 25px;
olor: #FFF;
 box-shadow: 1px 1px 5px #B6B6B6;
 border-radius: 3px;
 text-shadow: 1px 1px 1px #9E3F3F;
 cursor: pointer;
 }
 .basic-grey .button:hover {
 background: #CF7A7A
 }
最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容

  • Android 自定义View的各种姿势1 Activity的显示之ViewRootImpl详解 Activity...
    passiontim阅读 174,638评论 25 709
  • 发现 关注 消息 iOS 第三方库、插件、知名博客总结 作者大灰狼的小绵羊哥哥关注 2017.06.26 09:4...
    肇东周阅读 12,300评论 4 61
  • 每日清晨,都被小米踩踏亲吻而醒,不得贪睡。今日腊八,也正好可以早早把泡了一夜的八谷点火熬起,便没有批评小米。...
    荷月弯弯阅读 1,302评论 1 0
  • 哥,刘云又喊了一声,刘聪坐在沙发上,刘聪调皮的扬了扬头,和爸爸同时说了一句“回来了”,二人相视一愣,笑了。 刘云回...
    隼梦阅读 306评论 2 1
  • 王宝明阅读 123评论 0 1