# Include hover in class?

**URL:** <https://community.weweb.io/t/include-hover-in-class/7401>\
**Category:** How do I?\
**Tags:** design\
**Created:** [March 4, 2024, 10:28am UTC](https://community.weweb.io/t/include-hover-in-class/7401 "2024-03-04T10:28:29Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![unlustucru](https://avatars.discourse-cdn.com/v4/letter/u/e36b37/32.png) [@unlustucru](https://community.weweb.io/u/unlustucru)\
**Post date:** [March 4, 2024, 10:28am UTC](https://community.weweb.io/t/include-hover-in-class/7401/1 "2024-03-04T10:28:29Z")

</div>

How do I include the :hover styling parameters in a class, so that I don’t have to re-implement the styling on each element?

Tried to create a new class from an element that already had :hover but it didn’t get included apparently.

My current, temporary solution was to add a “class” field value to the build-in Weweb class feature, and then add custom CSS (.myClass:hover {}).

---

<div class="post-metadata">

**Author:** ![luka](https://sea2.discourse-cdn.com/flex016/user_avatar/community.weweb.io/luka/32/1571_2.png) [@luka](https://community.weweb.io/u/luka)\
**Post date:** [March 5, 2024, 8:48am UTC](https://community.weweb.io/t/include-hover-in-class/7401/2 "2024-03-05T08:48:59Z")

</div>

For now, you need another class to manage the hover state, however we’re in the process of making some changes under the hood that will allow us to implement those pseudoselectors

---

<div class="post-metadata">

**Author:** ![isabellarossi593](https://sea2.discourse-cdn.com/flex016/user_avatar/community.weweb.io/isabellarossi593/32/8001_2.png) [@isabellarossi593](https://community.weweb.io/u/isabellarossi593)\
**Post date:** [March 7, 2024, 8:27am UTC](https://community.weweb.io/t/include-hover-in-class/7401/3 "2024-03-07T08:27:51Z")

</div>

Give a class to those html elements on which you want hover effect. now target that class name in css and apply hover effect on those class. by this when you hover over any element then the hover styles will be applied to those and you have don’t repeat the styles for each element.
