css中图片居中的设置

如题所述

background:.enter
bottom
no-repeat;前面是url路径
全部的位置代码如下:
background-position:
left;
代表背景图横向(x轴)靠左,纵向(y轴)居中。(9点钟位置)
background-position:
right;
代表背景图横向(x轴)靠右,纵向(y轴)居中。(3点钟位置)
background-position:
top;
代表背景图横向(x轴)居中,纵向(y轴)靠上。(12点钟位置)
background-position:
bottom;
代表背景图横向(x轴)居中,纵向(y轴)靠下。(6点钟位置)
background-position:
center;
代表背景图横向(x轴)居中,纵向(y轴)居中。(绝对居中)
background-position:
left
top;
代表背景图横向(x轴)靠左,纵向(y轴)靠上。(10点钟位置)
background-position:
left
bottom;
代表背景图横向(x轴)靠左,纵向(y轴)靠下。(7点钟位置)
background-position:
right
top;
代表背景图横向(x轴)靠右,纵向(y轴)靠上。(1点钟位置)
background-position:
right
bottom;
代表背景图横向(x轴)靠右,纵向(y轴)靠下。(5点钟位置)
温馨提示:答案为网友推荐,仅供参考
第1个回答  2020-09-10
用弹性盒子,上下左右全部居中。简单粗暴快速直接。

相关了解……

你可能感兴趣的内容

本站内容来自于网友发表,不代表本站立场,仅表示其个人看法,不对其真实性、正确性、有效性作任何的担保
相关事宜请发邮件给我们
© 非常风气网