html,如何排清楚?

html,How to line it up clearly?

我想把它排列清楚,但我做不到。我应该怎么做?

<html>
<head>
<style type="text/css">
    .article-topic-list a {
        color: black;
        text-decoration: none;
        margin-left: 15px; 
        margin-top: 20px;
    }`enter code here`
</style>
</head>
<body>
<div class="article-topic-list"> <a href="">Sale of Kodi TV boxes faces <br> legal test</a> </div>
<div class="article-topic-list"> <a href="">Piracy fighters battle Kodi 'epidemic'</a></div>
</body>
</html>

不是将 css 规则应用于标签,而是将规则应用于整个 div,我相信它应该正确排列。您的样式脚本将是这样的:

<style type="text/css">
.article-topic-list {
    color: black;
    text-decoration: none;
    margin-left: 15px; 
    margin-top: 20px;
}
</style>

并且输出将类似于 this。

为了获得您要求的结果,在设计方面,您必须将 margin-styles 移动到 div,并保持颜色和 text-decoration 在您的 a-tag。如果您只是从样式标签中删除 'a',您将不会获得任何颜色或 text-decoration 更改,因为来自浏览器的样式(直接在 a 上)将优先。

.article-topic-list {
  margin-left: 15px; 
  margin-top: 20px;
}
.article-topic-list a {
  color: black;
  text-decoration: none;
 }
<body>
  <div class="article-topic-list">
    <a href="">Sale of Kodi TV boxes faces <br> legal test</a>
  </div>
  <div class="article-topic-list">
    <a href="">Piracy fighters battle Kodi 'epidemic'</a>
  </div>
</body>

看这个例子。