Skip to content

Commit f293c82

Browse files
committed
understood how, just need to break down details of px assigment in the css
1 parent 0c1b205 commit f293c82

File tree

3 files changed

+84
-8
lines changed

3 files changed

+84
-8
lines changed

display-exercise.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
<div class='box box_third black'></div>
2828
<div class='box box_third orange'></div>
2929
</div>
30-
</div>
30+
<
3131
</main>
3232
</body>
3333
</html>

position-exercise.html

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -12,14 +12,12 @@
1212

1313
<!-- styles -->
1414
<link rel="stylesheet" type="text/css" href="styles/main.css">
15-
16-
<!-- your styles go in position-page.css -->
1715
<link rel="stylesheet" type="text/css" href="styles/position-page.css">
1816
</head>
1917
<body>
20-
<!-- To finish the design, the HTML for the nav requires no additional elements, just the right CSS -->
21-
<nav>
22-
<img src="images/icon.png">
18+
<!-- put your nav code in the nav element-->
19+
<nav class="container">
20+
<img src="images/icon.png" class="icon-img">
2321
<ul>
2422
<li><a href="index.html">Home</a></li>
2523
<li><a href="display-exercise.html">display</a></li>
@@ -28,7 +26,12 @@
2826
</nav>
2927

3028
<main>
31-
<!-- Put the HTML you need to accomplish the design -->
29+
<div class="hero-image">
30+
<div class="box">
31+
<img src="images/spacecat.png" class='spacecat'>
32+
<img src="images/spacedog.png" class='spacedog'>
33+
</div>
34+
</div>
3235
</main>
3336
</body>
34-
</html>
37+
</html>

styles/position-page.css

Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,74 @@
1+
.container {
2+
padding-left: 60px;
3+
padding-right: 60px;
4+
}
15

6+
nav {
7+
height: 60px;
8+
background-color: grey;
9+
position: fixed;
10+
width: 100%;
11+
}
12+
13+
nav .icon-img {
14+
height: 50px;
15+
margin-top: 5px;
16+
margin-bottom: 5px;
17+
border-radius: 50%;
18+
vertical-align: middle;
19+
border: 1px solid black;
20+
}
21+
22+
nav ul {
23+
display: inline-block;
24+
list-style: none;
25+
}
26+
27+
nav li {
28+
display: inline-block;
29+
}
30+
31+
nav li::after {
32+
content: "|";
33+
margin-left: 5px;
34+
}
35+
36+
nav a:hover {
37+
color: black;
38+
}
39+
40+
body {
41+
background: url(../images/outerspace_landscape.jpeg) no-repeat;
42+
background-size: cover;
43+
}
44+
45+
main {
46+
padding-top: 90px;
47+
min-width: 1000px;
48+
}
49+
50+
.box {
51+
margin-top: 150px;
52+
width: 600px;
53+
height: 300px;
54+
position: relative;
55+
border: 10px dotted green;
56+
margin-left: auto;
57+
margin-right: auto;
58+
}
59+
60+
61+
.spacecat, .spacedog {
62+
position: absolute;
63+
width: 200px;
64+
}
65+
66+
.spacecat {
67+
top: -90px;
68+
left: -90px;
69+
}
70+
71+
.spacedog {
72+
bottom: -120px;
73+
right: -60px;
74+
}

0 commit comments

Comments
 (0)