CSS background-size cover and background-position

后端 未结 3 1125
盖世英雄少女心
盖世英雄少女心 2020-12-13 18:32

HTML:



        
相关标签:
3条回答
  • 2020-12-13 18:39

    You can use:

    background-position: center bottom;
    
    0 讨论(0)
  • 2020-12-13 18:39

    Just to be clear, background-position percentages are calculated against BOTH the image and the background container. So, background-position: 25% 25%; would find the 25% point for both X and Y on the background container and align the image's 25%,25% point on top of that point.

    0 讨论(0)
  • 2020-12-13 18:41

    If the bottom is more important: background-position: bottom;

    background-position also allows percentage values: 0% 0%; by default.

    The first value is the horizontal position and the second value is the vertical. The top left corner is 0% 0%. The right bottom corner is 100% 100%. If you only specify one value, the other value will be 50%.

    You should try background-position: 0% -10%;

    0 讨论(0)
提交回复
热议问题