html,如何排列清晰?

标签 html indentation

screenshot of wrapped lines with deviant indentation

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

<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/

相关文章:

iphone - 无法缩进 UITableViewCell 子类

javascript - 如何更改当前页面链接的颜色 - HTML/CSS/JavaScript

javascript - 通过网页关闭计算机

c++ - gnu缩进的谷歌c风格设置?

matlab - MATLAB 或 Octave 的自动压痕清洁器?

xcode4 - 如何更改 Xcode 4.5 中的默认代码缩进?

css - VSCode 中 CSS 的代码折叠

javascript - 显示以下链接的结果

javascript - 将垂直居中图像的标题左对齐

java - Servlet 从 Form 元素获取 NULL Paramaetrs