Templet code

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>News Website</title>
    <link rel="stylesheet" href="style.css">
</head>
<body>

    <!-- Header Section -->
    <header>
        <div class="logo">MyNews</div>
        <nav>
            <ul>
                <li><a href="#">Home</a></li>
                <li><a href="#">Categories</a></li>
                <li><a href="#">Trending</a></li>
                <li><a href="#">About Us</a></li>
                <li><a href="#">Contact Us</a></li>
            </ul>
        </nav>
        <div class="search-bar">
            <input type="text" placeholder="Search...">
        </div>
    </header>

    <!-- Hero Section -->
    <section class="hero">
        <article class="main-article">
            <img src="https://via.placeholder.com/800x400" alt="Main News">
            <h2>Main Headline</h2>
            <p>This is a brief description of the main news. Stay updated with the latest news happening around you.</p>
            <a href="#">Read More</a>
        </article>
    </section>

    <!-- Latest News Section -->
    <section class="latest-news">
        <h2>Latest News</h2>
        <div class="news-grid">
            <article>
                <img src="https://via.placeholder.com/300x200" alt="News 1">
                <h3>News Title 1</h3>
                <p>Brief description of the news article.</p>
                <a href="#">Read More</a>
            </article>
            <article>
                <img src="https://via.placeholder.com/300x200" alt="News 2">
                <h3>News Title 2</h3>
                <p>Brief description of the news article.</p>
                <a href="#">Read More</a>
            </article>
            <article>
                <img src="https://via.placeholder.com/300x200" alt="News 3">
                <h3>News Title 3</h3>
                <p>Brief description of the news article.</p>
                <a href="#">Read More</a>
            </article>
            <article>
                <img src="https://via.placeholder.com/300x200" alt="News 4">
                <h3>News Title 4</h3>
                <p>Brief description of the news article.</p>
                <a href="#">Read More</a>
            </article>
        </div>
    </section>

    <!-- Advertisement Section -->
    <section class="advertisement">
        <img src="https://via.placeholder.com/1200x100" alt="Ad Banner">
    </section>

    <!-- Footer Section -->
    <footer>
        <div class="footer-content">
            <div class="left">
                <a href="#">About Us</a>
                <a href="#">Privacy Policy</a>
                <a href="#">Terms of Use</a>
            </div>
            <div class="right">
                <a href="#">Facebook</a>
                <a href="#">Twitter</a>
                <a href="#">Instagram</a>
            </div>
        </div>
    </footer>

</body>
</html>


,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,


/* General Styles */
body {
    font-family: Arial, sans-serif;
    margin: 0;
    padding: 0;
    background-color: #f4f4f4;
}

a {
    text-decoration: none;
    color: #333;
}

img {
    max-width: 100%;
}

h1, h2, h3 {
    color: #333;
}

p {
    color: #666;
}

/* Header Styles */
header {
    background-color: #333;
    color: #fff;
    padding: 10px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

header .logo {
    font-size: 24px;
}

nav ul {
    list-style-type: none;
    margin: 0;
    padding: 0;
    display: flex;
}

nav ul li {
    margin-left: 20px;
}

nav ul li input[type="text"] {
    padding: 5px;
    border-radius: 4px;
    border: none;
}

/* Hero Section Styles */
.hero {
    display: flex;
    justify-content: space-between;
    padding: 20px;
}

.main-article {
    width: 70%;
}

.main-article h1 {
    font-size: 32px;
    margin: 10px 0;
}

.main-article p {
    font-size: 16px;
    color: #666;
}

.read-more {
    color: #fff;
    background-color: #f00;
    padding: 10px 20px;
    border-radius: 4px;
}

.trending-news {
    width: 25%;
    background-color: #fff;
    padding: 20px;
}

.trending-news h2 {
    font-size: 20px;
}

.carousel {
    display: flex;
    flex-direction: column;
}

.news-item {
    margin-bottom: 10px;
}

/* Latest News Section */
.latest-news {
    background-color: #fff;
    padding: 20px;
}

.latest-news h2 {
    font-size: 24px;
    margin-bottom: 20px;
}

.news-grid {
    display: flex;
    gap: 20px;
}

.news-card {
    background-color: #fff;
    padding: 15px;
    width: 200px;
    text-align: center;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
}

.news-card h3 {
    font-size: 18px;
    margin: 10px 0;
}

/* Categories Section */
.categories {
    background-color: #f9f9f9;
    padding: 20px;
}

.category-grid {
    display: flex;
    gap: 20px;
}

.category {
    background-color: #fff;
    padding: 15px;
    width: 200px;
    text-align: center;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
}

/* Advertisement Banner */
.ad-banner {
    text-align: center;
    margin: 20px 0;
}

/* Newsletter Section */
.newsletter {
    background-color: #333;
    color: #fff;
    padding: 20px;
    text-align: center;
}

.newsletter input[type="email"] {
    padding: 10px;
    border-radius: 4px;
    border: none;
    margin-right: 10px;
}

.newsletter button {
    padding: 10px 20px;
    background-color: #f00;
    color: #fff;
    border: none;
    border-radius: 4px;
}

/* Footer Section */
footer {
    background-color: #333;
    color: #fff;
    padding: 20px;
    display: flex;
    justify-content: space-between;
}

footer .footer-left {
    font-size: 14px;
}

footer .footer-right {
    display: flex;
    gap: 10px;
}


How to Use:
Copy the HTML code into a file named index.html.
Copy the CSS code into a file named styles.css.
Save both files in the same folder, and then open the index.html file in a web browser to see the template in action.
This is a basic, responsive template that can be expanded as needed



एक टिप्पणी भेजें

0 टिप्पणियाँ

.