html – 将子内容定位在父容器之外

html – 将子内容定位在父容器之外,第1张

概述我试图在它的父DIV(文章)容器之外可视地定位DIV(文章标题).这可能吗? 我的标记示例可在此处获取 – http://codepen.io/calebo/pen/CGoyD 试试这个: .main { background: tomato; float: left; width: 600px; margin-top: 30px; /* above Layout a 我试图在它的父div(文章)容器之外可视地定位div(文章标题).这可能吗?

我的标记示例可在此处获取 – http://codepen.io/calebo/pen/CGoyD

解决方法 试试这个:

.main {  background: tomato;  float: left;  wIDth: 600px;  margin-top: 30px;        /* above Layout adjustment */  /* removed overflow: hIDden; */  /* use always clearfix method instead */}.article_header {  background: SteelBlue;  color: #fff;  position: absolute;  bottom: 100%;  margin-bottom: 10px;  /* to neutralize padding of parent container */  left: -10px;          /* to neutralize padding of parent container */  padding: 10px;        /* to neutralize padding of parent container */  right: -330px;        /* to neutralize padding of parent container */}.main > article{  position: relative;}.asIDe {  background: cyan;  float: right;  wIDth: 300px;  margin-top: 30px;        /* above Layout adjustment */}

Working Codepen

要进行调整,请使用保证金属性.

总结

以上是内存溢出为你收集整理的html – 将子内容定位在父容器之外全部内容,希望文章能够帮你解决html – 将子内容定位在父容器之外所遇到的程序开发问题。

如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。

欢迎分享,转载请注明来源:内存溢出

原文地址:https://www.54852.com/web/1065107.html

(0)
打赏 微信扫一扫微信扫一扫 支付宝扫一扫支付宝扫一扫
上一篇 2022-05-26
下一篇2022-05-26

发表评论

登录后才能评论

评论列表(0条)

    保存