doutan2228 2012-09-27 13:54
浏览 18
已采纳

如何在div中设置不同屏幕分辨率的背景图像?

I am developing a webpage in which I am setting background with help of div but my problem is that when the resolution of screen changes the image does not fit properly , it shows blank space on both side of screens on large screens. Is there a way with which I can make a standard case which shall run for all screens .

This is how I am setting my div

mheaderimgs {
width:1007px;
margin:auto auto;
height:auto;
}
  • 写回答

4条回答 默认 最新

  • douyu7879 2012-09-27 14:00
    关注

    CSS backckground-size property,

    background-size:contain;
    

    for more reference, see

    http://www.w3schools.com/cssref/css3_pr_background-size.asp

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(3条)

报告相同问题?

悬赏问题

  • ¥20 matlab yalmip kkt 双层优化问题
  • ¥15 如何在3D高斯飞溅的渲染的场景中获得一个可控的旋转物体
  • ¥88 实在没有想法,需要个思路
  • ¥15 MATLAB报错输入参数太多
  • ¥15 python中合并修改日期相同的CSV文件并按照修改日期的名字命名文件
  • ¥15 有赏,i卡绘世画不出
  • ¥15 如何用stata画出文献中常见的安慰剂检验图
  • ¥15 c语言链表结构体数据插入
  • ¥40 使用MATLAB解答线性代数问题
  • ¥15 COCOS的问题COCOS的问题