XHTML 段落标签绝对定位
绝对定位段落
标记是标准做法还是应该首先将段落包裹在
标记内,后者绝对定位,从而定位子段?
谢谢。
Is it standard practice to position paragraph <p>
tags absolutely or should the paragraph be first wrapped inside a <div>
tag with the latter being positioned absolutely thus positioning the child paragraph?
Thank you.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
段落绝对定位的情况很少见,所以这不是标准做法。
也就是说,如果您想要定位单个段落,那么仅仅为此将其包装在 div 中是没有意义的。
通常的准则适用:编写最能描述内容语义的标记,然后添加所需的最少量的附加通用标记(div、span),以按照您想要的方式设置样式。
听起来,在这种情况下,最低金额是“根本没有”。所以不要添加div。
It is very rare for a paragraph to be absolutely positioned, so no it is not standard practise.
That said, if you have a single paragraph that you want to position, it would be pointless to wrap it in a div just for that.
The usual guidelines apply: Write the markup that best describes the semantics of the content, then add the minimum amount of additional generic markup (divs, spans) needed to style it the way you want.
It sounds like, in this case, the minimum amount is 'none at all'. So don't add a div.