Advertisement
Nerkes

form

Jun 27th, 2017
489
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
HTML 5 3.26 KB | None | 0 0
  1. <!DOCTYPE html>
  2. <html>
  3. <body>
  4. <form class="contact_form" action="#" method="post" name="contact_form">
  5.     <ul>
  6.         <li>
  7.              <h2>Контакты</h2>
  8.         </li>
  9.         <li>
  10.             <label for="name">Ваше имя:</label>
  11.             <input type="text"  placeholder="Иванов Иван" required />
  12.         </li>
  13.         <li>
  14.             <label for="email">Email:</label>
  15.             <input type="email" name="email" placeholder="ivanov@example.com" required />
  16.         </li>
  17.         <li>
  18.             <label for="message">Сообщение:</label>
  19.             <textarea name="message" cols="40" rows="6" required ></textarea>
  20.         </li>
  21.         <li>
  22.             <a href="#" class="knopka">Отправить</a>
  23.         </li>
  24.     </ul>
  25. </form>
  26. <style>
  27.  
  28. *:focus {outline: none;}
  29.  
  30. body {font: 14px/21px "Lucida Sans", "Lucida Grande", "Lucida Sans Unicode", sans-serif;}
  31. .contact_form h2, .contact_form label {font-family:Georgia, Times, "Times New Roman", serif;}
  32. .form_hint, .required_notification {font-size: 11px;}
  33.  
  34. /* === стили list === */
  35. .contact_form ul {
  36.     width:750px;
  37.     list-style-type:none;
  38.     list-style-position:outside;
  39.     margin:0px;
  40.     padding:0px;
  41. }
  42. .contact_form li{
  43.     padding:12px;
  44.     border-bottom:1px solid #eee;
  45.     position:relative;
  46. }
  47. .contact_form li:first-child, .contact_form li:last-child {
  48.     border-bottom:1px solid #777;
  49. }
  50.  
  51. /* === заголовок === */
  52. .contact_form h2 {
  53.     margin:0;
  54.     display: inline;
  55. }
  56. .required_notification {
  57.     color:#d45252;
  58.     margin:5px 0 0 0;
  59.     display:inline;
  60.     float:right;
  61. }
  62.  
  63. /* === стили элементов формы === */
  64. .contact_form label {
  65.     width:150px;
  66.     margin-top: 3px;
  67.     display:inline-block;
  68.     float:left;
  69.     padding:3px;
  70. }
  71. .contact_form input {
  72.     height:20px;
  73.     width:220px;
  74.     padding:5px 8px;
  75. }
  76. .contact_form textarea {padding:8px; width:300px;}
  77. .contact_form a {margin-left:156px; }
  78.  
  79.     .contact_form input, .contact_form textarea {
  80.         border:1px solid #aaa;
  81.         box-shadow: 0px 0px 3px #ccc, 0 10px 15px #eee inset;
  82.         padding-right:30px;
  83.         -moz-transition: padding .25s;
  84.         -webkit-transition: padding .25s;
  85.         -o-transition: padding .25s;
  86.         transition: padding .25s;
  87.     }
  88.     .contact_form input:focus, .contact_form textarea:focus {
  89.         background: #fff;
  90.         border:1px solid #555;
  91.         box-shadow: 0 0 3px #aaa;
  92.         padding-right:70px;
  93.     }
  94.  
  95.  
  96.  
  97.  
  98. .form_hint {
  99.     background: #d45252;
  100.     color: white;
  101.     margin-left:8px;
  102.     padding: 1px 6px;
  103.     z-index: 999;
  104.     position: absolute;
  105.     display: none;
  106. }
  107. .form_hint::before {
  108.     content: "\25C0";
  109.     color:#d45252;
  110.     position: absolute;
  111.     top:1px;
  112.     left:-6px;
  113. }
  114. .contact_form input:focus + .form_hint {display: inline;}
  115. .contact_form input:required:valid + .form_hint {background: #28921f;}
  116. .contact_form input:required:valid + .form_hint::before {color:#28921f;}
  117.    
  118. /* === стили кнопки === */
  119. a.knopka {
  120.     color: #fff; /* цвет текста */
  121.   text-decoration: none; /* убирать подчёркивание у ссылок */
  122.   user-select: none; /* убирать выделение текста */
  123.   background: #69FF42; /* фон кнопки */
  124.   padding: .7em 1.5em; /* отступ от текста */
  125. }
  126. a.knopka:hover
  127. { background: #42FF76; }
  128.  
  129.  
  130. </style>
  131. </body>
  132. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement