开发者

css background image only working in chrome and safari?

开发者 https://www.devze.com 2023-02-13 18:18 出处:网络
hey guys, i cannot find an answer. body { background: #fff url(\'images/years.png\') no-repeat top 85%; }

hey guys, i cannot find an answer.

body {
    background: #fff url('images/years.png') no-repeat top 85%;
}

why is this background image 开发者_运维技巧working in chrome and safari but not in firefox and ie? any idea what could cause that behaviour?

It seems like background-position is causing the bug! top 85% work in chrome and safari, but do not in IE and firefox!


Your background-position isn't logical. You should write 85% top (X then Y). I know 'top' can't define a X position and Chrome/Safari probably figure this out, but Firefox/IE don't understand it.


Apparently they don't like the compact syntax. Use:

background-color: #fff;
background-image: url('images/years.png');
background-position: top 85%;
0

精彩评论

暂无评论...
验证码 换一张
取 消