我知道您可以在距离左侧 50 像素的地方制作标题。但是你能从另一个标题制作 50 像素的东西吗?不只是从边缘?比如标题 2 需要距离标题 1 50 像素。我该怎么做?
最佳答案
使它们都成为内联 block 并在第一个上添加 50px margin-right。
<style>h1, h2 { display: inline-block; margin-right: 50px; }</style>
<h1>my thing</h1>
<h2>my other thing<h2>
请看这个例子:http://jsfiddle.net/bpR7H/
注意:您需要避免 position: absolute
才能正常工作,因为绝对定位的元素不会影响其他元素的位置。
关于css - 如何将标题从另一个标题移动 50px?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/13666904/