lol轮播图

129 阅读1分钟
lol /* 清除网页的默认间距 */ *{ margin: 0; padding: 0; } /* 通过class找到对应的标签 .+class名称 */ .banner{ width: 820px; height: 380px; background-color: blue; } .banner_img{ width: 820px; height: 340px; background-color: red; /* 超出隐藏属性 */ overflow: hidden; } .banner_img ul{ width: 4100px; /* 过渡动画 */ transition: all 0.2s; } .banner_img li{ width: 820px; height: 340px; float: left; /* 清除li前面的列表符号 */ list-style: none; } .banner_nav{ width: 820px; height: 40px; background-color: green; } /* 后代选择器,先找容器,再找内部标签 */ .banner_nav li{ width: 164px; height: 40px; /* 由于li在网页中属于块元素,独立成行 */ /* 浮动属性,让原本上下排列的li,并排 */ float: left; /* 清除li前面的列表符号 */ list-style: none; /* 字号是14px */ font-size: 12px; /* 文本的水平居中 */ text-align: center; /* 文本垂直居中 单行文本垂直居中,当行高等于当前容器的高度时内部文字垂直居中 */ line-height:40px; /* 设置背景颜色 */ background-color: #e3e2e2; } .banner_nav .active{ background-color: white; color: #ab8e66; /* 边框会增加元素的实际占位 */ border-bottom: 2px solid #cea861; height: 38px; }