码迷,mamicode.com
首页 > 其他好文 > 详细

定位页面元素的位置

时间:2018-05-11 10:50:35      阅读:160      评论:0      收藏:0      [点我收藏+]

标签:html   距离   页面   c中   w3c   head   top   body   osi   

<html>
<head>
<style type="text/css">
h2.pos_abs
{
position:absolute;
left:100px;
top:150px
}
</style>
</head>

<body>
<h2 class="pos_abs">这是带有绝对定位的标题</h2>
<p>通过绝对定位,元素可以放置到页面上的任何位置。下面的标题距离页面左侧 100px,距离页面顶部 150px。</p>
</body>

</html>

 

w3c中查看到的例子

定位页面元素的位置

标签:html   距离   页面   c中   w3c   head   top   body   osi   

原文地址:https://www.cnblogs.com/houlai/p/9023034.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!