我想把它排列清楚,但我做不到。我应该为此做什么?
<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>
最佳答案
为了获得您所要求的设计结果,您必须将边距样式移至 div,并将颜色和文本装饰保留在 a 标签上。如果您只是从样式标记中删除“a”,则不会获得任何颜色或文本装饰更改,因为浏览器中的样式(直接在 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>
请参阅此示例。
关于html,如何排列清晰?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/42136671/