Skip to content

Commit a0beac0

Browse files
committed
css实现新闻列表
1 parent 77c6e27 commit a0beac0

File tree

1 file changed

+46
-0
lines changed

1 file changed

+46
-0
lines changed
Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
<!DOCTYPE html>
2+
<html lang="en">
3+
<head>
4+
<meta charset="UTF-8">
5+
<title>新闻列表</title>
6+
<style>
7+
body,
8+
ul {
9+
margin: 0;
10+
padding: 0;
11+
}
12+
ul li {
13+
display: flex;
14+
align-content: center;
15+
justify-content: space-between;
16+
border-bottom: 1px dashed #ddd;
17+
margin: 0;
18+
padding: 8px 0;
19+
}
20+
ul li .title {
21+
overflow: hidden;
22+
white-space: normal;
23+
text-overflow: ellipsis;
24+
}
25+
ul li .date {
26+
flex-shrink: 0;
27+
}
28+
</style>
29+
</head>
30+
<body>
31+
<ul>
32+
<li>
33+
<div class="title">新闻标题</div>
34+
<div class="date">2022-05-31</div>
35+
</li>
36+
<li>
37+
<div class="title">新闻标题</div>
38+
<div class="date">2022-05-31</div>
39+
</li>
40+
<li>
41+
<div class="title">新闻标题</div>
42+
<div class="date">2022-05-31</div>
43+
</li>
44+
</ul>
45+
</body>
46+
</html>

0 commit comments

Comments
 (0)