Quantcast
Channel: Active questions tagged html - Stack Overflow
Viewing all articles
Browse latest Browse all 67527

How to build a small news application to create and display snippets from news articles at the top of a HTML page [closed]

$
0
0
  1. *The application should iterate through the news articles. It should get the article headline and the first sentence of each article. It should then create a snippet, and display the snippet towards the top of the HTML page.*

The output of the application will be as follows on the second image bellow:

This is the the image of the page with its original syntax. not edited with JS

This is the image of the page already done with JS DOM METHODS, it shows how the page have to be finalised

body {
	font-family: Verdana;
	font-size: 1rem;	
}

#wrappermain {
	margin: 0 auto;
	max-width: 60%;
}

p {
	line-height: 1.5;
}

article {
	padding-bottom: 1rem;
}

h1 {
	font-size: 2rem;
	color: #85929E;
}

h2 {
	font-size: 1.5rem;
	color: #5D6D7E;
}

h3 {
	font-size: 1.25rem;
	color: #34495E;
}

h4 {
	font-size: 1rem;
	color: #212F3C;
}

ul {
	list-style-type: none;
	font-size: 0.95rem;
	line-height: 1.5;
	margin-left: -4%;
	font-style: italic;
}

li {
	margin-bottom: 1rem;
}
<!doctype html><html lang="en"><head><meta charset="utf-8"><title>JavaScript</title><link rel="stylesheet" type="text/css" href="styles/styles.css"></head><body><div id="wrappermain"><h1>Bizzare News Mash Up</h1><section id="headlines"><h2>Bizzare News Summary</h2></section><section id="news"><h3>News Stories in Full</h3><article class="newsarticle"><h4>What a load of Bull!</h4><p>Chinese Kung Fu Masters are seeking the ultimate opponents</p><p>Several times a week, kung fu teacher Ren Ruzhi enters a ring to spar with a bovine opponent around
					five
					times his weight and capable of killing him.</p><p>Ren’s mixing of martial arts and bullfighting worries his mother, but the 24-year-old has never been
					hurt.
					Besides, he says, grappling with a snorting bull is exciting.</p><p>It symbolizes the bravery of a man,” Ren told Reuters in Jiaxing in China’s eastern province of
					Zhejiang.</P><p>Unlike Spain’s more famous sport, the Chinese variant of
					bullfighting involves no swords or gore but instead fuses the moves of wrestling with the skill and
					speed of
					kung fu to bring down beasts weighing up to 400 kg (882 lb).</p><p>“Spanish bullfighting is more like a performance or a show,” said Hua Yang, a 41-year-old enthusiast
					who
					watched a bullfight during a visit to Spain.</p></article><article class="newsarticle"><h4>Has Anybody got a Tissue?</h4><p>A Hawaiian monk seal got an eel caught in its nose ― and it wasn’t the first time for these
					endangered creatures.</p><p>The Hawaiian Monk Seal Research Program posted a startling pic of the poor pup on Monday, and the
					National Oceanic
					and Atmospheric Administration Fisheries provided more details in a post on Wednesday.</p><p>The administration said it has seen the same “eels in noses” phenomenon nearly a handful of times in
					the last few years.</p><p>“We don’t know if this is just some strange statistical anomaly or something we will see more of in
					the future,”
					the NOAA wrote.</p><p>The agency has two theories on why it happened in this case: A cornered eel was trying to defend
					itself or escape, and
					wound up in the seal’s nose. Or the seal could have swallowed the eel first and regurgitated its
					prey out the wrong way.</p></article><article class="newsarticle"><h4>Dog Pulls Off Spectacular Save During Argentina Soccer Match</h4><p>A pooch invaded the pitch during a Federal A league match between Juventud Unida and Defensores de
					Belgrano over the weekend.</p><p>Juventud Unida were already comfortably ahead against Defensores de Belgrano in their league clash
					when the dog
					made his unexpected cameo.</p><p>Belgrano looked on course to go four goals down when their goalkeeper kicked the ball against a
					Juventud player,
					who then took a shot towards the empty net.</p><p>But in the nick of time, a dog came out of nowhere to race across the line and nod the ball away from
					goal.</p><p>Unfortunately, the dog was unable to inspire a comeback as Juventud went on to win the match 3-0.</p></article><article class="newsarticle"><h4>Nobody Beats The Laws of Nature</h4><p>A 69-year-old Dutch man has failed in his attempt to legally declare himself 20 years younger.</p><p>Last month, motivational speaker Emile Ratelband filed a lawsuit against the Dutch government
					requesting that his
					date of birth be switched from March 11, 1949, to March 11, 1969.</p><p>n Monday, a court in the Netherlands city of Arnhem rejected his age-changing application, saying
					that while Ratelband“is at liberty to feel 20 years younger than his real age and to act accordingly,” actually changing
					the birth certificate
					is not possible.</p></article></section></div><!-- Stories from Huffington Post. Used for Teaching purposes --></body><script src="scripts/fma_t1.js"></script></html>

I am really stuck on how start manipulating the JS DOM METHODS.


Viewing all articles
Browse latest Browse all 67527

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>