Using CSS Clip with percentage
问题 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 it doesn't seem to support % as a unit. Is it just me? Do you have a solution for displaying only a half of an image? 回答1: Update (after 5+ years): The CSS clip property is now deprecated. Consider using clip-path instead (allowing for a non-JS solution), which allows you to specify shapes with percentages. Example: /* Bottom half of image *