Python学习-day52-bootstrap

起步

导入:

<link rel="stylesheet" href="bootstrap-3.3.7-dist/css/bootstrap.css">
<script src="js/jquery-3.3.1.js"></script>
<script src="bootstrap-3.3.7-dist/js/bootstrap.js"></script>

屏幕适配

<Meta name="viewport"
      content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">

响应式布局

.wrapper {
    height: 60px;
    background-color: yellow;
}
/*if (dw<600) {}*/
@media (max-width: 600px)  {
    .wrapper {
        width: auto;
    }
}
​
/*if (dw>900) {}*/
@media (min-width: 900px)  {
    .wrapper {
        width: 850px;
    }
}
/*if (dw>600 and dw < 900) {}*/
@media (min-width: 600px) and (max-width: 900px)  {
    .wrapper {
        width: 600px;
    }
}
​
/*if (dw>1000) {}*/
@media (min-width: 1000px)  {
    .wrapper {
        width: 990px;
    }
}
/*if (dw>1200) {}*/
@media (min-width: 1200px)  {
    .wrapper {
        width: 1200px;
    }
}

 

 

栅格系统

'''
bs将父级等分12等分提供给子级使用
​
父级认用padding: 15px, 用.row的margin: -15px来抵消
​
四个屏幕尺寸:
.col-xs- .col-sm- .col-md- .col-lg-
偏移
.col-xs-offset- .col-sm-offset- .col-md-offset- .col-lg-offset-
''' 

swiper

<link rel="stylesheet" href="swiper/swiper.css">
​
<body>
    <!--swiper的轮播图结构,可以取官网案例复制-->
    <div class="swiper-container">
        ...
    </div>
</body>
​
<script src="swiper/swiper.js"></script>
<script>
    // 一定要声明Swiper对象
    new Swiper('.swiper-container', {
        // 所需参数key:value
    });
</script>

 

 

相关文章

Bootstrip HTML 查询搜索常用格式模版 &lt;form class=&...
如何在按钮上加红色数字 您可以使用Bootstrap的badge组件来在...
要让两个按钮左右排列,你可以使用 Bootstrap 的网格系统将它...
是的,可以将status设置为布尔类型,这样可以在前端使用复选...
前端工程师一般用的是Bootstrap的框架而不是样式,样式一般自...
起步导入:<linkrel="stylesheet"href="b...