【发布时间】:2016-01-26 15:24:54
【问题描述】:
如何从父容器应用到元素的强制宽度中移除元素?
<div id="container"> <!-- This div is forcing the site to be 960px width. Also It holds all the content that the site has -->
<div id="extra"> <!-- I would like to make this div responsive full width so that the image that the div holds will always be stretched from browser's left border to the right border -->
<img src="orange.jpg">
</div>
</div>
我无法编辑原始网站的 CSS。这就是为什么我不能修改按比例保存 .container 的代码。我只能将 css 添加到网站。
我一直在尝试使用不同的位置命令,但它们似乎没有带来所需的解决方案。我无法获得从左到右的图像跨度。
我可以使用哪些解决方案来解决这个问题。我只能使用css。我正在通过 SiteOrigin 插件使用 WordPress 和 PageBuilder。
【问题讨论】:
-
当你说 div "extra" 应该有全宽时,你的意思是 div "container" 的全宽吗?
-
不,我想要 div “额外”的浏览器全宽。假设我的浏览器 Chrome 已打开,我正在查看该网站。浏览器窗口宽度设置为 1500 像素。我希望这个宽度是 div“额外”的宽度。如果我将浏览器窗口调整为例如。 1100px 宽度“额外”的 div 宽度应相应地设置为 1100px。虽然“额外”的 div 被重新占用,但“容器”的 div 不会改变总是 960px 宽度。
标签: css containers element parent flow