css - 使用 CSS 将 A 文本向上移动 45 像素

标签 css

我想将文本 "HOW IS IT" 移动到顶部 45 像素,我不确定我应该在 CSS 的 policymain 类中添加什么,这是我的 HTML 和 CSS

<style>
.policymain{width:975px; float:left; margin:0px 0 20px 0px; border-bottom:solid 2px #ccc; padding:12px 0 10px 0px}
</style>

<div id="wrapper">
<div class="midbox">
  <div id="content_area">
    <table width="100%" border="0" cellspacing="5" cellpadding="5" align="center">
        <tr> 
          <td>
<div class="policymain"><b><span style="font-size:30px; font-family:'Myriad Pro'; color:#174480;">HOW IS IT</span></b></div>
<br>
<br>
</div>
          </td>
        </tr>
</table>
 </div>
    </div>

最佳答案

要将它从当前位置向上移动 45px,您可以使用 position: relative; top: -45px;position: absolute; margin-top: -45px; 如果你想让它距离页面顶部 45px,使用 position: absolute;顶部:45px;

关于css - 使用 CSS 将 A 文本向上移动 45 像素,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/15512730/

相关文章:

javascript - 如果 jQuery 已经在做所有事情,为什么我们需要 React

html - 中间有图像的水平线的CSS技术

Jquery 动态表列问题

jquery - 缓慢滑动的页面背景图片

javascript - 无法将文字居中放置在图片上

html - 高度 :100% problem in IE7, 不在 FF 中

javascript - 更改标签类的调试方法

javascript - 搜索输入问题显示滚动

html - 使用 CSS 内联获取 HTML 文件的源代码

css - 纯 css 没有边距