Home >Web Front-end >JS Tutorial >Alternate color and black and white in each part of the photo_Image special effects
Let’s take a look at the code first
Now let’s analyze the usage of background-position: At the beginning of the A element, the background position is set to background-position:500px 500px, and its size is only 100px*100px, so all the backgrounds under the A tag exceed The visible range cannot be displayed, and the black and white photo we see at the beginning is the background image of UL. Then when the mouse moves to the A element, the moving size of the background is set for each A element according to its position, thus forming the alternating black and white picture effect above.