Blogger Information
Blog 51
fans 0
comment 1
visits 71004
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
移动端图片自适应移动端图片自适应
呵呵哒
Original
2793 people have browsed it

移动端图片自适应

移动端自适应

移动端自适应

移动端自适应

实例

@media screen and (max-width: 750px) {
     img
        {
            width: 100%;
            height:auto;
            background-color: crimson;
            display: block;
        }

        }
        
        这里用到是媒体查询 ,作用是观察屏幕宽度, 当宽度达到我们设置的值,他会根据我们所设置 id class 标签等,改变他们的属性值 ,
        这种方法,我是用来应对,移动端和pc端 两者之间的切换,相当于两套模板了

运行实例 »

点击 "运行实例" 按钮查看在线实例


Statement of this Website
The copyright of this blog article belongs to the blogger. Please specify the address when reprinting! If there is any infringement or violation of the law, please contact admin@php.cn Report processing!
All comments Speak rationally on civilized internet, please comply with News Comment Service Agreement
0 comments
Author's latest blog post
  • 1
    2018-03-17 17:09:25