This article describes how to realize the touch-up floating of the product cover image in css floating. If you don’t know how to realize the touch-up floating of the product cover image in css, let’s take a look at this article! ,
Today when writing CSS, I need to realize: when the mouse hovers over the hyperlink composed of pictures and introductions, the durian will float upward.
# #1. Mouse hover - add pseudo class selector:hover When the mouse is hovering to change the element style, the first thing that comes to mind is to use a pseudo class selector :hover. The problem I'm having while writing this is that hovering over the hyperlink only makes the image part move, but not the text introduction part. Therefore, when writing a pseudo-class, you cannot write #id a:hover, but should be followed by the class selector of the picture part p, that is, #id a:hover .class {}. This allows you to hover the hyperlink and only move the image.
2. Image movement - change the margin/padding of the elementrelated suggestion:
The above is the detailed content of Detailed description of the method of realizing product cover image to float upward using css. For more information, please follow other related articles on the PHP Chinese website!