news page

In this example below you will see how to do a news page with some HTML / CSS and Javascript

Thumbnail
This awesome code was written by r4c3r44, you can see more from this user in the personal repository.
You can find the original code on Codepen.io
Copyright r4c3r44 ©
  • HTML
  • CSS
  • JavaScript
                   <div class= "npwrap">
   <div class= "npside" id= "npside"><div class= "npcntitle"><h7>Center News</h7></div>
     <a href="#" title="link"><div class="npcn" id="npcn1"><div class= "npcnpic" ><img source="#"></div>
             <div class= "npcntext"><h3>this is the title</h3><p>Lorem Ipsum is simply dummy text of the printing and typesetting industry. </p></a></div>       
    </div>
        <a href="#"><div class="npcn" id="npcn2"><div class= "npcnpic" ><img source="#"></div>
      <div class= "npcntext"><a href="#"><h3>this is the title</h3><p>Lorem Ipsum is simply dummy text of the printing and typesetting industry. </p></a></div>       
    </div>
        <div class="npcn" id="npcn3"><div class= "npcnpic" ><img source="#"></div>
      <div class= "npcntext"><a href="#"><h3>this is the title</h3><p>Lorem Ipsum is simply dummy text of the printing and typesetting industry. </p></a></div>       
    </div>
        <div class="npcn" id="npcn4"><div class= "npcnpic" ><img source="#"></div>
      <div class= "npcntext"><a href="#"><h3>this is the title</h3><p>Lorem Ipsum is simply dummy text of the printing and typesetting industry. </p></a></div>       
    </div>
  </div>
  <div class= "npblock" id= "npblock1">
 <div class= "npstory" id= "npstory1">
      <div class= "nppic" id="nppic1"><img src="includes/news/news_1/storyimgbig.png" alt="blue DNA" ></div>
   <div class= "nptext"><h8><?php include('includes/news/news_1/headline.php'); ?></h8><p><?php include('includes/news/news_1/tease.php'); ?></p></div>
    </div> 
        <div class= "npstory" id= "npstory2">
      <div class= "nppic" id="nppic2"><img src="includes/news/news_2/storyimgbig.png" alt="writing on glass" ></div>
   <div class= "nptext"><h3><?php include('includes/news/news_2/headline.php'); ?></h3><p><?php include('includes/news/news_2/tease.php'); ?></p></div>
    </div>
        <div class= "npstory" id= "npstory3">
      <div class= "nppic" id="nppic3"><img src="includes/news/news_3/storyimgbig.png" alt="writing on glass" ></div>
   <div class= "nptext"><h3><?php include('includes/news/news_3/headline.php'); ?></h3><p><?php include('includes/news/news_3/tease.php'); ?></p></div>
    </div>
  </div>
    <div class= "npblock" id= "npblock2">
    <div class= "npstory" id= "npstory6">
      <div class= "nppic" id="nppic6"><img src="includes/news/news_6/storyimgbig.png" alt="writing on glass" ></div>
   <div class= "nptext"><h8><?php include('includes/news/news_6/headline.php'); ?></h8><p><?php include('includes/news/news_6/tease.php'); ?></p></div>
    </div> 
        <div class= "npstory" id= "npstory5">
      <div class= "nppic" id="nppic5"><img src="includes/news/news_5/storyimgbig.png" alt="writing on glass" ></div>
   <div class= "nptext"><h3><?php include('includes/news/news_5/headline.php'); ?></h3><p><?php include('includes/news/news_5/tease.php'); ?></p></div>
    </div>
        <div class= "npstory" id= "npstory4">
      <div class= "nppic" id="nppic4"><img src="includes/news/news_4/storyimgbig.png" alt="writing on glass" ></div>
   <div class= "nptext"><h3><?php include('includes/news/news_4/headline.php'); ?></h3><p><?php include('includes/news/news_4/tease.php'); ?></p></div>
    </div>
  </div> 
</div>

/*Downloaded from https://www.codeseek.co/r4c3r44/news-page-nkpyb */
    /*-------sirt news page start-------*/
.npwrap h1{
	text-transform: capitalize;
  	margin-top: .8em;
	font-family: 'Nobile', sans-serif;
	font-size: 1em;
	font-weight: 200;
 	color: #666666;	
}
.npwrap h2{
	text-transform: capitalize;
	text-align: center;
	padding: 0 8em;
	font-family: 'Nobile', sans-serif;
	font-size: 1em;
	font-weight: 700;
	line-height: 1em;
	margin-bottom: .5em;
  	color: #666;
}
.npwrap h3{
	text-transform: capitalize;
	font-family: 'Nobile', sans-serif;
	font-size: .875em;
	font-weight: 700;
	line-height: 1em;
	color: #F58025;
}
.npwrap h8{
	text-transform: capitalize;
	padding: 0 .5em;
	font-family: 'Nobile', sans-serif;
	font-size: 1.5em;
	font-weight: 700;
	line-height: 3em;
	color: #F58025;
}
.npwrap h4{
	text-transform: capitalize;
	font-family: 'Nobile', sans-serif;
	font-size: 1em;
	font-weight: 700;
	line-height: 1em;
	margin-bottom: .5em;
  	color: #00447c;
}
.npwrap h5{
	text-transform: capitalize;
	font-family: 'Nobile', sans-serif;
	font-size: 1em;
	font-weight: 700;
	line-height: 1em;
	margin-bottom: .5em;
  	color: #F58025;
}
.npwrap h6{
	text-transform: capitalize;
  	margin-bottom: .5em;
	font-family: 'Nobile', sans-serif;
	font-size: 1em;
	font-weight: 200;
 	color: #0064b1;	
}
.npwrap h7{
	text-transform: capitalize;
	margin: .5em 0 2em 0;
	font-family: 'Nobile', sans-serif;
	font-size: 2em;
	font-weight: 500;
 	color: #ffffff;	
}
.npwrap p{
	font-family: 'Nobile', sans-serif;
	font-size: .875em;
	font-weight: 400;
	line-height: 1.25em;
}
.npwrap{
  width: 89.75%;
  min-height: 30em;
  margin: 0 auto;
  padding: 1em;
}
.npblock{
  float: left;
  position: relative;
  display: block;
  margin: .5em;
}
.npside{
 position: relative;
  display: block; 
  
}
#npside{
  float: right;
  width: 14.76em;
  height: 100%;
  margin: .5em;
  z-index:1;
}
.npcntitle{
	width: 100%;
	text-align: center;
	padding: 1em 0 .5em 0;
	background-color: #f58025;
	margin-bottom: .5em;
	  -webkit-box-shadow: 0px 5px 10px 0px rgba(50, 50, 50, 0.5);
-moz-box-shadow:    0px 5px 10px 0px rgba(50, 50, 50, 0.5);
box-shadow:         0px 5px 10px 0px rgba(50, 50, 50, 0.5);
}
.npcn{
	height: 17em;
  margin-bottom: .5em;
 position: relative;
  display: block;  
   text-align: center;
  -webkit-box-shadow: 0px 5px 10px 0px rgba(50, 50, 50, 0.5);
-moz-box-shadow:    0px 5px 10px 0px rgba(50, 50, 50, 0.5);
box-shadow:         0px 5px 10px 0px rgba(50, 50, 50, 0.5);
} 
.npcn a  {
	width: 100%;
	height: 100%;
  text-decoration: none;
}
.npcn a:active  {
  text-decoration: none;
}
.npcn a:visited  {
  text-decoration: none;
}
.npcn a:hover,
.npcn:hover {
  color: white;
  background-color: #0064b1;
}

.npcnpic{
  width: 100%;
  height: 8.25em;
  background-color: grey;
}
.npcnpic:hover img {
  transform: scale(1.05, 1.05);
  -webkit-transform: scale(1.05, 1.05);
  -moz-transform:    scale(1.05, 1.05);
    -ms-transform:     scale(1.05, 1.05);
    -o-transform:      scale(1.05, 1.05);
}
.npcnpic img {
	transition: all 0.3s ease-out 0s;
	-webkit-transition: all 0.3s ease-out 0s;
    -moz-transition:    all 0.3s ease-out 0s;
    -o-transition:      all 0.3s ease-out 0s;
}
.npcntext{
	height: 100%;
 padding: 0 .5em .5em .5em;
 
}
.npcntext p{
	font-size: .5em;
}
.npstory{
	overflow:hidden;
  position: relative;
  display: block;
  margin: 0 auto;  
  text-align: center;
  -webkit-box-shadow: 0px 5px 10px 0px rgba(50, 50, 50, 0.5);
-moz-box-shadow:    0px 5px 10px 0px rgba(50, 50, 50, 0.5);
box-shadow:         0px 5px 10px 0px rgba(50, 50, 50, 0.5);
}
.npstory a  {
	width: 100%;
	height: 100%;
  text-decoration: none;
}
.npstory a:active  {
  text-decoration: none;
}
.npstory a:visited  {
  text-decoration: none;
}
.npstory a:hover,
.npstory:hover {
  color: white;
  background-color: #0064b1;
}
.nptext{
  font-size: 100%;
  padding: 0 1em 1em 1em;
}
.nppic{
  margin: 0 auto;
  background-color: darkgray;
}
.nppic:hover img {
  transform: scale(1.05, 1.05);
  -webkit-transform: scale(1.05, 1.05);
  -moz-transform:    scale(1.05, 1.05);
    -ms-transform:     scale(1.05, 1.05);
    -o-transform:      scale(1.05, 1.05);
}
.nppic img {
	transition: all 0.3s ease-out 0s;
	-webkit-transition: all 0.3s ease-out 0s;
    -moz-transition:    all 0.3s ease-out 0s;
    -o-transition:      all 0.3s ease-out 0s;
}
#npblock1{
  float:left;
width: 61.663em;
 height: 36.4375em;
}
#npstory1{
  float:left;
width: 42.788em;
 height: 36.4375em;
}
#npstory1 p{
  font-size: 1.125em;
}
#nppic1{
width: 100%;
  height: 23.9375em;
}
#npstory2{
    margin-left:1em;
    float:left;
    width: 17.875em;
   height: 17.718em;
}
#npstory2 p{
	font-size: .625em;
}
#nppic2{
width: 100%;
  height: 10em;
}
#npstory3{
  margin-top: 1em;
    margin-left:1em;
    float:left;
    width: 17.875em;
   height: 17.718em;
}
#npstory3 p{
	font-size: .625em;
}
#nppic3{
width: 100%;
  height: 10em;
}
#npblock2{
  float:left;
width: 61.663em;
 height: 36.4375em;
}
#npstory6{
  float:right;
width: 42.788em;
 height: 36.4375em;
}
#npstory6 p{
  font-size: 1.125em;
}
#nppic6{
width: 100%;
  height: 23.9375em;
}
#npstory5{
    margin-right:1em;
    float:right;
    width: 17.875em;
   height: 17.718em;
}
#npstory5 p{
	font-size: .625em;
}
#nppic5{
width: 100%;
  height: 10em;
}
#npstory4{
  margin-top: 1em;
    margin-right:1em;
    float:right;
    width: 17.875em;
   height: 17.718em;
}
#npstory4 p{
	font-size: .625em;
}
#nppic4{
width: 100%;
  height: 10em;
}
/*-------sirt news page end-------*/


/*Downloaded from https://www.codeseek.co/r4c3r44/news-page-nkpyb */
    

Comments