We made top part of the image rounded by using class, rounded-t-lg. To achieve this, we add class, object-cover. We want to maintain the original size of the image but also want it to fit into the container.
#Css hover effects to make card jump full#
It will occupy the full width of the container due to class w-full. We then added an image file.įor the image to fit perfectly into the container, we added a height class h-60 which makes the image occupy a height of 240px in the container. Use card components to easily show blog posts, merchandise, functions,įrom the snippet above, we created a containment as we had done previously. We will add an image of the product at the top of the card, and other information following below it as shown below: We are creating an advertisement card for a product. The card will be next to the first and second card. Lastly, we added a hover effect which changes the background color and the text to green. The padding is used to increase the clickable space of each item. We have added a padding of 12px all round to add space between the menu items with class p-3. flex class in each tag is used to make the icons and the text vertically aligned. We have also added SVG icons to our menu items. tags have been used to create the links for our menu items. We have given it a header Menu Items using, as shown above.
#Css hover effects to make card jump code#
The code for the menu card is shown below: The card contains links (menu items) which the user can interact with. Building a menu component cardĪs mentioned earlier, we have created a menu component in form of card. I will only explain the classes that we have not used above in the subsequent cards. We have used most of the classes that I have explained above.