Advertisement
JonneOpettaja

Untitled

Nov 4th, 2018
152
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
CSS 5.63 KB | None | 0 0
  1.  
  2. /* Add some margin to the page and set a default font and colour */
  3.  
  4. body {
  5.   margin: 30px;
  6.   font-family: "Georgia", serif;
  7.   line-height: 1.8em;
  8.   color: #333;
  9. }
  10.  
  11.  
  12. /* Set the content dimensions */
  13.  
  14. #content {
  15.   width: 800px;
  16.   padding: 50px;
  17.   margin: 0 auto;
  18.   display: block;
  19.   font-size: 1.2em;
  20. }
  21.  
  22. #content h2 {
  23.   line-height: 1.5em;
  24. }
  25.  
  26.  
  27. /* Add curved borders to various elements */
  28.  
  29. #contactForm, .statusMessage, input[type="submit"], input[type="button"] {
  30.   -moz-border-radius: 10px;
  31.   -webkit-border-radius: 10px;  
  32.   border-radius: 10px;
  33. }
  34.  
  35.  
  36. /* Style for the contact form and status messages */
  37.  
  38. #contactForm, .statusMessage {
  39.   color: #666;
  40.   background-color: #ebedf2;
  41.   background: -webkit-gradient( linear, left bottom, left top, color-stop(0,#dfe1e5), color-stop(1, #ebedf2) );
  42.   background: -moz-linear-gradient( center bottom, #dfe1e5 0%, #ebedf2 100% );  
  43.   border: 1px solid #aaa;
  44.   -moz-box-shadow: 0 0 1em rgba(0, 0, 0, .5);
  45.   -webkit-box-shadow: 0 0 1em rgba(0, 0, 0, .5);
  46.   box-shadow: 0 0 1em rgba(0, 0, 0, .5);
  47.   opacity: .95;
  48. }
  49.  
  50.  
  51. /* The form dimensions */
  52.  
  53. #contactForm {
  54.   width: 40em;
  55.   height: 33em;
  56.   padding: 0 1.5em 1.5em 1.5em;
  57.   margin: 0 auto;
  58. }
  59.  
  60.  
  61. /* Position the form in the middle of the window (if JavaScript is enabled) */
  62.  
  63. #contactForm.positioned {
  64.   position: fixed;
  65.   top: 0;
  66.   bottom: 0;
  67.   left: 0;
  68.   right: 0;
  69.   margin-top: auto;
  70.   margin-bottom: auto;
  71. }
  72.  
  73.  
  74. /* Dimensions and position of the status messages */
  75.  
  76. .statusMessage {
  77.   display: none;
  78.   margin: auto;
  79.   width: 30em;
  80.   height: 2em;
  81.   padding: 1.5em;
  82.   position: fixed;
  83.   top: 0;
  84.   bottom: 0;
  85.   left: 0;
  86.   right: 0;
  87. }
  88.  
  89. .statusMessage p {
  90.   text-align: center;
  91.   margin: 0;
  92.   padding: 0;
  93. }
  94.  
  95.  
  96. /* The header at the top of the form */
  97.  
  98. #contactForm h2 {
  99.   font-size: 2em;
  100.   font-style: italic;
  101.   letter-spacing: .05em;
  102.   margin: 0 0 1em -.75em;
  103.   padding: 1em;
  104.   width: 19.5em;  
  105.   color: #aeb6aa;
  106.   background: #dfe0e5 url('images/stamp.jpg') no-repeat 15em -3em; /* http://morguefile.com/archive/display/606433 */
  107.   border-bottom: 1px solid #aaa;
  108.   -moz-border-radius: 10px 10px 0 0;
  109.   -webkit-border-radius: 10px 10px 0 0;  
  110.   border-radius: 10px 10px 0 0;
  111. }
  112.  
  113.  
  114. /* Give form elements consistent margin, padding and line height */
  115.  
  116. #contactForm ul {
  117.   list-style: none;
  118.   margin: 0;
  119.   padding: 0;
  120. }
  121.  
  122. #contactForm ul li {
  123.   margin: .9em 0 0 0;
  124.   padding: 0;
  125. }
  126.  
  127. #contactForm input, #contactForm label {
  128.   line-height: 1em;
  129. }
  130.  
  131.  
  132. /* The field labels */
  133.  
  134. label {
  135.   display: block;
  136.   float: left;
  137.   clear: left;
  138.   text-align: right;
  139.   width: 28%;
  140.   padding: .4em 0 0 0;
  141.   margin: .15em .5em 0 0;
  142.   font-weight: bold;
  143. }
  144.  
  145.  
  146. /* The fields */
  147.  
  148. input, textarea {
  149.   display: block;
  150.   margin: 0;
  151.   padding: .4em;
  152.   width: 67%;
  153.   font-family: "Georgia", serif;
  154.   font-size: 1em;
  155.   border: 1px solid #aaa;
  156.   -moz-border-radius: 5px;
  157.   -webkit-border-radius: 5px;    
  158.   border-radius: 5px;
  159.   -moz-box-shadow: rgba(0,0,0,.2) 0 1px 4px inset;
  160.   -webkit-box-shadow: rgba(0,0,0,.2) 0 1px 4px inset;
  161.   box-shadow: rgba(0,0,0,.2) 0 1px 4px inset;
  162.   background: #fff;
  163. }
  164.  
  165. textarea {
  166.   height: 13em;
  167.   line-height: 1.5em;
  168.   resize: none;
  169. }
  170.  
  171.  
  172. /* Place a border around focused fields, and hide the inner shadow */
  173.  
  174. #contactForm *:focus {
  175.   border: 1px solid #66f;
  176.   outline: none;
  177.   box-shadow: none;
  178.   -moz-box-shadow: none;
  179.   -webkit-box-shadow: none;
  180. }
  181.  
  182.  
  183. /* Display correctly filled-in fields with a green background */
  184.  
  185. input:valid, textarea:valid {
  186.   background: #dfd;
  187. }
  188.  
  189.  
  190. /* The Send and Cancel buttons */
  191.  
  192. input[type="submit"], input[type="button"] {
  193.   float: right;
  194.   margin: 2em 1em 0 1em;
  195.   width: 10em;
  196.   padding: .5em;
  197.   border: 1px solid #666;
  198.   -moz-border-radius: 10px;
  199.   -webkit-border-radius: 10px;  
  200.   border-radius: 10px;
  201.   -moz-box-shadow: 0 0 .5em rgba(0, 0, 0, .8);
  202.   -webkit-box-shadow: 0 0 .5em rgba(0, 0, 0, .8);
  203.   box-shadow: 0 0 .5em rgba(0, 0, 0, .8);
  204.   color: #fff;
  205.   background: #0a0;
  206.   font-size: 1em;
  207.   line-height: 1em;
  208.   font-weight: bold;
  209.   opacity: .7;
  210.   -webkit-appearance: none;
  211.   -moz-transition: opacity .5s;
  212.   -webkit-transition: opacity .5s;
  213.   -o-transition: opacity .5s;
  214.   transition: opacity .5s;
  215. }
  216.  
  217. input[type="submit"]:hover,
  218. input[type="submit"]:active,
  219. input[type="button"]:hover,
  220. input[type="button"]:active {
  221.   cursor: pointer;
  222.   opacity: 1;
  223. }
  224.  
  225. input[type="submit"]:active, input[type="button"]:active {
  226.   color: #333;
  227.   background: #eee;
  228.   -moz-box-shadow: 0 0 .5em rgba(0, 0, 0, .8) inset;
  229.   -webkit-box-shadow: 0 0 .5em rgba(0, 0, 0, .8) inset;
  230.   box-shadow: 0 0 .5em rgba(0, 0, 0, .8) inset;
  231. }
  232.  
  233. input[type="button"] {
  234.   background: #f33;
  235. }
  236.  
  237.  
  238. /* Header/footer boxes */
  239.  
  240. .wideBox {
  241.   clear: both;
  242.   text-align: center;
  243.   margin: 70px;
  244.   padding: 10px;
  245.   background: #ebedf2;
  246.   border: 1px solid #333;
  247. }
  248.  
  249. .wideBox h1 {
  250.   font-weight: bold;
  251.   margin: 20px;
  252.   color: #666;
  253.   font-size: 1.5em;
  254. }
  255.  
  256. </style>
  257.  
  258. <!-- Some IE7 hacks and workarounds -->
  259.  
  260. <!--[if lt IE 8]>
  261. <style>
  262.  
  263. /* IE7 needs the fields to be floated as well as the labels */
  264.  
  265. input, textarea {
  266.   float: right;
  267. }
  268.  
  269. #formButtons {
  270.   clear: both;
  271. }
  272.  
  273. /*
  274.   IE7 needs an ickier approach to vertical/horizontal centring with fixed positioning.
  275.   The negative margins are half the element's width/height.
  276. */
  277.  
  278. #contactForm.positioned, .statusMessage {
  279.   left: 50%;
  280.   top: 50%;
  281. }
  282.  
  283. #contactForm.positioned {
  284.   margin-left: -20em;
  285.   margin-top: -16.5em;
  286. }
  287.  
  288. .statusMessage {
  289.   margin-left: -15em;
  290.   margin-top: -1em;
  291. }
  292.  
  293. </style>
  294. <![endif]-->
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement