Apple 如何将其幻灯片放置在固定位置框中?
有关我所讨论内容的示例,请参阅 iPhone 页面。
Apple 将其幻灯片放置在包装器中:
<div id="wrapper">
<div id="clip">
<!-- Slideshow here -->
</div>
...
</div>
这是包装器的 CSS。
#wrapper {
height: 758px;
margin: 0 auto;
width: 980px;
}
然而,通过Firebug检查文档,我发现它的幻灯片要大得多,但它仍然能够在没有滚动条的情况下显示。它是如何做到的?
这是幻灯片的 CSS:
#clip {
background: url("http://images.apple.com/v/iphone/home/b/images/shadow_down.png") no-repeat scroll 50% 0 #FFFFFF;
margin: 1px -400px 3px;
overflow: hidden;
padding-top: 4px;
width: 1780px;
}
See the iPhone page for an example of what I'm talking about.
Apple positions its slideshow within a wrapper:
<div id="wrapper">
<div id="clip">
<!-- Slideshow here -->
</div>
...
</div>
Here's the CSS for the wrapper.
#wrapper {
height: 758px;
margin: 0 auto;
width: 980px;
}
However, inspecting the document through Firebug, I found that its slideshow is much larger, but it still manages to be displayed without scrollbars. How does it do that?
Here's the CSS for the slideshow:
#clip {
background: url("http://images.apple.com/v/iphone/home/b/images/shadow_down.png") no-repeat scroll 50% 0 #FFFFFF;
margin: 1px -400px 3px;
overflow: hidden;
padding-top: 4px;
width: 1780px;
}
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
overflow:hidden
将隐藏滚动条。overflow: hidden
will hide scroll bars.它是带有
hidden
值的overflow
属性。It's the
overflow
property with thehidden
value.