html5创建联系人表单

html5代码:

(占位文本(PlaceHolder)是指当一个文本框没有被focus的时候显示的是提示文字,当他被点击之后就显示空白。这个功能很不错,但是并不是所有的浏览器都支持。)

<!doctype html>
<html lang="en" class="no-js ie8">
 <head>
  <meta charset="utf-8">
  <title>Contact Form</title>
  <link rel="stylesheet" type="text/css" href="css/style5.css">
 </head>
 <body>
  <div id="contact">
     <h1>Send an email</h1>
     <form action="#" method="post">
      <fieldset>
       <label for="name">Name:</label>
       <input type="text" id="name" placeholder="Enter your full name">
       
       <label for="email">Email:</label>
       <input type="email" id="email" placeholder="Enter your email address">
       
       <label for="message">Message:</label>
       <input type="message" placeholder="What's on your mind?">
    
     <input type="submit" value="Send message">
      </fieldset>
     </form>
     </div>
 </body>
</html>

 

效果图:

css代码如下:

body, div, h1, form, fieldset, input, textarea{
 margin:0; padding:0; border:0; outline:none;
}

html{
 height:100%;
}

body {
 background: #728eaa;
 background: -moz-linear-gradient(top, #25303C 0%, #728EAA 100%); /* firefox */
 background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#25303C), color-stop(100%,#728EAA)); /* webkit */
 font-family: sans-serif;
}

#contact {
 width: 430px; margin: 60px auto; padding: 60px 30px;
 background: #c9d0de; border: 1px solid #e1e1e1;
 -moz-box-shadow: 0px 0px 8px #444;
 -webkit-box-shadow: 0px 0px 8px #444;
}

h1 {
 font-size: 35px; color: #445668; text-transform: uppercase;
 text-align: center; margin: 0 0 35px 0; text-shadow: 0px 1px 0px #f2f2f2;
}

label {
 float: left; clear: left; margin: 11px 20px 0 0; width: 95px;
 text-align: right; font-size: 16px; color: #445668;
 text-transform: uppercase; text-shadow: 0px 1px 0px #f2f2f2;
}

input {
 width: 260px; height: 35px; padding: 5px 20px 0px 20px; margin: 0 0 20px 0;
 background: #5E768D;
 background: -moz-linear-gradient(top, #546A7F 0%, #5E768D 20%); /* firefox */
 background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#546A7F), color-stop(20%,#5E768D)); /* webkit */
 border-radius: 5px; -moz-border-radius: 5px; -webkit-border-radius: 5px;
 -moz-box-shadow: 0px 1px 0px #f2f2f2;-webkit-box-shadow: 0px 1px 0px #f2f2f2;
 font-family: sans-serif; font-size: 16px; color: #f2f2f2; text-transform: uppercase; text-shadow: 0px -1px 0px #334f71;
}
 input::-webkit-input-placeholder  {
     color: #a1b2c3; text-shadow: 0px -1px 0px #38506b;
 }
 input:-moz-placeholder {
     color: #a1b2c3; text-shadow: 0px -1px 0px #38506b;
 }

textarea {
 width: 260px; height: 170px; padding: 12px 20px 0px 20px; margin: 0 0 20px 0;
 background: #5E768D;
 background: -moz-linear-gradient(top, #546A7F 0%, #5E768D 20%); /* firefox */
 background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#546A7F), color-stop(20%,#5E768D)); /* webkit */
 border-radius: 5px; -moz-border-radius: 5px; -webkit-border-radius: 5px;
 -moz-box-shadow: 0px 1px 0px #f2f2f2;-webkit-box-shadow: 0px 1px 0px #f2f2f2;
 font-family: sans-serif; font-size: 16px; color: #f2f2f2; text-transform: uppercase; text-shadow: 0px -1px 0px #334f71;
}
 textarea::-webkit-input-placeholder  {
     color: #a1b2c3; text-shadow: 0px -1px 0px #38506b;
 }
 textarea:-moz-placeholder {
     color: #a1b2c3; text-shadow: 0px -1px 0px #38506b;
 }

input:focus, textarea:focus {
 background: #728eaa;
 background: -moz-linear-gradient(top, #668099 0%, #728eaa 20%); /* firefox */
 background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#668099), color-stop(20%,#728eaa)); /* webkit */
}

input[type=submit] {
 width: 185px; height: 52px; float: right; padding: 10px 15px; margin: 0 15px 0 0;
 -moz-box-shadow: 0px 0px 5px #999;-webkit-box-shadow: 0px 0px 5px #999;
 border: 1px solid #556f8c;
 background: -moz-linear-gradient(top, #718DA9 0%, #415D79 100%); /* firefox */
 background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#718DA9), color-stop(100%,#415D79)); /* webkit */
 cursor: pointer;
}

 

转载于:https://www.cnblogs.com/wlfhotte/archive/2011/12/13/2285994.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值