► In this video, we take an in-depth look at divs and spans - what they are, why we use them, and how they work. Also, how they differ from one another.
HTML is all about giving meaning to content, and the majority of HTML tags are meaningful.
When we see a footer, header, or table element in our code, we immediately have a good idea of their intended purpose.
But div and span elements apply no meaning to their content, despite being used extensively. So why do we use them?
Well, divs and spans are used to divide or contain content where more semantic elements are not relevant or suitable. Span elements isolate content inline, whereas a div creates a block-level division.
► Timestamps:
0:00 Start
1:26 Looking back at where we used spans in the last video
2:03 Divs do nothing visually by themselves
3:05 Why we use divs & spans
4:36 How to use divs
7:22 Example of adding divs to a webpage
10:28 How to use spans
12:33 Spans are inline elements and divs are block-level elements
14:19 Summary
► Get the code:
Divs & Spans Example Start: https://codepen.io/craigabourne/pen/y...
Divs & Spans Example End: https://codepen.io/craigabourne/pen/J...
GitHub Repo: https://github.com/craigabourne/html-...
► Links used in the video:
MDN Divs: https://developer.mozilla.org/en-US/d...
MDN Spans: https://developer.mozilla.org/en-US/d...
► The HTML for Absolute Beginners Playlist: • HTML for Absolute Beginners
► Social Media:
/ craigabourne
/ craigabourne
► Code & Projects:
https://github.com/craigabourne
https://codepen.io/craigabourne
Смотрите видео How and When to Use Divs and Spans онлайн без регистрации, длительностью часов минут секунд в хорошем качестве. Это видео добавил пользователь Craig A. Bourne 23 Март 2021, не забудьте поделиться им ссылкой с друзьями и знакомыми, на нашем сайте его посмотрели 10,586 раз и оно понравилось 376 людям.