Breaking news html code for newspro template
Here is an example of HTML code for a breaking news section using the NewsPro template:
<!-- Breaking News Section -->
<div class="breaking-news">
<h2>Breaking News</h2>
<ul>
<li>
<a rel="nofollow" target="_blank" href="#">
<img src="image.jpg" alt="Breaking News Image">
<span>Breaking News Headline</span>
</a>
</li>
<li>
<a rel="nofollow" target="_blank" href="#">
<img src="image.jpg" alt="Breaking News Image">
<span>Breaking News Headline</span>
</a>
</li>
<li>
<a rel="nofollow" target="_blank" href="#">
<img src="image.jpg" alt="Breaking News Image">
<span>Breaking News Headline</span>
</a>
</li>
</ul>
</div>
You can customize this code to fit your specific needs. Here's a breakdown of the code:
<div class="breaking-news">
: This is the container element for the breaking news section.<h2>Breaking News</h2>
: This is the heading for the breaking news section.<ul>
: This is the unordered list element that will contain the breaking news items.<li>
: These are the list items that will contain the individual breaking news items.<a rel="nofollow" target="_blank" href="#">
: These are the anchor elements that will link to the full article for each breaking news item.<img src="image.jpg" alt="Breaking News Image">
: These are the image elements that will display the breaking news images.<span>Breaking News Headline</span>
: These are the span elements that will display the breaking news headlines.
You'll need to replace the image.jpg
and Breaking News Headline
placeholders with your own images and headlines.
You can also add additional CSS styles to customize the appearance of the breaking news section. For example, you could add the following CSS code to style the breaking news images and headlines:
.breaking-news ul {
list-style: none;
padding: 0;
margin: 0;
}
.breaking-news li {
margin-bottom: 10px;
}
.breaking-news img {
width: 100%;
height: 100px;
object-fit: cover;
border-radius: 5px;
}
.breaking-news span {
font-size: 18px;
font-weight: bold;
color: #333;
}
This code removes the default list styling, adds a margin to each list item, and styles the images and headlines. You can customize this code to fit your specific design needs.