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

Домашнее задание №3 #5

Open
wants to merge 7 commits into
base: master
Choose a base branch
from
116 changes: 116 additions & 0 deletions 1_1.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,116 @@
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>Выравнивание 1.1</title>
<style type="text/css">

div.a1 {
width:100px;
height:100px;
background-color:#7a00ff;
color:#FFF;
text-align:center;
}
div.boxForA1{
background-color:#CCC;
padding-left:50%;
margin-left:-50px;
}

div.a2 {
width:100px;
height:100px;
background-color:#007fff;
color:#FFF;
text-align:center;
margin-top:50px;
margin-left:auto;
margin-right:auto;
}
div.a3 {
background-color:#f47330;
color:#fff;
width:100px;
height:100px;
margin-top:50px;
text-align:center;


}
.a4 {
background-color:#f4c430;
color:#f00;
width:100px;
height:100px;
text-align:center;
float:left;
}
div.boxForA4_1 {
width:50%;
height:150px;
float:left;
background-color:#CCC;
margin-left:-50px;


}
div.boxForA4_2{
width:50%;
height:150px;
float:right;
background-color:#CCC;
margin-right:-50px;
}
col {
width:50%;
}
div.a5 {
background-color:#7fff00;
color:#00f;
width:100px;
height:100px;
text-align:center;
position:fixed;
left:50%;
margin-left:-50px;
top:800px;
}
span.a6 {
background-color:#000;
color:#FFF;
padding-top:78px;
font-size:20px;
word-spacing:25px;

}
div.boxForA6 {
text-align:center;
margin-top:140px;
}
</style>
</head>
<body>

<div class="boxForA1"><div class="a1">Блок 100х100 1 Способ</div></div>
<div class="boxForA6">
<span class="a6">6 способ
</span>
</div>
<div class="a2">Блок 100х100 2 Способ</div>
<table width="100%">
<col/>
<tr>
<td> </td>
<td>
<div class="a3" style="margin-left:-50px;">Блок 100х100 3 Способ</div>
</td>
<td>
</td>
</tr>
</table>
<div class="boxForA4_1"></div>
<div class="a4" > Блок 100х100 4 Способ</div>
<div class="boxForA4_2"> </div>
<div class="a5">Блок 100х100 5 Способ</div>
</body>
</html>
30 changes: 30 additions & 0 deletions 2_1.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>Раскладка 2.1</title>
<style type="text/css">
div {
color:#FFF;
}
div.left {
background-color:#06F;
float:left;
padding-bottom:100%;
width:300px;

}
div.right{
background-color:#C33;
padding-bottom:100%;
text-align:center;
}

</style>
</head>

<body>
<div class="left">Левая колонка = 300 px</div>
<div class="right">Правая колонка = все остальное</div>
</body>
</html>
101 changes: 101 additions & 0 deletions dz-3/dz-3(1.1).html
Original file line number Diff line number Diff line change
@@ -0,0 +1,101 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf=-8" />
<title>dz-1.1</title>
<style>
* {margin: 0; padding: 0;}

body, html {
width: 100%;
height: 100%;
text-align: center;
color: gray;
}

#inform { position: absolute; bottom: 10px; left: 10px; }
pre { padding: 10px 0 10px 10px; font-weight: bold; text-align: left; }

#box-1, #box-2,
#box-3, #box-4 {
width: 88px;
height: 88px;
padding: 5px;
margin: 20px 0 20px 0;
border: 1px solid red;
font: normal 12px Arial;
text-align: left;
}

span { font-weight: bold; color: green; }

#box-1 { margin: 20px auto; }

#box-2 { display: inline-block; }

#box-3 {
position: relative;
left: 50%;
margin-left: -50px;
}

#box-4 {
position: absolute;
left: 50%;
margin-left: -50px;
}
</style>
</head>
<body>
<div id="inform">
<pre>
<h2 style="color: #000;">Общие стили</h2><span>body</span> { text-align: center; }</pre>
<pre>
<span>#box-1, #box-2, #box-3, #box-4</span> {
width: 88px;
height: 88px;
padding: 5px;
margin-top: 30px;
border: 1px solid #000;
font: normal 12px Arial;
text-align: left;
}
</pre>
</div>

<div id="box-1">
<code>
<span>#box-1</span> { margin: 0 auto; }
</code>
</div>

<div id="box-2">
<code>
<span>#box-2</span> {
display: inline-block;
}
</code>
</div>

<div id="box-3">
<code>
<span>#box-3</span> {
position: relative;
left: 50%;
margin-left: -50px;
}
</code>
</div>

<div id="box-4">
<code>
<span>#box-4</span> {
position: absolute;
left: 50%;
margin-left: -50px;
}
</code>
</div>
</body>
</html>

79 changes: 79 additions & 0 deletions dz-3/dz-3(1.2).html
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf=-8" />
<title>dz-1.2</title>
<style>
* {margin: 0; padding: 0;}

body, html { text-align: center; }
pre { position: absolute; bottom: 10px; left: 10px; text-align: left; z-index: -10; }
div { height: 80px; padding: 10px; background: #ffffa2; border: 1px solid red; text-align: left; }
div p span { display: none; }
a { font: bold 18px Arial; } a:hover { text-decoration: none; color: blue; }

#box-1 { display: table; margin: 20px auto; }

#box-2 { display: inline-block; margin-top: 20px; }
</style>

<script src="http://code.jquery.com/jquery-1.8.2.js"></script>
<script>
$(function() {
$('a').toggle(function() {
$(this).text('HIDE TEXT').next().fadeIn(300);
}, function() {
$(this).text('ADD TEXT').next().fadeOut(200);
});
});
</script>
</head>

<body>
<pre>
<h2>Общие стили</h2>
<code>* {margin: 0; padding: 0;}

body, html { text-align: center; }

div {
max-width: 800px;
height: 80px;
padding: 10px;
background: #ffffa2;
border: 1px solid red;
text-align: left;
}

<h2>Стили для центрируемых блоков</h2>
#box-1 {
display: table;
margin: 20px auto;
}

#box-2 {
display: inline-block;
margin-top: 20px;
}
</code>
<blockquote style="color: red; font: bold 16px Arial;">jQuery используется только для добавления и скрытия текста.</blockquote>
<code>$(function() {
$('a').toggle(function() {
$(this).text('HIDE TEXT').next().fadeIn(300);
}, function() {
$(this).text('ADD TEXT').next().fadeOut(200);
});
});
</code>
</pre>

<div id="box-1">
<p><a href="#">ADD TEXT</a> <span>Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.</span></p>
</div>

<div id="box-2">
<p><a href="#">ADD TEXT</a> <span>Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.</span></p>
</div>
</body>
</html>

52 changes: 52 additions & 0 deletions dz-3/dz-3(2.1).html
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf=-8" />
<title>dz-3(2.1)</title>
<style>
* {margin: 0; padding: 0;}
body, html {width: 100%; height: 100%;}
.wrapper {width: 100%; min-height: 100%;}
header {
width: 100%;
height: 100px;
background: silver;
}

aside {
width: 300px;
min-height: 400px;
background: aqua;
float: left;
}

article {
min-height: 280px;
min-width: 280px;
padding: 10px 20px 110px 20px;
margin-left: 300px;
background: #ffffa2;
text-align: justify;
}

.clear {height: 1px; clear: both;}

footer {
width: 100%;
height: 100px;
background: silver;
margin-top: -101px;
clear: both;
}
</style>
</head>
<body>
<div class="wrapper">
<header></header>
<aside></aside>
<article>Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed...HIDE TEXT do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed...HIDE TEXT do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed...HIDE TEXT do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.</article>
</div>
<footer></footer>
</body>
</html>

Loading