I am in the process of designing a website that will feature news content, and I would like to give it a layout similar to a reddit news box. The layout would resemble the following structure. I am using angular material and CSS exclusively, without any frameworks like bootstrap.
_____________________________________
|Column 1 | Column2 - Area 1 |
|Column 1 | Column2 - Area 2 |
|Column 1 | Column2 - Area 2 |
|Column 1 | Column2 - Area 2 |
|Column 1 | Column2 - Area 2 |
|Column 1 | Column2 - Area 2 |
|Column 1 | Column2 - Area 2 |
|_____________________________________|
|Coulmn 1 | Column2 - Area 3 |
______________________________________
I have experimented with different variations using display: flex, but I am having difficulty arranging it properly. Can anyone provide assistance?
This is what I've attempted so far:
<div class="news-container">
<div class="news-header">
<div class="news-vote-column">
<div>
<mat-icon matSuffix color="accent" class="clickable-icon" (click)="voteUp()">arrow_drop_up</mat-icon>
</div>
<div class="vote-number">1</div>
<div>
<mat-icon matSuffix color="accent" class="clickable-icon" (click)="voteDown()">arrow_drop_down</mat-icon>
</div>
</div>
<div>
<h3>I am a new post!</h3>
</div>
<div>
<h5>- Posted by admin - 10/10/2019 12:00</h5>
</div>
</div>
</div>
.news-container {
margin-bottom: 1em;
background-color: #f1f2f3;
border: #7e868d 1px solid;
border-radius: 5px;
min-height: 200px;
}
.news-vote-column {
min-height: 200px;
min-width: 40px;
background-color: #d2d3d6;
border-radius: 5px 0 0 5px;
text-align: center;
}
.news-header {
display: flex;
font-family: Verdana, Geneva, Tahoma, sans-serif;
color: #7e868d;
h3 {
margin: 2px 2px 2px 10px;
}
h5 {
color: #cecfd1;
margin: 5px;
}
}
.vote-number {
text-align: center;
margin: 2px 2px 2px 2px;
}
.clickable-icon {
cursor: pointer;
}