Once more Iβm continuing with my HTML & CSS course today https://www.youtube.com/watch?v=G3e-cpL7ofc
-
<div>
stands for division, but actually itβs just a box -
<div>
by defaylt is a block element - its so useful because any element can go inside. They are basically containers
My Code
Here is some code to show this. I think all makes sense
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>YouTube.com Clone</title>
<style>
.thumbnail {
width: 300px;
display: block;
}
.search-bar {
font-size: 20px;
margin: 12px 0px;
display: block;
}
.video-title {
width: 300px;
}
.video-preview {
width: 300px;
display: inline-block;
vertical-align: top;
margin-right: 15px;
}
</style>
</head>
<body>
<input class="search-bar" type="text" placeholder="Search">
<div class="video-preview">
<img class="thumbnail" src="thumbnails/thumbnail-1.webp" alt="">
<p class="video-title">Talking Tech and AI with Google CEO Sundar Pichai!</p>
<p class="video-author">Marques Brownlee</p>
<p class="video-stats">3.4M views · 6 months ago</p>
</div>
<div class="video-preview">
<img class="thumbnail" src="thumbnails/thumbnail-2.webp" alt="">
<p class="video-title">Try Not To Laugh Challenge #9</p>
<p class="video-author">Markiplier</p>
<p class="video-stats">19M views · 4 years ago</p>
</div>
</body>
</html>
Top comments (0)