-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathTask1.html
71 lines (65 loc) · 1.57 KB
/
Task1.html
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
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
<!DOCTYPE html>
<html>
<head>
<title>Приветствие пользователя</title>
<style>
body {
background-color: #f2f2f2;
font-family: Arial, sans-serif;
text-align: center;
}
.container {
max-width: 400px;
margin: 100px auto;
padding: 20px;
background-color: #ffffff;
border-radius: 5px;
box-shadow: 0 2px 5px rgba(0, 0, 0, 0.3);
}
h1 {
color: #333333;
}
input[type="text"] {
width: 100%;
padding: 10px;
margin-bottom: 10px;
border: 1px solid #cccccc;
border-radius: 3px;
font-size: 14px;
}
button {
padding: 10px 20px;
background-color: #4caf50;
color: #ffffff;
border: none;
border-radius: 3px;
font-size: 14px;
cursor: pointer;
}
button:hover {
background-color: #45a049;
}
#greeting {
color: #333333;
font-size: 18px;
margin-top: 20px;
}
</style>
<script>
function greet() {
var name = prompt("Введите ваше имя:");
if (name) {
var greeting = "Привет, " + name + "!";
document.getElementById("greeting").textContent = greeting;
}
}
</script>
</head>
<body>
<div class="container">
<h1>Приветствие пользователя</h1>
<button onclick="greet()">Поприветствовать</button>
<p id="greeting"></p>
</div>
</body>
</html>