Hello Developers! Are you interested in learning how to create a website like YouTube using HTML and CSS? Look no further! In this tutorial, we will guide you step-by-step through the process of building a responsive website that includes quick navigation links, a search box, and all the essential features of a YouTube-like website.
Our video tutorial and accompanying article will provide you with all the necessary information and source code to build a website that looks just like YouTube. We recommend following the tutorial step by step to gain a clear understanding of how the website is constructed. Additionally, the provided source code can be used to troubleshoot any errors that may arise during the coding process.
The website you’ll be building will include a side navigation and a horizontal navbar, as well as boxes that display YouTube video details. The responsive design of the website ensures that it can be viewed seamlessly across all devices and screen sizes.
We hope that you find this tutorial informative and engaging. Get started today by following our step-by-step guide and building your own YouTube-inspired website!
Here is a step-by-step guide on how to make a website like YouTube using HTML and CSS:
- Start by creating a new folder for your project and add two new files to it: “index.html” and “style.css”.
- Open “index.html” in your text editor and add the basic HTML structure, including the , , and tags.
- Inside the tag, create a tag to link to your “style.css” file.
- Add the necessary HTML elements to create the overall layout of your website, including a navigation menu, a search box, and a content area.
- Use CSS to style the different components of your website, including the layout, color scheme, and typography.
- Add the Quick Navigation Links to the side of the website.
- Create the boxes for showing the details of the YouTube videos.
- Ensure that your website is fully responsive across all screen sizes using CSS media queries.
- Test your website in different browsers and on different devices to ensure that it is fully responsive.
Remember, it’s important to follow along with the video tutorial step-by-step in order to fully understand how to create a website like YouTube using HTML and CSS. Don’t hesitate to use the provided source codes to help guide you through any issues or errors in your code. With a bit of patience and determination, you’ll soon have your very own responsive website up and running!
Video tutorial
Source codes
index.html
YouTube
YouTube
Home
Explore
Shorts
Subscription
Library
History
Your videos
Watch later
All videos
Show more
More from youtube
Gaming
Live
Sports
Settings
Report history
Help
Send feedback
All
CSS
User interface design
User interface design
User interface design
User interface design
User interface design
User interface design
User interface design
Complete responsive website design
iMe Creative
281K views .
1 year ago
Watch later
Add to queue
React with firebase 9 (blog app with file upload)
iMe Creative
281K views .
1 year ago
Watch later
Add to queue
Complete responsive website design
iMe Creative
281K views .
1 year ago
Watch later
Add to queue
Complete responsive website design
iMe Creative
281K views .
1 year ago
Watch later
Add to queue
Complete responsive website design
iMe Creative
281K views .
1 year ago
Watch later
Add to queue
React Table Sorting
iMe Creative
281K views .
1 year ago
Watch later
Add to queue
React Table Sorting
iMe Creative
281K views .
1 year ago
Watch later
Add to queue
Complete responsive website design
iMe Creative
281K views .
1 year ago
Watch later
Add to queue
Complete responsive website design
iMe Creative
281K views .
1 year ago
Watch later
Add to queue
Complete responsive website design
iMe Creative
281K views .
1 year ago
Watch later
Add to queue
styles.css
@import url('https://fonts.googleapis.com/css2?family=Roboto:wght@400;500;700;900&display=swap');
* {
box-sizing: border-box;
padding: 0;
margin: 0;
font-family: 'Roboto', sans-serif;
scroll-behavior: smooth;
}
::-webkit-scrollbar {
width: 8px;
}
::-webkit-scrollbar-track {
background: none;
}
::-webkit-scrollbar-thumb {
background: transparent;
border-radius: 5px;
}
.sidebar:hover::-webkit-scrollbar-thumb {
background: #717171;
}
::-webkit-scrollbar-thumb:hover {
background: #888;
}
h1 {
font-size: 1.5rem;
color: #fff;
}
h4 {
text-transform: uppercase;
margin-left: 20px;
font-size: .9rem;
color: #aaa;
}
i {
font-size: 1.5rem;
color: #fff;
}
p,
a {
font-size: 0.9rem;
}
hr {
border: 1px solid rgba(255, 255, 255, 0.1);
margin: 12px 0;
}
/* header starts here */
.header {
position: fixed;
top: 0;
left: 0;
width: 100%;
background-color: #202020;
display: flex;
align-items: center;
justify-content: space-between;
padding: 5px 25px;
padding-right: 40px;
}
.logo-img {
position: relative;
height: 50px;
width: 50px;
}
#logo-txt {
letter-spacing: -1.5px;
}
.logo {
display: flex;
align-items: center;
}
.logo-container {
display: flex;
align-items: center;
}
.search-container {
display: flex;
align-items: center;
flex: 0 1 685px;
margin-left: 40px;
}
.search-container form {
position: relative;
width: 100%;
}
.search-container input {
height: 40px;
display: flex;
align-items: center;
width: 100%;
background-color: #121212;
border: 1px solid rgba(255, 255, 255, 0.1);
padding: 12px;
color: #fff;
font-size: 1rem;
}
.search-container .search {
min-width: 60px;
height: 40px;
display: flex;
align-items: center;
justify-content: center;
z-index: 999;
background-color: #313131;
outline: none;
border: none;
}
.search-container .mic {
height: 40px;
min-width: 40px;
border-radius: 50%;
outline: none;
border: none;
margin-left: 10px;
display: flex;
align-items: center;
justify-content: center;
background-color: #181818;
}
.profile-container {
display: flex;
align-items: center;
}
.profile-container i {
margin-left: 25px;
}
.profile-box {
position: relative;
height: 30px;
width: 30px;
border-radius: 50%;
overflow: hidden;
margin-left: 25px;
}
img {
position: absolute;
top: 0;
left: 0;
height: 100%;
width: 100%;
object-fit: cover;
}
/* body container */
.body-container {
display: flex;
position: fixed;
height: calc( 100vh - 60px);
top: 60px;
}
/* sidebar stars here */
.sidebar {
padding-top: 10px;
width: 240px;
background-color: #212121;
overflow-y: scroll;
color: #fff;
}
.sidebar-items {
display: flex;
flex-direction: column;
}
.sidebar-item {
display: flex;
align-items: center;
padding: 0 24px;
cursor: pointer;
height: 40px;
}
.sidebar-item:hover {
background-color: #4C4C4C;
}
.sidebar-item i {
margin-right: 24px;
}
/* main content starts here */
.content {
width: calc(100vw - 240px);
}
.chips-wrapper {
overflow-x: scroll;
background-color: #181818;
display: flex;
padding-left: 14px;
border-top: 1px solid rgba(255, 255, 255, 0.1);
border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}
.chips-wrapper::-webkit-scrollbar {
height: 0;
}
.chip {
margin: 12px 6px;
background-color: #373737;
padding: 6px 12px;
border: 1px solid rgba(255, 255, 255, 0.1);
border-radius: 16px;
white-space: nowrap;
cursor: pointer;
color: #fff;
transition: .5s;
}
.chip:hover {
background-color: #4D4D4D;
}
/* video container startrs here */
.video-container {
display: grid;
grid-template-columns: repeat(4, 1fr);
grid-gap: 18px;
padding: 20px 25px;
background-color: #181818;
overflow-y: scroll;
height: calc(100vh - 116px);
}
.video-content-cover {
position: relative;
transition: .5s;
transition-delay: .05s;
}
.video-content {
margin-bottom: 25px;
position: relative;
transition: .5s;
width: 100%;
}
.video-content:hover {
transform: scale(1.5);
z-index: 222;
position: absolute;
box-shadow: 0 4px 8px 0 rgba(0, 0, 0, 0.3);
background-color: #202020;
}
.video-content-cover:hover {
transform: translateY(60px);
z-index: 999;
}
.video-content-cover:nth-child(4n+1):hover {
transform: translate(50px, 60px);
z-index: 999;
}
.video-content-cover:nth-child(4n+4):hover {
transform: translate(-30px, 60px);
z-index: 999;
}
.video-content:hover .video-details {
background-color: #202020;
padding: 10px;
}
.video-box {
position: relative;
width: auto;
height: 145px;
display: block;
}
.video-details {
display: flex;
color: #fff;
padding-top: 12px;
}
.video-content:hover .channel-logo {
min-width: 25px;
height: 25px;
}
.channel-logo {
position: relative;
min-width: 35px;
height: 35px;
border-radius: 50%;
overflow: hidden;
}
.detail {
margin-left: 12px;
}
.video-content:hover .title {
font-size: .7rem;
}
.title {
font-size: .9rem;
}
.video-content:hover .channel-name {
font-size: .6rem;
}
.channel-name {
font-size: .8rem;
margin-top: 10px;
color: #aaa;
}
.video-content:hover .views-upload {
font-size: .6rem;
}
.views-upload {
display: flex;
font-size: .8rem;
color: #aaa;
}
.btn {
padding: 5px 0;
color: #aaa;
text-transform: uppercase;
width: 100%;
background-color: #373737;
text-align: center;
margin: 5px 0;
font-size: .6rem;
cursor: pointer;
display: flex;
align-items: center;
justify-content: center;
}
.btn i {
font-size: .7rem;
margin-right: 5px;
color: #aaa;
}
.hidden-content {
display: none;
padding: 5px 10px;
background-color: #202020;
}
.video-content:hover .hidden-content {
display: block;
}
/* responsive starts here */
@media (max-width:1200px) {
.sidebar {
width: 70px;
overflow-x: hidden;
}
.content {
width: calc(100vw - 70px);
}
.more {
display: none;
}
}
@media (max-width:1050px) {
.video-container {
grid-template-columns: repeat(3, 1fr);
}
}
@media (max-width:820px) {
.video-container {
grid-template-columns: repeat(2, 1fr);
}
}
@media (max-width:600px) {
.video-container {
grid-template-columns: 1fr;
}
.search-container,
.ri-grid-fill {
display: none;
}
.video-container {
grid-gap: 10px;
padding: 10px 10px;
}
.header {
padding-right: 10px;
}
.video-content:hover {
transform: none;
position: relative;
box-shadow: none;
background-color: #181818;
}
.video-content-cover:hover {
transform: none;
}
.video-content-cover:nth-child(4n+1):hover {
transform: none;
}
.video-content-cover:nth-child(4n+4):hover {
transform: none;
}
.video-content:hover .video-details {
background-color: #181818;
padding: 0px;
padding-top: 12px;
}
.video-content:hover .channel-logo {
min-width: 35px;
height: 35px;
}
.video-content:hover .title {
font-size: .9rem;
}
.video-content:hover .channel-name {
font-size: .8rem;
}
.video-content:hover .views-upload {
font-size: .8rem;
}
.video-content:hover .hidden-content {
display: none;
}
} If you face any trouble, don’t worry about that. All the image files and necessary project files are available to download from the button below.