File tree Expand file tree Collapse file tree 2 files changed +36
-3
lines changed Expand file tree Collapse file tree 2 files changed +36
-3
lines changed Original file line number Diff line number Diff line change @@ -49,6 +49,11 @@ <h2>The Basic Language of the Web: HTML</h2>
49
49
height ="200 "
50
50
class ="post-image "
51
51
/>
52
+
53
+ <!--Because of the absolution position of this button, it'll be at the bottom, right corner.
54
+ Because the button is inside the container now, it is absolute relative to the container
55
+ element which is limited to 1200px wide.-->
56
+ < button > ❤️Like</ button >
52
57
</ header >
53
58
54
59
< p >
@@ -148,6 +153,8 @@ <h4>Related posts</h4>
148
153
< footer >
149
154
< p id ="copyright " class ="copyright text "> Copyright © 2027 by The Code Magazine.</ p >
150
155
</ footer >
156
+
151
157
</ div > <!--This is the main div closure-->
158
+
152
159
</ body >
153
160
</ html >
Original file line number Diff line number Diff line change 5
5
padding : 0 ;
6
6
}
7
7
8
+ /*PAGE SECTIONS*/
8
9
body {
9
10
color : # 444 ;
10
11
border-top : 10px solid # 1098ad ;
12
+ position : relative;
13
+ /*Any absolute items in this container must be in a relative container for absolute to work.*/
11
14
}
12
15
13
16
.container {
14
17
width : 1200px ;
15
18
/*This will split the page and center the content in the container.*/
16
19
margin : 0 auto;
20
+ position : relative;
17
21
}
18
22
19
23
.main-header {
20
24
background-color : # f7f7f7 ;
21
25
padding : 20px 40px ;
22
26
margin-bottom : 60px ;
23
- height : 80px ;
27
+ /*height: 80px;*/ /*This is normally not done; typically don't set a fixed height.*/
28
+ height : auto;
24
29
}
25
30
26
31
nav {
@@ -44,6 +49,7 @@ aside {
44
49
width : 500px ;
45
50
}
46
51
52
+ /*SMALLER ELEMENTS*/
47
53
h1 , h2 , h3 {
48
54
color : # 1098ad ;
49
55
}
@@ -103,10 +109,32 @@ li:last-child {
103
109
104
110
.post-image {
105
111
/*This little trick maintains the aspect ratio.*/
112
+ /*Images are inline-block elements by default.*/
106
113
width : 100% ;
107
114
height : auto;
108
115
}
109
116
117
+ nav a : link {
118
+ margin-right : 30px ;
119
+ margin-top : 10px ;
120
+ display : inline-block;
121
+ }
122
+
123
+ /*Chained psuedoclasses.*/
124
+ nav a : link : last-child {
125
+ margin-right : 0 ;
126
+ }
127
+
128
+ button {
129
+ font-size : 22 px;
130
+ padding : 10px ;
131
+ cursor : pointer;
132
+ position : absolute;
133
+ bottom : 50px ;
134
+ right : 50px ;
135
+
136
+ }
137
+
110
138
/*In the nth child, specify the number in ().
111
139
li:nth-child(2) {
112
140
color: red;
@@ -140,8 +168,6 @@ footer p {
140
168
font-size : 16px ;
141
169
}
142
170
143
-
144
-
145
171
/*Class selector*/
146
172
.related-author {
147
173
font-size : 18px ;
You can’t perform that action at this time.
0 commit comments