summaryrefslogtreecommitdiffstats
path: root/HTML/Chapter/Ch. 10 hands-on assignments/Ch10_msglm/10.5.contact2.html
blob: 6977d05573a9635f01655223b32fb06b878e1109 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
<!DOCTYPE html>
<html lang="en">
    <head>
        <title>Contact Form</title>
        <meta charset="utf-8">
        <style>


form { background-color: #EAEAEA;
    font-family: Arial, sans-serif;
    width: 350px; padding: 10px;}
label { float: left; clear: left;
    display: block; width: 100px; 
    text-align: right; 
    padding-right: 10px;
    margin-top: 10px; }
input, textarea { margin-top: 10px; 
    display: block;}
input[type="submit"] { margin-left: 110px; }

@supports ( display: grid) {

    form { 
        display: grid;
        grid-template-rows: auto;
        grid-template-columns: 6em 1fr;
        grid-gap: 1em; 
        gap: 1em;
        background-color: #EAEAEA;
        font-family: Arial, sans-serif;
        width: 60%; 
        min-width: 20em;
        padding: 2em; 
    }

    input[type="submit"] { 
        grid-column: 2 / 3;
        width: 10em; margin-left: 0; 
    }
}
        </style>
    </head>
    <body>
        <h1>Contact Us</h1>
        <form>
            <label for="myName">Name:</label>
            <input type="text" name="myName" id="myName">
            <label for="myEmail">E-mail:</label>
            <input type="text" name="myEmail" id="myEmail">
            <label for="myComments">Comments:</label>
            <textarea name="myComments" id="myComments" rows="2" cols="20"></textarea>
            <input type="submit" value="Submit">
        </form>
    </body>
</html>