JSFiddle - React, Tailwind, and code Playground
by tsaii
HTML
<html lang="zh-TW">
<body>
<header>
<div class="header-logo">
<a id="logo" href="https://www.storm.mg/"><img src="https://www.storm.mg/images/logo.svg" alt="風傳媒" width="30%" height="30%"></a>
<div class="buttons">
<button class="btn">訂閱華爾街日報</button>
<button class="btn">支持風傳媒</button>
</div>
</div>
</header>
<hr>
<nav id="n1">
<ul id="up">
<li class="listbar">
<a href="https://new7.storm.mg/"><img class="img" src="https://www.storm.mg/images/logo_new7.svg" alt="#"></a>
</li>
<li class="listbar">
<a href="https://onepercent.storm.mg/"><img class="img" src="https://www.storm.mg/images/1percentstyle.svg" alt="#"></a>
</li>
<li class="listbar">
<a href="https://www.storm.mg/premium">
<img class="img" src="https://www.storm.mg/images/vip_logo.png" alt="#">
</a>
</li>
<li class="listbar">
<a href="https://www.storm.mg/article/4766680#">新聞</a>
</li>
<li class="listbar">
<a href="https://www.storm.mg/article/4766680#">評論</a>
</li>
<li class="listbar">
<a href="https://www.storm.mg/article/4766680#">財經</a>
</li>
<li class="listbar">
<a href="https://www.storm.mg/article/4766680#">生活</a>
</li>
<li class="listbar">
<a href="https://www.storm.mg/article/4766680#">下班經濟學</a>
</li>
</ul>
</nav>
<nav class="hotNews">
<p style=color:red>熱門新聞</p>
<ul class="split_list_wrapper">
<li class="split_list">
<div class="hn"><h3 class="num">1</h3>
<a class="split_link" href="https://www.storm.mg/article/4776601">獨家》郭台銘對決侯友宜拚民調逆轉 想見4年沒聯絡的馬英九卻遭婉拒</a></div>
<p class="name">晏明強</p>
</li>
<li class="split_list">
<div class="hn"><h3 class="num">2</h3>
<a class="split_link"...
CSS
* {
padding: 0;
margin: 0;
box-sizing: border-box;
}
header {
display: flex;
justify-content: center;
align-items: center;
height: 90px;
}
.buttons {
display: flex;
position: absolute;
top: 0;
right: 0;
padding: 6px 4px;
}
.btn {
display: flex;
align-items: center;
justify-content: center;
height: 30px;
width: 120px;
margin-left: 5px;
padding: 10px 10px;
border: none;
border-radius: 5px;
color: #fff;
background-color: red;
cursor: pointer;
}
#n1 {
display: flex;
justify-content: flex-start;
border-bottom: 1px solid gray;
}
#up {
display: flex;
list-style: none;
padding: 0;
margin: 0;
}
.listbar {
display: flex;
}
.listbar a {
display: flex;
align-items: center;
text-decoration: none;
margin: 5px 8px;
text-align: center;
font-size: 16px;
color: black;
}
.img {
width: 80px;
height: 30px;
margin: 0;
padding: 1px;
}
.tags {
border-left: 7px solid red;
padding: 10px 18px;
color: darkred;
}
.hotNews {
float: right;
width: 20%;
display: flex;
padding: 20px 10px;
flex-wrap: wrap;
}
.split_list_wrapper {
list-style-type: none;
}
.hotNews p {
padding: 8px 10px;
}
.art {
float: left;
}
.hn {
display: flex;
border-top: 1px solid lightgray;
padding: 20px 1px 5px 3px;
}
.split_link {
text-decoration: none;
list-style-type: none;
font-size: 15px;
color: black;
}
.name {
color: red;
font-size: 13px;
}
.split_link a:hover {
text-decoration: underline;
}
.num {
padding: 2px 10px;
color: red;
}
h1 {
text-align: center;
padding: 10px;
}
.para {
color: gray;
font-size: 12px;
padding-left: 10px;
}
#TW {
margin: 20px 45px 5px;
max-width: 600px;
}
#para3,
.article,
.down a {
padding: 5px 10px;
}
.down a {
display: block;
text-decoration: none;
color: #ADADFF;
}
.down a:hover {
text-decoration: underline;
}