News site template

Here is a basic template for a news site:

Header

Hero Section

Main Content

Sidebar

Footer

Responsive Design

HTML Structure

CSS Styles

JavaScript

Example Code

Here is an example of the HTML structure and CSS styles for the template:

<!-- Header -->
<header>
  <nav>
    <ul>
      <li><a rel="nofollow" target="_blank" href="#">Home</a></li>
      <li><a rel="nofollow" target="_blank" href="#">About</a></li>
      <li><a rel="nofollow" target="_blank" href="#">Contact</a></li>
    </ul>
  </nav>
  <h1>News Site</h1>
</header>

<!-- Hero Section -->
<section class="hero">
  <h2>Breaking News</h2>
  <p>Stay up-to-date with the latest news and updates</p>
  <button>Read More</button>
  <img src="hero-image.jpg" alt="Hero Image">
</section>

<!-- Main Content -->
<main>
  <section class="article-list">
    <h2>Recent Articles</h2>
    <ul>
      <li>
        <h3>Article 1</h3>
        <p>Summary of Article 1</p>
        <img src="article1-image.jpg" alt="Article 1 Image">
      </li>
      <li>
        <h3>Article 2</h3>
        <p>Summary of Article 2</p>
        <img src="article2-image.jpg" alt="Article 2 Image">
      </li>
    </ul>
  </section>
</main>

<!-- Sidebar -->
<aside class="sidebar">
  <h2>Categories</h2>
  <ul>
    <li><a rel="nofollow" target="_blank" href="#">Category 1</a></li>
    <li><a rel="nofollow" target="_blank" href="#">Category 2</a></li>
    <li><a rel="nofollow" target="_blank" href="#">Category 3</a></li>
  </ul>
  <h2>Recent News</h2>
  <ul>
    <li>
      <h3>Article 3</h3>
      <p>Summary of Article 3</p>
    </li>
    <li>
      <h3>Article 4</h3>
      <p>Summary of Article 4</p>
    </li>
  </ul>
</aside>

<!-- Footer -->
<footer>
  <p>&copy; 2023 News Site</p>
  <ul>
    <li><a rel="nofollow" target="_blank" href="#">Contact</a></li>
    <li><a rel="nofollow" target="_blank" href="#">About</a></li>
    <li><a rel="nofollow" target="_blank" href="#">Terms</a></li>
  </ul>
</footer>
/* Global Styles */
body {
  font-family: Arial, sans-serif;
  margin: 0;
  padding: 0;
}

/* Header Styles */
header {
  background-color: #333;
  color: #fff;
  padding: 1em;
  text-align: center;
}

nav ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  justify-content: space-between;
}

nav li {
  margin-right: 20px;
}

nav a {
  color: #fff;
  text-decoration: none;
}

/* Hero Section Styles */
.hero {
  background-image: linear-gradient(to bottom, #333, #555);
  background-size: 100% 300px;
  background-position: 0% 100%;
  height: 300px;
  display: flex;
  justify-content: center;
  align-items: center;
  color: #fff;
}

.hero h2 {
  font-size: 24px;
  margin-bottom: 10px;
}

.hero button {
  background-color: #333;
  color: #fff;
  border: none;
  padding: 10px 20px;
  font-size: 16px;
  cursor: pointer;
}

/* Main Content Styles */
main {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 20px;
}

.article-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
}

.article-list li {
  margin: 20px;
  width: 300px;
}

.article-list h3 {
  font-size: 18px;
  margin-bottom: 10px;
}

.article-list p {
  font-size: 14px;
  margin-bottom: 20px;
}

.article-list img {
  width: 100%;
  height: 150px;
  object-fit: cover;
  border-radius: 10px;
}

/* Sidebar Styles */
.sidebar {
  width: 300px;
  margin: 20px;
  padding: 20px;
  background-color: #f7f7f7;
  border: 1px solid #ddd;
}

.sidebar h2 {
  font-size: 18px;
  margin-bottom: 10px;
}

.sidebar ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

.sidebar li {
  margin-bottom: 10px;
}

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

/* Footer Styles */
footer {
  background-color: #333;
  color: #fff;
  padding: 10px;
  text-align: center;
}

footer ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  justify-content: space-between;
}

footer li {
  margin-right: 20px;
}

footer a {
  color: #fff;
  text-decoration: none;
}

This is just a basic template, and you can customize it to fit your specific needs. You can also add more features and functionality to the template as needed.