1 {
2 box-sizing: border-box;
3}
4
5input[type=text], select, textarea {
6 width: 100%;
7 padding: 12px;
8 border: 1px solid #ccc;
9 border-radius: 4px;
10 resize: vertical;
11}
12
13label {
14 padding: 12px 12px 12px 0;
15 display: inline-block;
16}
17
18input[type=submit] {
19 background-color: #4CAF50;
20 color: white;
21 padding: 12px 20px;
22 border: none;
23 border-radius: 4px;
24 cursor: pointer;
25 float: right;
26}
27
28input[type=submit]:hover {
29 background-color: #45a049;
30}
31
32.container {
33 border-radius: 5px;
34 background-color: #f2f2f2;
35 padding: 20px;
36}
37
38.col-25 {
39 float: left;
40 width: 25%;
41 margin-top: 6px;
42}
43
44.col-75 {
45 float: left;
46 width: 75%;
47 margin-top: 6px;
48}
49
50/* Clear floats after the columns */
51.row:after {
52 content: "";
53 display: table;
54 clear: both;
55}
56
57/* Responsive layout - when the screen is less than 600px wide, make the two columns stack on top of each other instead of next to each other */
58@media screen and (max-width: 600px) {
59 .col-25, .col-75, input[type=submit] {
60 width: 100%;
61 margin-top: 0;
62 }
63}
64/*
65 HTML:
66 <!DOCTYPE html>
67 <html>
68 <head>
69 <meta name="viewport" content="width=device-width, initial-scale=1">
70
71 </head>
72 <body>
73
74 <h2>Responsive Form</h2>
75 <p>Resize the browser window to see the effect. When the screen is less than 600px wide, make the two columns stack on top of each other instead of next to each other.</p>
76
77 <div class="container">
78 <form action="/action_page.php">
79 <div class="row">
80 <div class="col-25">
81 <label for="fname">First Name</label>
82 </div>
83 <div class="col-75">
84 <input type="text" id="fname" name="firstname" placeholder="Your name..">
85 </div>
86 </div>
87 <div class="row">
88 <div class="col-25">
89 <label for="lname">Last Name</label>
90 </div>
91 <div class="col-75">
92 <input type="text" id="lname" name="lastname" placeholder="Your last name..">
93 </div>
94 </div>
95 <div class="row">
96 <div class="col-25">
97 <label for="country">Country</label>
98 </div>
99 <div class="col-75">
100 <select id="country" name="country">
101 <option value="australia">Australia</option>
102 <option value="canada">Canada</option>
103 <option value="usa">USA</option>
104 </select>
105 </div>
106 </div>
107 <div class="row">
108 <div class="col-25">
109 <label for="subject">Subject</label>
110 </div>
111 <div class="col-75">
112 <textarea id="subject" name="subject" placeholder="Write something.." style="height:200px"></textarea>
113 </div>
114 </div>
115 <div class="row">
116 <input type="submit" value="Submit">
117 </div>
118 </form>
119 </div>
120
121 </body>
122 </html>
123*/
124
1table, th, td {
2 padding: 1.5%;
3 border: 1px solid white;
4 text-align: center;
5}
6
7button{
8 width: 100%;
9 height: 100%;
10 padding: 2px ;
11 margin: 2px;
12}
13
14body {
15 background-image: url(https://images.unsplash.com/photo-1574375927938-d5a98e8ffe85?ixlib=rb-1.2.1&ixid=eyJhcHBfaWQiOjEyMDd9&auto=format&fit=crop&w=1949&q=80);
16 height: 100%;
17
18 background-position: center;
19 background-repeat: no-repeat;
20 background-size: cover;
21 color: honeydew;
22}
23
24.h1-header, h1{
25 text-align: center;
26 width: 100%;
27 height: 70px;
28 font-size: 14px;
29 padding-top:0px ;
30}
31h1 {
32 font-size: 36px;
33 font-style: italic;
34
35}
36.form1 {
37 float: left;
38
39width: 20%;
40height: 300px;
41margin: 150px 0 0 200px;
42 background-color: #3a303099;
43
44}
45.form1 #form {
46 color: honeydew;
47
48}
49form{
50 padding: 50px;
51 }
52
53
54.table {
55 width: 35%;
56 margin: 150px 200px 0 800px;
57
58}
59
60table{
61padding: 50px 120px;
62}
63