Breaking news blogger template
Here is a basic blogger template for a breaking news website:
Template Name: Breaking News
Description: A modern and sleek template for a breaking news website, featuring a prominent headline section, a scrolling news ticker, and a clean and simple layout.
HTML Structure:
<!DOCTYPE html>
<html>
<head>
<title>Breaking News</title>
<link href='https://fonts.googleapis.com/css?family=Open+Sans:300,400,600,700' rel='stylesheet' type='text/css'>
<link rel="stylesheet" href="styles.css">
</head>
<body>
<!-- Header Section -->
<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>Breaking News</h1>
</header>
<!-- Main Section -->
<main>
<!-- Headline Section -->
<section class="headline">
<h2 id="headline"></h2>
<p id="headline-date"></p>
</section>
<!-- News Ticker -->
<section class="ticker">
<ul id="ticker">
<!-- News items will be added here -->
</ul>
</section>
<!-- News Articles -->
<section class="articles">
<!-- Article 1 -->
<article>
<h3>Article 1</h3>
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed sit amet nulla auctor, vestibulum magna sed, convallis ex.</p>
</article>
<!-- Article 2 -->
<article>
<h3>Article 2</h3>
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed sit amet nulla auctor, vestibulum magna sed, convallis ex.</p>
</article>
<!-- Article 3 -->
<article>
<h3>Article 3</h3>
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed sit amet nulla auctor, vestibulum magna sed, convallis ex.</p>
</article>
</section>
</main>
<!-- Footer Section -->
<footer>
<p>© 2023 Breaking News</p>
</footer>
<script src="script.js"></script>
</body>
</html>
CSS Styles:
/* Global Styles */
* {
margin: 0;
padding: 0;
box-sizing: border-box;
}
body {
font-family: 'Open Sans', sans-serif;
background-color: #f9f9f9;
}
/* Header Styles */
header {
background-color: #333;
color: #fff;
padding: 1em;
text-align: center;
}
header nav ul {
list-style: none;
margin: 0;
padding: 0;
}
header nav li {
display: inline-block;
margin-right: 20px;
}
header nav a {
color: #fff;
text-decoration: none;
}
/* Headline Styles */
.headline {
background-color: #333;
color: #fff;
padding: 1em;
text-align: center;
}
.headline h2 {
font-size: 24px;
margin-bottom: 10px;
}
.headline p {
font-size: 16px;
margin-bottom: 20px;
}
/* Ticker Styles */
.ticker {
background-color: #333;
color: #fff;
padding: 1em;
text-align: center;
}
.ticker ul {
list-style: none;
margin: 0;
padding: 0;
}
.ticker li {
display: inline-block;
margin-right: 20px;
}
.ticker a {
color: #fff;
text-decoration: none;
}
/* Articles Styles */
.articles {
padding: 2em;
}
.articles article {
margin-bottom: 20px;
}
.articles h3 {
font-size: 18px;
margin-bottom: 10px;
}
.articles p {
font-size: 16px;
margin-bottom: 20px;
}
/* Footer Styles */
footer {
background-color: #333;
color: #fff;
padding: 1em;
text-align: center;
clear: both;
}
JavaScript Code:
// Get the headline and date elements
const headlineElement = document.getElementById('headline');
const dateElement = document.getElementById('headline-date');
// Set the headline and date
headlineElement.textContent = 'Breaking News: Latest Updates';
dateElement.textContent = 'March 12, 2023';
// Get the news ticker element
const tickerElement = document.getElementById('ticker');
// Add news items to the ticker
tickerElement.innerHTML = '';
const newsItems = [
{'title': 'News Item 1', 'date': 'March 10, 2023'},
{'title': 'News Item 2', 'date': 'March 11, 2023'},
{'title': 'News Item 3', 'date': 'March 12, 2023'}
];
newsItems.forEach((item) => {
const listItem = document.createElement('li');
listItem.textContent = `${item.title} - ${item.date}`;
tickerElement.appendChild(listItem);
});
This template provides a basic structure for a breaking news website, with a prominent headline section, a scrolling news ticker, and a clean and simple layout. You can customize the template by adding your own content, images, and styles.