现在我正在编写一个网站,其中所有内容都位于页面的中心。我想要一个小飞机图标,其轨迹在屏幕右侧延伸。
但是,图像会不断为图像的其余部分创建水平滚动条。
如何放置图像,使图像的剩余部分仅在调整浏览器大小时可见。
见附件代码:
.home-planepath {
position:absolute;
left:50%;
width:100%;
height:62px;
z-index: 1;
margin-top:442px;
margin-left: -440px;
overflow: hidden;
background:url(images/home-planepath.png) no-repeat;
}
最佳答案
你应该设置 overflow:hidden
在您的容器上,即 .homehover
而不是 .home-planepath
关于css - 如何将背景图像溢出屏幕,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/11588051/