同样的设置,上面的代码color及text-decoration不生效,只有单独设置.tb-promo a{color: text-decoration}才能实现效果
``` <style>
* {
padding: 0;
margin: 0;
}
.tb-promo {
position: relative;
width: 520px;
height: 280px;
top: 100px;
left: 50%;
margin-left: -260px;
}
.tb-promo img {
width: 520px;
height: 280px;
}
.tb-promo a {
color: #fff;
text-decoration: none;
}
.prev,
.next {
position: absolute;
top: 50%;
width: 20px;
height: 30px;
margin-top: -15px;
background-color: rgba(0, 0, 0, 0.3);
text-align: center;
line-height: 30px;
}
.prev {
left: 0;
border-radius: 0 15px 15px 0;
}
.next {
right: 0;
border-radius: 15px 0 0 15px;
}
style>
```css
<style>
* {
margin: 0;
padding: 0;
}
.tb-promo {
position: relative;
width: 520px;
height: 280px;
background-color: pink;
margin: 100px auto;
}
.tb-promo img {
width: 520px;
height: 280px;
}
.prev,
.next {
position: absolute;
top: 50%;
margin-top: -15px;
width: 20px;
height: 30px;
background: rgba(0, 0, 0, .3);
text-align: center;
line-height: 30px;
color: #fff;
text-decoration: none;
}
.prev {
left: 0;
border-top-right-radius: 15px;
border-bottom-right-radius: 15px;
}
.next {
right: 0;
border-top-left-radius: 15px;
border-bottom-left-radius: 15px;
}
style>
可以看下css参考手册中的
css Properties text-decoration-color