【发布时间】:2019-10-14 22:11:57
【问题描述】:
我正在创建一个包含新闻的网站,并希望将其设置为 reddit 新闻框。它看起来像下面这样。我使用的是角度材质和 css,所以基本上是纯 HTML 和 CSS,没有引导程序或类似的东西。
_____________________________________
|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 |
______________________________________
我使用 display: flex 玩过不同的版本,但不能完全正确地安排它。任何人都可以帮忙吗?
我试过了
<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;
}
【问题讨论】:
-
StackOverflow 不是免费的编码服务。你应该try to solve the problem first。请更新您的问题以在minimal reproducible example 中显示您已经尝试过的内容。如需更多信息,请参阅how to ask, 并拨打tour。
-
我会在这里查看网格,但没有代码,也没有尝试在这里得到你真正的问题:(
-
我在与我在做什么有关的问题中添加了一些内容。