创建无限水平线
I'd like to create an infinite horizontal div. However, I have no idea about how to do it.
Can someone help me to do it using this code as a start point?
Please, take a look at this image to understand how this infinite horizontal div should be.
Thank you!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我所说的“无限”是指到wiewport/窗口的末尾。您可以尝试绝对定位的元素;
这将是一个覆盖层,出现在正常文档流中的任何内容之上
html
css
演示位于:http://jsfiddle.net/PstWc/2/
By "infinite" i am assuming you mean to the end of the wiewport/window. You could try an absolutely positioned element;
this will be an overlay, appearing on top of anything in normal document flow
html
css
Demo at: http://jsfiddle.net/PstWc/2/
您可以将 1 像素高的 div 设置为 100% 宽度:
示例。
可能不是最优雅的方式,但它是一种方式。
You can use a 1px high div set to 100% width:
Example.
Might not be the most elegant way to do it, but it's a way.