Why top and left won't work in CSS (And how to fix it)
Автор: Web Dev & Code
Загружено: 2026-01-03
Просмотров: 55
Learn how to nudge, move, and offset any HTML element without breaking your document flow. In this tutorial, we explore the power of position: relative in CSS.
Many developers try to use top, left, bottom, or right properties only to find their elements won't budge. The secret key is changing the position property. I'll show you how to move a header, how to inspect these changes in the browser console, and how to overlap elements like a generic Paragraph tag over a Heading tag.
Code covered:
position: relative;
top, bottom, left, right offsets
Timeline:
0:00 About
0:18 Adding Tags to Move H1 and P
0:32 Setting Position to Relative
0:45 Moving the item (The Secret Sauce)
1:22 Moving it in the Console
2:09 Overlapping Elements (P Tag over H2)
Subscribe to @webdevcoding for more practical web development tips!
#code #css #html #webdev
Доступные форматы для скачивания:
Скачать видео mp4
-
Информация по загрузке: