水平酒吧延长外部容器 [英] Horizontal Bar extending outer container
本文介绍了水平酒吧延长外部容器的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我不知道我会搜索什么,但我相信它就像改变位置类型一样简单:用于CSS。
I有一个容器DIV(宽度:960px),我想要一个橙色的酒吧,但它会比它的容器宽,它将是100%。我怎样才能做到这一点?
解决方案
您可以使用绝对定位来达到此效果。
HTML:
< div id =wrapper>
< div id =orange-bar>< / div>
< / div>
CSS:
#orange-bar {
position:absolute;
剩下:0;
right:0;
}
JS小提琴: http://jsfiddle.net/Xh8uL/2/
I'm not sure what I would search for, but I believe it's just as simple as changing the type of position: to be used in CSS.
I have a Container DIV (width: 960px), and I want an orange "bar" in it somewhere, but it will be wider than its container, it will be 100%. How can I achieve this?
解决方案
You can use absolute positioning to achieve this effect.
HTML:
<div id="wrapper">
<div id="orange-bar"></div>
</div>
CSS:
#orange-bar {
position: absolute;
left: 0;
right: 0;
}
JS Fiddle: http://jsfiddle.net/Xh8uL/2/
这篇关于水平酒吧延长外部容器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文