create a small website with html and advanced css

Here’s a simple but modern small website built with HTML and advanced CSS (Flexbox, Grid, Transitions, Hover Effects, Responsive Design). The site includes:

  • A navigation bar
  • A hero section
  • A 3-column features grid
  • A footer

✅ 1. Folder Structure

my-website/
├── index.html
└── style.css

✅ 2. index.html

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0"/>
<title>Modern Web Page</title>
<link rel="stylesheet" href="style.css" />
</head>
<body>
<header>
<nav class="navbar">
<h1 class="logo">MySite</h1>
<ul class="nav-links">
<li><a href="#">Home</a></li>
<li><a href="#">Features</a></li>
<li><a href="#">Contact</a></li>
</ul>
</nav>
</header>

<section class="hero">
<div class="hero-content">
<h2>Welcome to My Website</h2>
<p>Modern design using HTML & Advanced CSS</p>
<a href="#" class="btn">Get Started</a>
</div>
</section>

<section class="features">
<div class="feature">
<h3>Responsive Design</h3>
<p>Looks great on all devices using CSS Grid & Flexbox.</p>
</div>
<div class="feature">
<h3>Fast & Lightweight</h3>
<p>Optimized code with fast performance and load speed.</p>
</div>
<div class="feature">
<h3>Customizable</h3>
<p>Easy to update styles and layout with clean structure.</p>
</div>
</section>

<footer>
<p>© 2025 MySite. All rights reserved.</p>
</footer>
</body>
</html>

✅ 3. style.css

/* Reset and base styles */
* {
margin: 0;
padding: 0;
box-sizing: border-box;
}

body {
font-family: "Segoe UI", sans-serif;
line-height: 1.6;
background: #f4f4f4;
color: #333;
}

/* Navbar */
.navbar {
display: flex;
justify-content: space-between;
align-items: center;
background: #333;
color: white;
padding: 1rem 2rem;
}

.logo {
font-size: 1.5rem;
font-weight: bold;
}

.nav-links {
list-style: none;
display: flex;
gap: 1.5rem;
}

.nav-links a {
color: white;
text-decoration: none;
transition: color 0.3s ease;
}

.nav-links a:hover {
color: #ff9800;
}

/* Hero Section */
.hero {
background: linear-gradient(rgba(0,0,0,0.6), rgba(0,0,0,0.6)),
url('https://source.unsplash.com/1600x600/?technology') center/cover no-repeat;
height: 60vh;
display: flex;
justify-content: center;
align-items: center;
color: white;
text-align: center;
}

.hero-content h2 {
font-size: 3rem;
}

.hero-content p {
font-size: 1.2rem;
margin: 1rem 0;
}

.btn {
background: #ff9800;
color: white;
padding: 0.75rem 1.5rem;
border: none;
border-radius: 5px;
text-decoration: none;
font-weight: bold;
transition: background 0.3s ease;
}

.btn:hover {
background: #e67e22;
}

/* Features */
.features {
display: grid;
grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
gap: 2rem;
padding: 4rem 2rem;
background: white;
}

.feature {
background: #f9f9f9;
padding: 2rem;
border-radius: 10px;
text-align: center;
transition: transform 0.3s ease;
}

.feature:hover {
transform: translateY(-10px);
box-shadow: 0 8px 20px rgba(0,0,0,0.1);
}

/* Footer */
footer {
text-align: center;
padding: 2rem;
background: #333;
color: white;
font-size: 0.9rem;
}

/* Responsive Typography */
@media (max-width: 768px) {
.hero-content h2 {
font-size: 2rem;
}

.hero-content p {
font-size: 1rem;
}
}

By admin

Leave a Reply

Your email address will not be published. Required fields are marked *