0% found this document useful (0 votes)
20 views5 pages

YouTube Clone UI with HTML & CSS

The document is an HTML template for a YouTube-style user interface, featuring a sticky header, a search bar, and a video player. It includes a sidebar navigation with links to various sections and a grid layout for displaying video thumbnails and titles. The CSS styles define the overall look and feel, including colors, layout, and responsive design adjustments for smaller screens.

Uploaded by

akilanethsara893
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
20 views5 pages

YouTube Clone UI with HTML & CSS

The document is an HTML template for a YouTube-style user interface, featuring a sticky header, a search bar, and a video player. It includes a sidebar navigation with links to various sections and a grid layout for displaying video thumbnails and titles. The CSS styles define the overall look and feel, including colors, layout, and responsive design adjustments for smaller screens.

Uploaded by

akilanethsara893
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd

<!

DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<title>YouTube-style UI (HTML + CSS)</title>
<style>
:root{
--bg: #0f0f0f;
--card: #181818;
--text: #f1f1f1;
--muted: #b3b3b3;
--accent: #f00;
--border: #2a2a2a;
}
*{box-sizing:border-box}
body{
margin:0;
font-family: system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
background: var(--bg);
color: var(--text);
}

/* Top bar */
header{
position: sticky;
top: 0; z-index: 50;
background: rgba(15,15,15,.9);
backdrop-filter: blur(8px);
border-bottom: 1px solid var(--border);
}
.topbar{
display:flex; align-items:center; gap:12px;
padding:10px 16px;
}
.logo{
display:flex; align-items:center; gap:8px;
font-weight:700; letter-spacing:.2px;
}
.logo .dot{
width:18px; height:18px; border-radius:50%;
background:var(--accent);
display:inline-block;
}
.search{
display:flex; align-items:center; gap:8px;
margin-inline: auto;
width:min(700px, 100%);
padding:0 8px;
}
.search input{
width:100%;
padding:10px 12px;
border:1px solid var(--border);
background:#121212; color:var(--text);
border-radius:999px;
outline:none;
}
.avatar{
width:32px; height:32px; border-radius:50%;
background:#333;
}

/* Layout */
.wrap{
display:grid;
grid-template-columns: 240px 1fr;
gap:16px;
padding:16px;
}

aside{
position: sticky; top:58px;
align-self:start;
border-right:1px solid var(--border);
padding-right:12px;
}
.nav a{
display:flex; align-items:center; gap:10px;
padding:10px 12px; border-radius:10px;
color:var(--text); text-decoration:none;
}
.nav a:hover{ background:#1e1e1e; }
.nav .icon{
width:18px; height:18px; border:2px solid #777; border-radius:4px;
}

main{
display:grid;
gap:16px;
grid-template-columns: 1fr;
}

/* Player */
.player{
background: #000;
border:1px solid var(--border);
border-radius:12px;
overflow:hidden;
/* Keeps 16:9 ratio while responsive */
aspect-ratio: 16 / 9;
}
.player iframe{
width:100%; height:100%; border:0;
display:block;
}
.title{
font-size:1.1rem; font-weight:600; margin-top:6px;
}
.meta{
color:var(--muted); font-size:.9rem; margin-bottom:10px;
}

/* Grid of videos */
.video-grid{
display:grid;
grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
gap:12px;
}
.card{
background: var(--card);
border:1px solid var(--border);
border-radius:12px; overflow:hidden;
text-decoration:none; color:var(--text);
transition: transform .08s ease;
}
.card:hover{ transform: translateY(-2px); }
.thumb{
aspect-ratio:16/9; width:100%; object-fit:cover; display:block;
background:#0a0a0a;
}
.card-body{ padding:10px 12px; }
.card-title{ font-weight:600; line-height:1.3; }
.card-sub{ color:var(--muted); font-size:.88rem; margin-top:4px; }

/* Responsive tweaks */
@media (max-width: 950px){
.wrap{ grid-template-columns: 1fr; padding:12px; }
aside{ display:none; }
.search{ margin-inline: 0; }
}
</style>
</head>
<body>
<header>
<div class="topbar">
<div class="logo"><span class="dot"></span> YouTube Clone</div>
<div class="search">
<input type="search" placeholder="Search" aria-label="Search videos (UI
only)" />
</div>
<div class="avatar" title="You"></div>
</div>
</header>

<div class="wrap">
<aside>
<nav class="nav">
<a href="#"><span class="icon"></span> Home</a>
<a href="#"><span class="icon"></span> Shorts</a>
<a href="#"><span class="icon"></span> Subscriptions</a>
<a href="#"><span class="icon"></span> Library</a>
<a href="#"><span class="icon"></span> History</a>
</nav>
</aside>

<main>
<!-- Main video player -->
<div class="player">
<!-- Replace the video ID (M7lc1UVf-VE) with any YouTube ID you like -->
<iframe
src="[Link]
title="YouTube video player"
allow="accelerometer; autoplay; clipboard-write; encrypted-media;
gyroscope; picture-in-picture; web-share"
allowfullscreen>
</iframe>
</div>
<div class="title">Getting Started with the YouTube Player</div>
<div class="meta">1,234,567 views • Uploaded Demo</div>

<!-- Grid of video cards (thumbnails & titles) -->


<section class="video-grid" aria-label="Video results">
<!-- Each card links straight to YouTube (no JS in this demo) -->
<a class="card" href="[Link]
target="_blank" rel="noopener">
<img class="thumb" src="[Link]
alt="Video thumbnail">
<div class="card-body">
<div class="card-title">Never Gonna Give You Up</div>
<div class="card-sub">Artist • 1.4B views</div>
</div>
</a>

<a class="card" href="[Link]


target="_blank" rel="noopener">
<img class="thumb" src="[Link]
alt="Me at the zoo thumbnail">
<div class="card-body">
<div class="card-title">Me at the zoo</div>
<div class="card-sub">jawed • 300M+ views</div>
</div>
</a>

<a class="card" href="[Link]


target="_blank" rel="noopener">
<img class="thumb" src="[Link]
alt="Big Buck Bunny thumbnail">
<div class="card-body">
<div class="card-title">Big Buck Bunny (Full HD)</div>
<div class="card-sub">Blender • Open Movie</div>
</div>
</a>

<a class="card" href="[Link]


target="_blank" rel="noopener">
<img class="thumb" src="[Link]
alt="YouTube API Demo thumbnail">
<div class="card-body">
<div class="card-title">YouTube API Demo</div>
<div class="card-sub">YouTube Developers</div>
</div>
</a>

<!-- Duplicate a few more cards to fill the grid -->


<a class="card" href="[Link]
target="_blank" rel="noopener">
<img class="thumb" src="[Link]
alt="Classic video thumbnail">
<div class="card-body">
<div class="card-title">Classic 480p Upload</div>
<div class="card-sub">Throwback • 42M views</div>
</div>
</a>

<a class="card" href="[Link]


target="_blank" rel="noopener">
<img class="thumb" src="[Link]
alt="Sample video thumbnail">
<div class="card-body">
<div class="card-title">Sample Stream</div>
<div class="card-sub">Demo Channel</div>
</div>
</a>
</section>
</main>
</div>
</body>
</html>

You might also like