This commit is contained in:
2025-10-12 00:36:15 +03:00
parent 2ed742574f
commit 5b4ad7a829

103
task-2.html Normal file
View File

@@ -0,0 +1,103 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Практична робота №2. Завдання №2</title>
<style>
/* Head of the "creature" */
.head {
position: absolute;
top: 10px;
left: 10px;
width: 200px;
height: 150px;
border: 2px solid black;
}
.head > div {
position: absolute;
width: calc(200px / 2);
height: calc(150px / 2);
}
.head > div:nth-child(1) {
top: 0;
left: 0;
background-color: green;
}
.head > div:nth-child(2) {
bottom: 0;
left: 0;
background-color: black;
}
.head > div:nth-child(3) {
bottom: 0;
right: 0;
background-color: brown;
}
/* Body of the "creature" */
.body {
position: absolute;
top: 10px;
left: 230px;
width: 400px;
height: 150px;
border: 2px solid black;
background-color: lightgray;
}
.body > div {
position: absolute;
top: 15px;
left: 15px;
right: 15px;
bottom: 15px;
background-color: red;
}
.legs > div {
position: absolute;
top: 125px;
width: 150px;
height: 150px;
border: 2px solid black;
background-color: blue;
z-index: -1;
}
.legs > div:nth-child(1) {
left: 145px;
}
.legs > div:nth-child(2) {
left: calc(145px + (150px + 10px));
z-index: 1;
}
.legs > div:nth-child(3) {
left: calc(145px + (150px + 10px) * 2);
}
</style>
</head>
<body>
<!-- The "Creature" -->
<div class="head">
<div></div>
<div></div>
<div></div>
</div>
<div class="body">
<div></div>
</div>
<div class="legs">
<div></div>
<div></div>
<div></div>
</div>
</body>
</html>