Build Your Own YouTube: Step-by-Step HTML CSS Tutorial for 2024

Here is an example of HTML and CSS code to create a basic YouTube homepage design:

HTML:




YouTube Homepage











Video 1 Thumbnail

Video 1 Title


Video 1 Description




Video 2 Thumbnail

Video 2 Title


Video 2 Description







CSS (in style.css file):

header {
background-color: #fff;
padding: 20px;
box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.logo {
margin-right: 20px;
}

.search-bar {
margin-right: 20px;
}

.search-bar input {
width: 200px;
height: 30px;
padding: 10px;
border: 1px solid #ccc;
border-radius: 5px;
}

.search-bar button {
background-color: #4CAF50;
color: #fff;
border: none;
padding: 10px 20px;
border-radius: 5px;
cursor: pointer;
}

.nav-links {
margin-right: 20px;
}

.nav-links a {
margin-right: 20px;
color: #333;
text-decoration: none;
}

.video-thumbnails {
display: flex;
flex-wrap: wrap;
justify-content: center;
}

.video-thumbnail {
margin: 20px;
width: 250px;
}

.video-thumbnail img {
width: 100%;
height: 150px;
object-fit: cover;
border-radius: 5px;
}

.video-thumbnail h2 {
margin-top: 10px;
font-weight: bold;
}

.video-thumbnail p {
margin-top: 10px;
color: #666;
}

Note: This is a basic example and you will need to add more styles and functionality to create a fully functional YouTube homepage.