gpt4 book ai didi

html - 删除 DIV 中文本前的空格

转载 作者:太空宇宙 更新时间:2023-11-04 04:33:15 25 4
gpt4 key购买 nike

我正在为元数据创建一个 div,它的后面有一条线,出于某种原因,空格被添加到该行的开头,我不确定为什么。

这是 CSS:

.mline {
border-top: 1px solid #E7E7E7;
height: 0px;
margin: 20px 0 20px 0;
text-align: center;
}
.mline > div {
background-color: #FFFFFF;
line-height: 30px;
padding: 0 5px 0 5px;
position: relative;
text-transform: lowercase;
top: -16px;
}
.mline * {
display: inline-block;
}
.mline h1 {
font-size: 12px;
font-weight: normal;
}
.info {
line-height: 16px;
}
.info li:after {
content:" \2022 ";
}
.info li:last-child:after {
content:"";
}
.liked, .like:hover {
color: red !important;
}

这是 HTML:

<section>
<div class="mline">
<div>
<ul class="info">
<li><a href="{Permalink}">3/5/13</a></li>
<li><a href="{Permalink}">21 notes</a></li>
<li><a href="{ReblogURL}">reblog</a></li>
</ul>
</div>
</div>
</section>

您可以在我的网站上看到错误:http://nellyswritingroom.tumblr.com/在这个 jsfiddle 中:http://jsfiddle.net/xrVh4/1/

我不确定发生了什么,因为它绝对不是边距或填充。任何帮助将不胜感激!

最佳答案

在 jsfiddle 示例中,我假设左填充默认添加到 ul.info 元素。

然而,该网站在 newstyle.css 中有以下几行:

ul, ol {
margin-left: 2em;
}

如果您不需要任何边距或填充,您可以使用以下方法清除它们:

.info {
line-height: 16px; // already there - I'm not adding this
margin: 0;
padding: 0;
}

Example

关于html - 删除 DIV 中文本前的空格,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/16872567/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com