固定的背景封面会在移动视图中放大 [英] Fixed background cover becomes zoomed in mobile view

查看:74
本文介绍了固定的背景封面会在移动视图中放大的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在这里为我的网站使用固定的背景封面: http://www.datisdesign.com

I'm using a fixed background cover for my website here: http://www.datisdesign.com

每个页面的标题图像都很大,但是在诸如手机之类的小型设备中,封面图像会变得很大。我想在移动设备中缩小它。

Every page has a big header image, but in small devices such as mobiles, the cover image becomes so large. I want to make it smaller in mobile devices.

我正在使用的代码:

#takelessons {
    background: url(../img/portfolio/takelessons-intro.jpg) no-repeat;
    background-attachment: fixed;
    background-size: cover;
    background-position: center top;
}

推荐答案

我通过将功能限制在平板电脑大屏幕上解决了我的问题。

I solved my problem by limiting the capability to the large tablet screen size.

@media screen and (max-width: 992px) {
    #parallax {
        background-attachment: scroll;
    }
}

这篇关于固定的背景封面会在移动视图中放大的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆