Skip to content

Commit 08353d8

Browse files
committed
activity 4.4.3
1 parent fd4c581 commit 08353d8

File tree

2 files changed

+53
-0
lines changed

2 files changed

+53
-0
lines changed

activity_4.4.3/index.html

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
<!DOCTYPE html>
2+
<!--It's a best practice to always declare DOCTYPE!-->
3+
<html lang="en">
4+
<head>
5+
<title>Practice with Relative Positioning</title>
6+
<meta charset="utf-8">
7+
<link rel="stylesheet" href="style.css">
8+
</head>
9+
<body>
10+
<h1>This is the main title</h1>
11+
<h2>this is the subtitle</h2>
12+
<section>
13+
<div>
14+
<h3>subsection title</h3>
15+
<p>
16+
The "position" property sets the algorithm for how the Web browser will compute the way the HTML elements are placed on the page. There are four different value options for the position property:
17+
</p>
18+
</div>
19+
<div>
20+
<h3>subsection title</h3>
21+
<p>
22+
Once you've set the position to "relative" that frees you up to set the top, right, bottom and left properties- otherwise known as the "box offsets". These properties specify the distance between this object and its normal static position and the corner of the box that we are specifying.
23+
24+
For example, if we set the "left" to be "30px", it will move the element 30px to the right away from the left of where it was placed by default.
25+
</p>
26+
</div>
27+
</section>
28+
</body>
29+
</html>

activity_4.4.3/style.css

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
body {
2+
background-color: #EFEFEF;
3+
color: #A9A9A9;
4+
font-family: "Book Antiqua", serif;
5+
}
6+
h1 {
7+
color: #FF3B3F;
8+
}
9+
h2 {
10+
position: relative;
11+
left: 20px;
12+
}
13+
div {
14+
background-color: #CAEBF2;
15+
width: 80%;
16+
position: relative;
17+
left: 3em;
18+
}
19+
h3 {
20+
color: #FF3B3F;
21+
}
22+
p {
23+
width: 90%;
24+
}

0 commit comments

Comments
 (0)