![]() |
In this article, we will see how to make parent div activate styling of child div for hover and active. We can do this by using Pseudo-classes like hover and active. Approaches to make parent div activate styling of child div for hover and active
Method 1: Using Pure CSSPseudo-classPseudo-classes are keywords used in CSS to define special states of HTML elements based on user interactions or element states without the need for additional classes or JavaScript.
Example: In this example, we will use CSS pseudo-selectors to make parent div activate styling of child div for hover and active. HTML
Output: Method 2: Using CSS and JavaScriptExample: In this article, we will use CSS and JavaScript to make parent div activate styling of child div for hover and active. HTML
Output: |
Reffered: https://www.geeksforgeeks.org
CSS |
Type: | Geek |
Category: | Coding |
Sub Category: | Tutorial |
Uploaded by: | Admin |
Views: | 12 |