@media only screen and (min-width: 1024px)     //当分辨率width >= 1024px 时使用1.jpg作为背景图片
{            
.bg{
  background:url(./images/1.jpg) no-repeat;
 }
}
@media only screen and (min-width: 400px) and (max-width: 1024px)    //当分辨率400px < width < 1024px 时使用2.jpg作为背景图片
{  
   .bg{
           background:url(./images/2.jpg) no-repeat;
        }
}
@media only screen and (mmax-width: 400px)    //当分辨率width =< 400px 时使用3.jpg作为背景图片
{   
     .bg{
             background:url(./images/3.jpg) no-repeat;
          }
}

Html-根据不同的分辨率设置不同的背景图片的更多相关文章

  1. 关于设置UITableView的背景图片

    在UITableViewController中,要设置UITableView的背景图片,以前常用的方法是使用backgroundcolor属性,这个属性可以通过UIImage来获取,但最近发现这个方法 ...

  2. WPF 后台C#设置控件背景图片

    原文:WPF 后台C#设置控件背景图片 以前的程序中有做过,当时只是记得uri很长一大段就没怎么记.今天有人问了也就写下来.   这是一个Button,设置了Background后的效果. 前台的设置 ...

  3. IntelliJ IDEA设置主题和背景图片(背景色)

    设置主题以及背景图片 设置代码背景颜色

  4. 设置UINavigation的背景图片和背景颜色

    //通过背景图片来设置背景 float systemVersion = [[[UIDevice currentDevice] systemVersion] floatValue]; UIImage * ...

  5. css2如何设置全屏背景图片

    每次在做一个网站后台登陆页面的时候,当UI给我一张背景是不规律的背景图片,但是在设置为背景时,总会遇到屏幕大小的问题,导致背景图片有可能平铺.这样UI的效果达不到也会很难看. 本来我想用body{ba ...

  6. VC编程之设置客户区背景图片

    在很多系统中出于美观的需要常常要设置背景图片.下面我介绍一种在客户区设置背景图片的简单方法. 1 .将背景bmp 图片导入到工程,资源ID 这里假设为 IDB_BITMAP1 2 .在视图类添加如下代 ...

  7. background 的一些 小的细节: 1, 背景色覆盖范围: border+ width+ padding ;背景图覆盖范围: width + padding ; 2设置多个背景图片 ; 3) background-position定位百分比的计算方式: 4)background-clip 和 background-origin 的区别

    1. background (background-color, background-image)  背景色覆盖范围: border+ width+ padding ;背景图覆盖范围: width ...

  8. swift - UIView 设置背景色和背景图片

    代码如下: let page = UIView() page.frame = self.view.bounds //直接设置颜色 page.backgroundColor = UIColor.gree ...

  9. VS 设置背景色和背景图片

    VS版本:2013 选择菜单栏上——工具——选项——环境——字体和颜色——自定义(项背景),选择好自己喜欢的颜色即可 设置背景图片 下载vs插件(ClaudiaIDE):https://visuals ...

随机推荐

  1. php 公历阴历互相转换

    <?php /** * Created by PhpStorm. * User: timeless * Date: 17-3-9 * Time: 上午9:32 */ class Lunar { ...

  2. day_6.10 tcp三次握手 四次挥手

    tcp和udp对比   tcp比udp稳定 断开连接的四次挥手

  3. Linux 更新vim

    https://blog.csdn.net/linuxnews/article/details/52938583 https://blog.csdn.net/nzyalj/article/detail ...

  4. 使用commons-net做FTP功能的异常 java.lang.ClassNotFoundException: org.apache.oro.text.regex.Malformed

    最近使用Apache的commons-net.jar做FTP上传下载功能,点击“上传”的时候报错,如下: java.lang.ClassNotFoundException: org.apache.or ...

  5. 初级ai思维导图,基础人工智能设计图

    2017年2月8日09:35:46 仅供代码和逻辑设计图纸,只提供一个参考设计,后面可能会更新具体实施说明

  6. python中OrderedDict的使用

    很多人认为python中的字典是无序的,因为它是按照hash来存储的,但是python中有个模块collections(英文,收集.集合),里面自带了一个子类 OrderedDict,实现了对字典对象 ...

  7. 2012年蓝桥杯省赛A组c++第2题(暴力求解古堡算式)

    /* 古堡算式 福尔摩斯到某古堡探险,看到门上写着一个奇怪的算式: ABCDE * ? = EDCBA 他对华生说:“ABCDE应该代表不同的数字,问号也代表某个数字!” 华生:“我猜也是!” 于是, ...

  8. [daily][editer] 二进制编辑工具 hyx

    用了众多之后,终于发现了一个好用的二进制编辑工具: hyx https://yx7.cc/code/ https://en.wikipedia.org/wiki/Comparison_of_hex_e ...

  9. [daily][archlinux][rsync] rsync

    科普文档:https://wiki.archlinux.org/index.php/Rsync 之前改文件系统时,用过. 然而用的不太对,导致一部分文件的权限出了问题. [troubleshoot][ ...

  10. 使用TidCookieManager得到cookie

    1.拖入TIdHTTP控件,HandleRedirect设为True,否则可能会出现HTTP 307错误. 2.主要的设置在Request里. 2.1 userAgent应该改为Mozilla/4.0 ...