我想把我的粗体文字(Thierry)放在一些像素较低的位置......
<div class="editor-field">
<b>Thierry</b>
</div>
有可能吗?
像(不起作用):
.editor-field b
{
margin-top: 20px;
}
有什么想法吗?
由于
答案 0 :(得分:1)
您可以使用该位置替换它。
.editor-field b
{
position: relative;
top: 20px;
}
这应该有效。
答案 1 :(得分:0)
position: relative
听起来像是最有趣的方式:
.editor-field b
{
position: relative;
top: 20px;
}
position: relative
很好,因为它在文档流中保留了与之前相同的空间,并在文档中自由移动元素。一个副作用是它下面的任何元素都不会移开 - 元素可能会重叠。你必须看看这对你的情况是否合适。