
A well-organized CSS structure template designed for maintainable, scalable, and efficient styling in modern web projects. Perfect for developers aiming for clean code and smooth collaboration.
/*-------------------------------------
1. Base Styles
--------------------------------------*/
:root {
--primary-color: #0d6efd;
--secondary-color: #6c757d;
--font-main: 'Helvetica Neue', sans-serif;
--text-color: #212529;
--bg-color: #ffffff;
}
*,
*::before,
*::after {
box-sizing: border-box;
margin: 0;
padding: 0;
}
body {
font-family: var(--font-main);
color: var(--text-color);
background-color: var(--bg-color);
line-height: 1.6;
}
/*-------------------------------------
2. Layout
--------------------------------------*/
.container {
width: 90%;
max-width: 1200px;
margin: 0 auto;
padding: 1rem;
}
/*-------------------------------------
3. Reusable Components
--------------------------------------*/
.btn {
display: inline-block;
padding: 0.5rem 1rem;
background-color: var(--primary-color);
color: #fff;
border: none;
border-radius: 4px;
text-decoration: none;
transition: background 0.3s;
}
.btn:hover {
background-color: #0056b3;
}
/*-------------------------------------
4. Banner Section
--------------------------------------*/
.banner {
position: relative;
background: url('your-banner-image.jpg') center/cover no-repeat;
color: #fff;
text-align: center;
padding: 100px 20px;
}
.banner::after {
content: '';
position: absolute;
top: 0; left: 0;
width: 100%;
height: 100%;
background: rgba(0, 0, 0, 0.5); /* dark overlay */
z-index: 0;
}
.banner-content {
position: relative;
z-index: 1;
}
.banner h1 {
font-size: 3rem;
margin-bottom: 1rem;
}
.banner p {
font-size: 1.25rem;
margin-bottom: 2rem;
}
.banner .btn {
font-size: 1rem;
}
/*-------------------------------------
5. Sections
--------------------------------------*/
/* Add custom sections like .about, .services, .contact etc. */
/*-------------------------------------
6. Media Queries
--------------------------------------*/
@media (max-width: 768px) {
.banner h1 {
font-size: 2rem;
}
.banner p {
font-size: 1rem;
}
}