Using CSS Clip with percentage

前端 未结 4 2099
予麋鹿
予麋鹿 2021-02-19 05:28

I\'m trying to display only the top half of an image and the bottom half of the same image in 2 separate divs.

I\'ve tried with the CSS property clip, but i

4条回答
  •  遇见更好的自我
    2021-02-19 05:58

    You could have the div as position: relative; and overflow: hidden; Have the image inside as position: absolute;

    And control how the image is displayed but setting a height to the div and adjust the top and bottom properties of the image

提交回复
热议问题