CSS3怎么做出响应式布局

今天给大家带来一个用css3做出来的响应式布局的案列,需要的朋友可以拿去借鉴使用,响应式是css3的一个特色,我们熟练掌握后手机端和pc端都可以熟练的使用。

nbsp;html>                                                        *{padding: 0;margin: 0;}                 html,body{width: 100%;height: 100%;background:url(img/bj.jpg) ;background-size: 100% 100%;}                 #nav{width: 560px;height:40px ;margin: 10px auto;}                 ul,li{list-style: none;}                 .list{width: 560px;height: 40px;background: #fff;}                 .list li{width: 50px;height: 40px;margin: 0 10px;float: left;                            transition: all 1s;                 }                 .list li:nth-child(1){                      background: url(img/1.png) top;                 }                 .list li:nth-child(2){                      background: url(img/2.png) top;                 }                 .list li:nth-child(3){                      background: url(img/3.png) top;                 }                 .list li:nth-child(4){                      background: url(img/4.png) top;                 }                 .list li:nth-child(5){                      background: url(img/5.png) top;                 }                 .list li:nth-child(6){                      background: url(img/6.png) top;                 }                 .list li:nth-child(7){                      background: url(img/7.png) top;                 }                 .list li:nth-child(8){                      background: url(img/8.png) top;                 }                 .list li:hover{                      background-position: bottom;                 }                 @media only screen and (min-width: 640px) and (max-width: 980px) {                      #nav{position: fixed;top:100px;left:10px;width: 50px;height:400px ;margin: 10px auto;}                       ul,li{list-style: none;}                      .list{width: 67px;height: 400px;background: #fff;}                      .list li{width: 50px;height: 40px;margin: 0 10px;float: left;                                  transition: all 1s;                      }                 }                 @media only screen and (min-width: 100px) and (max-width: 640px) {                      #nav{position: fixed;top:100px;left:10px;width: 50px;height:400px ;margin: 10px auto;}                      ul,li{list-style: none;}                      .list{width: 67px;height: 400px;background: red;}                      /*.list li{width: 50px;height: 40px;margin: 0 10px;float: left;                                  transition: all 1s;                                  background: #fff;                                                       }*/                                      .list li:nth-child(1){                      background: url(img/1.png) top;                 }                 .list li:nth-child(2){                      background: url(img/2.png) top;                 }                 .list li:nth-child(3){                      background: url(img/3.png) top;                 }                 .list li:nth-child(4){                      background: url(img/4.png) top;                 }                 .list li:nth-child(5){                      background: url(img/5.png) top;                 }                 .list li:nth-child(6){                      background: url(img/6.png) top;                 }                 .list li:nth-child(7){                      background: url(img/7.png) top;                 }                 .list li:nth-child(8){                      background: url(img/8.png) top;                 }                 .list li:hover{                      background-position: bottom;                 }                 .list li{width: 50px;height: 40px;margin: 0 10px;float: left;                            transition: all 1s;                            border-radius: 50%;                 }                                 }                                                  
                 
                          
  •                       
  •                       
  •                       
  •                       
  •                       
  •                       
  •                       
  •                                       
           
      

登录后复制

以上就是一个响应式布局的案例,更多精彩请关注【创想鸟】其它相关文章!

相关阅读:

响应式布局

立即学习“前端免费学习笔记(深入)”;

响应式布局

立即学习“前端免费学习笔记(深入)”;

响应式布局

立即学习“前端免费学习笔记(深入)”;

以上就是CSS3怎么做出响应式布局的详细内容,更多请关注【创想鸟】其它相关文章!

版权声明:本文内容由互联网用户自发贡献,该文观点仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容, 请发送邮件至253000106@qq.com举报,一经查实,本站将立刻删除。

发布者:PHP中文网,转转请注明出处:https://www.chuangxiangniao.com/p/3121473.html

(0)
上一篇 2025年3月29日 17:51:36
下一篇 2025年3月29日 07:26:21

AD推荐 黄金广告位招租... 更多推荐

相关推荐

  • css3的弹性盒怎么做出来

    有时候我们需要在css3里写一个弹性盒子,那么这个代码怎么做出来呢?这就需要用到我们的box-shadow属性了,他可以让盒子在显示的时候产生阴影效果,下面就给大家详细的说明一下 写法:        box-shadow:length l…

    编程技术 2025年3月29日
    100
  • 怎么用CSS3媒体查询

    css3的媒体查询功能,使得媒体查询得以实现,其实基本原理还是用css3媒体查询(media/meta)功能查出设备的尺寸,然后写出不同的尺寸写出或者覆盖css样式,使得界面看起来变换了。接下来就和大家说一下怎么用css3媒体查询。 esp…

    编程技术 2025年3月29日
    100
  • CSS3有哪些新增的背景属性

    给大家总结归纳一些css的背景属性,以及css3有哪些新增的背景属性。 background:   background-color:背景颜色   background-color:背景图片   background-color:背景重复 …

    编程技术 2025年3月29日
    100
  • CSS3常用的几种选择器

    在20世纪90年代初html诞生后,在96年底就有css诞生了,css是专门定义网页的基本属性的,那么在css3中,常用的选择器有哪些?今天就给大家介绍一下。 HTML的诞生 20世纪90年代初 1996年底,    CSS第一版诞生 19…

    编程技术 2025年3月29日
    100
  • CSS3自适应全屏焦点图切换的特效怎么做

    给大家带来用纯CSS3实现全屏背景切换焦点图效果,不参夹JS的代码,简单易懂还好用,需要的朋友可以直接搬运。下面我们来看一下 nbsp;html>                                            …

    编程技术 2025年3月29日
    100
  • css3怎么做幻灯片切换动画效果

    这次教大家的是怎样用css3做出幻灯片的切换动画效果,幻灯片的切换动画效果在很多情况下都可以用得到,今天就给大家一份幻灯片的切换动画效果的操作案例 nbsp;html>    html5 幻灯片切换动画                …

    编程技术 2025年3月29日
    100
  • css3怎么实现图片封面展示的动画

    给大家做一个小案例,如何css3怎么实现封面展示的。图片封面展示在很多情景下可以用到,比如产品展示页面等。 nbsp;html>    css3图片封面展示动画                                     …

    编程技术 2025年3月29日
    100
  • CSS3怎么制作蝴蝶飞舞的动画

    css3怎么制作蝴蝶飞舞的动画?蝴蝶飞舞的动画效果是什么样的?css3制作蝴蝶飞舞的动画需要注意哪些方面?今天给大家用css3做一个蝴蝶飞舞的动画。 nbsp;html>  CSS3制作蝴蝶飞舞动画       body{ backg…

    编程技术 2025年3月29日
    100
  • css3点击显示涟漪特效

    css3点击显示涟漪特效,怎样用css3做出点击显示涟漪特效,点击显示涟漪的特效需要注意哪些方面?下面给大家做一个案例. nbsp;html>    css3点击出现不同颜色涟漪特效       /* NOTE: The styles…

    编程技术 2025年3月29日
    100
  • CSS的编码怎么转换

    css的编码怎么转换?为什么要转换css文件编码?css的文件编码怎么设置?css的文件编码为什么要转换?今天我们就给大家详细介绍一下 CSS编码转换 CSS文件编码设置篇,CSS文件utf-8与gb2312互转换方法篇 查看CSS文件编码…

    编程技术 2025年3月29日
    100

发表回复

登录后才能评论