
body { background-image: linear-gradient(to bottom, rgba(0,0,0, 0.1), rgba(0,0,0, 1)), url(img/bg.jpg); background-size: cover; background-repeat: no-repeat; background-position: center center; } 这样的 css3 可以把 background-image 分开写吗?
比如,覆盖 body 规则,同时又保留 linear-gradient
body.cover { background-image: url(img/other.jpg); /* 同时保留 linear-gradient(to bottom, rgba(0,0,0, 0.1), rgba(0,0,0, 1)) */ } 1 abelyao Apr 24, 2015 body.cover 的 background-image 属性会覆盖 body 的,所以 linear-gradient 部分应该也会没了吧 |
2 zythum Apr 24, 2015 对不起。不行。 |
3 iyangyuan Apr 24, 2015 via iPhone over的时候也加上渐变不就行了? |