Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

dz3-model #7

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 25 additions & 0 deletions 1-1/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
<!DOCTYPE HTML>
<html lang="en-US">
<head>
<meta charset="UTF-8">
<title>1.1</title>
<link rel="stylesheet" href="style.css"/>
</head>
<body>
<div class="box v1">1</div>
<div class="box v2">2</div>
<div class="wrap3">
<div class="box v3">3</div>
</div>
<table>
<tr>
<td align="center">
<div class="box v4">4</div>
</td>
</tr>
</table>
<div class="wrap5">
<div class="box v5">5</div>
</div>
</body>
</html>
31 changes: 31 additions & 0 deletions 1-1/style.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
body {
margin: 0;
}

.box {
box-sizing: border-box;
width: 100px;
height: 100px;
border: 1px solid black;
background-color: silver;
}

.box.v1 { margin: auto; }

.box.v2{
position: relative;
left: 50%;
margin-left: -50px;
}

.wrap3 { text-align: center; }
.box.v3 { display: inline-block; }

table { width: 100%; }

.wrap5 {
float: right;
width: 50%;
}

.box.v5 { margin-left: -50px; }
19 changes: 19 additions & 0 deletions 1-2/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
<!DOCTYPE HTML>
<html lang="en-US">
<head>
<meta charset="UTF-8">
<title>1.2</title>
<link rel="stylesheet" href="style.css"/>
</head>
<body>
<div class="wrap1">
<div class="box v1">Выровнять элемент с высотой 100px и шириной по содержимому (какой-нибудь текст) по центру страницы по горизонтали всеми возможными способами.</div>
</div>
<div class="wrap2">
<div class="box v2">Выровнять элемент с высотой 100px и шириной по содержимому (какой-нибудь текст) по центру страницы по горизонтали всеми возможными способами.</div>
</div>
<div class="wrap3">
<div class="box v3">Выровнять элемент с высотой 100px и шириной по содержимому (какой-нибудь текст) по центру страницы по горизонтали всеми возможными способами.</div>
</div>
</body>
</html>
29 changes: 29 additions & 0 deletions 1-2/style.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
body {
margin: 0;
}

.box {
box-sizing: border-box;
height: 100px;
border: 1px solid black;
background-color: silver;
}

.wrap1 { text-align: center; }
.box.v1 { display: inline-block; }

.wrap2 { text-align: center; }
.box.v2{
display: table;
margin: auto;
}

.wrap3 {
position: relative;
left: 50%;
float: left;
}
.box.v3{
position: relative;
right: 50%;
}
16 changes: 16 additions & 0 deletions 2-1/2-1_v1.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
html, body {
margin: 0;
height: 100%;
}

aside {
float: left;
width: 300px;
height: 100%;
background-color: gray;
}

article {
height: 100%;
background-color: silver;
}
12 changes: 12 additions & 0 deletions 2-1/2-1_v1.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<!DOCTYPE HTML>
<html lang="en-US">
<head>
<meta charset="UTF-8">
<title>2-1_v1</title>
<link rel="stylesheet" href="2-1_v1.css"/>
</head>
<body>
<aside></aside>
<article></article>
</body>
</html>
19 changes: 19 additions & 0 deletions 2-1/2-1_v2.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
html, body {
margin: 0;
height: 100%;
}

aside {
position: absolute;
width: 300px;
height: 100%;
background-color: gray;
}

article {
position: absolute;
right: 0;
left: 300px;
height: 100%;
background-color: silver;
}
12 changes: 12 additions & 0 deletions 2-1/2-1_v2.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<!DOCTYPE HTML>
<html lang="en-US">
<head>
<meta charset="UTF-8">
<title>2.1_v2</title>
<link rel="stylesheet" href="2-1_v2.css"/>
</head>
<body>
<aside></aside>
<article></article>
</body>
</html>
12 changes: 12 additions & 0 deletions 2-2/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<!DOCTYPE HTML>
<html lang="en-US">
<head>
<meta charset="UTF-8">
<title>2.2</title>
<link rel="stylesheet" href="style.css"/>
</head>
<body>
<aside>1</aside>
<article>2</article>
</body>
</html>
19 changes: 19 additions & 0 deletions 2-2/style.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
html, body {
margin: 0;
height: 100%;
background-color: gray;
}

aside {
float: left;
width: 25%;
height: 100%;
max-width: 300px;
min-width: 150px;
background-color: gray;
}

article {
height: 100%;
background-color: silver;
}
22 changes: 22 additions & 0 deletions 3-1_bonus/3-1_v1.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
html, body {
margin: 0;
height: 100%;
}

.box {
box-sizing: border-box;
width: 100px;
height: 100px;
border: 1px solid black;
background-color: silver;
}

.wrap {
display: table;
margin: auto;
height: 100%;
}
.cell {
display: table-cell;
vertical-align: middle;
}
15 changes: 15 additions & 0 deletions 3-1_bonus/3-1_v1.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
<!DOCTYPE HTML>
<html lang="en-US">
<head>
<meta charset="UTF-8">
<title>3-1_v1 (bonus)</title>
<link rel="stylesheet" href="3-1_v1.css"/>
</head>
<body>
<div class="wrap">
<div class="cell">
<div class="box"></div>
</div>
</div>
</body>
</html>
17 changes: 17 additions & 0 deletions 3-1_bonus/3-1_v2.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
html, body {
margin: 0;
height: 100%;
}

.box {
position: absolute;
top: 50%;
left: 50%;
box-sizing: border-box;
margin-top: -50px;
margin-left: -50px;
width: 100px;
height: 100px;
border: 1px solid black;
background-color: silver;
}
11 changes: 11 additions & 0 deletions 3-1_bonus/3-1_v2.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<!DOCTYPE HTML>
<html lang="en-US">
<head>
<meta charset="UTF-8">
<title>3-1_v2 (bonus)</title>
<link rel="stylesheet" href="3-1_v2.css"/>
</head>
<body>
<div class="box"></div>
</body>
</html>
21 changes: 21 additions & 0 deletions 3-1_bonus/3-1_v3.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
html, body {
margin: 0;
height: 100%;
}

.wrap {
float: left;
height: 50%;
margin-bottom: -50px;
}

.box {
margin: auto;
clear: both;
position: relative;
width: 100px;
height: 100px;
border: 1px solid black;
background-color: silver;
box-sizing: border-box;
}
12 changes: 12 additions & 0 deletions 3-1_bonus/3-1_v3.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<!DOCTYPE HTML>
<html lang="en-US">
<head>
<meta charset="UTF-8">
<title>3-1_v3 (bonus)</title>
<link rel="stylesheet" href="3-1_v3.css"/>
</head>
<body>
<div class="wrap"></div>
<div class="box"></div>
</body>
</html>
18 changes: 18 additions & 0 deletions 3-1_bonus/3-1_v4.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
html, body {
margin: 0;
height: 100%;
}

.box {
margin: auto;
position: absolute;
width: 100px;
height: 100px;
top: 0;
bottom: 0;
left: 0;
right: 0;
border: 1px solid black;
background-color: silver;
box-sizing: border-box;
}
11 changes: 11 additions & 0 deletions 3-1_bonus/3-1_v4.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<!DOCTYPE HTML>
<html lang="en-US">
<head>
<meta charset="UTF-8">
<title>3-1_v4 (bonus)</title>
<link rel="stylesheet" href="3-1_v4.css"/>
</head>
<body>
<div class="box"></div>
</body>
</html>
21 changes: 21 additions & 0 deletions 3-2_bonus/3-2_v1.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
html, body {
margin: 0;
height: 100%;
}

.box {
box-sizing: border-box;
width: 100px;
border: 1px solid black;
background-color: silver;
}

.wrap {
display: table;
margin: auto;
height: 100%;
}
.cell {
display: table-cell;
vertical-align: middle;
}
15 changes: 15 additions & 0 deletions 3-2_bonus/3-2_v1.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
<!DOCTYPE HTML>
<html lang="en-US">
<head>
<meta charset="UTF-8">
<title>3-2_v1 (bonus)</title>
<link rel="stylesheet" href="3-2_v1.css"/>
</head>
<body>
<div class="wrap">
<div class="cell">
<div class="box">Выровнять элемент с шириной 100px и высотой по содержимому (какой-нибудь текст) по центру страницы по вертикали всеми возможными способами.</div>
</div>
</div>
</body>
</html>