css动画/响应式布局:媒体查询/理想视口

153 阅读1分钟

css动画

@keyframes

animation: donghua 5s ease-in-out 0s 2 alternate; } /* 动画名字 持续时间 渐进溅出效果 延迟时间 执行的次数(infinenite无限循环) 播放方向(alternate偶数次向前播放,一开始为0次,0是偶数所以向前播放) */


视口标签

<!-- 适配移动端的时候必须要加上视口标签 -->
<!-- 视口viewport  //  width=device-width宽度等于设备宽度  // initial-scale=1.0初始化不缩放 -->
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>

响应式布局之媒体查询

@media screen

@media screen and (max-width:700px) and (min-width:500px) { div{ background-color: green; } } 500-700 包括500和700像素的时候