使用百分比而不是文字来定位图像是否有优势?例如,在CSS文件中:
#example_1 {
background: url();
background-position: 50% 50%;
}
#example_2 {
background: url();
background-position: center;
}虽然两者都有效地将图像居中。会有更“正确”的情况出现吗?
发布于 2017-07-15 15:42:18
center center和50% 50%之间没有区别。background-position: center center;是最流行的解决方案。
https://stackoverflow.com/questions/45115770
复制相似问题