File tree Expand file tree Collapse file tree 1 file changed +39
-0
lines changed
starter/03-CSS-Fundamentals Expand file tree Collapse file tree 1 file changed +39
-0
lines changed Original file line number Diff line number Diff line change @@ -189,3 +189,42 @@ button {
189
189
bottom : 50px ;
190
190
right : 50px ;
191
191
}
192
+ /* :: -> pseudo element
193
+ : -> pseudo class
194
+ + -> adjacent element
195
+ */
196
+ h1 ::first-letter {
197
+ font-style : normal;
198
+ margin-right : 5px ;
199
+ }
200
+ /* h2::first-letter {
201
+ font-size: 50px;
202
+ } */
203
+
204
+ /* adjacent element can be selected using plus
205
+ eg. select p which comes after h3 */
206
+ /* h3 + p::first-line {
207
+ color: red;
208
+ } */
209
+
210
+ /* before and after pseudo elements */
211
+ /* psedo elements are by default inline */
212
+ h2 {
213
+ /* background-color: orange; */
214
+ position : relative;
215
+ /* as we have set relative here, as per this parent only h2::after will be absolute */
216
+ }
217
+ h2 ::after {
218
+ /* content is mandatory */
219
+ content : "TOP" ;
220
+ background-color : # ffe70c ;
221
+ color : # 444 ;
222
+ font-size : 16px ;
223
+ font-weight : bold;
224
+ display : inline-block;
225
+ padding : 5px 10px ;
226
+
227
+ position : absolute;
228
+ top : -10px ;
229
+ right : -25px ;
230
+ }
You can’t perform that action at this time.
0 commit comments