【问题标题】:Background-size: cover not clearly display on Iphone背景尺寸:Iphone 上的封面显示不清晰
【发布时间】:2018-09-27 17:05:29
【问题描述】:

美好的一天! 这行 CSS 代码在其他浏览器中运行良好。但是每当我尝试使用 safari 运行代码时。图像显示不好。有人说,我必须对 iPhone 使用媒体查询:Iphone Media Query 下面的示例代码

 @media (max-width: @iphone-screen) {
    background-attachment: scroll;
  }

但该代码无法正常工作。谁能帮我解决这个问题? 这是我的代码:

#video {
background: url("images/sample_8.jpg");
-webkit-background-size: cover;
 background-size: cover;
 background-repeat:no-repeat;
 background-position: center;
 background-attachment:fixed;
 position: relative;
 color: #999;
 -webkit-filter: grayscale(100%); 
 filter: grayscale(100%);
 }

【问题讨论】:

  • 尝试背景尺寸:包含; iPhone

标签: html css safari


【解决方案1】:

你可以试试background-size:contain; iphone:

 @media (max-width: @iphone-screen) {
    background-size:contain;
  }

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2016-02-26
    • 1970-01-01
    • 1970-01-01
    • 2017-05-15
    • 1970-01-01
    • 2014-08-01
    • 1970-01-01
    相关资源
    最近更新 更多