.addTaskP, .fa-solid {
display: inline;
cursor: pointer;
font-size: 17px;
}
.fa-solid{
color: rgba(251, 49, 49, 0.774);
}
.fa-solid:hover{
background-color: rgba(251, 49, 49, 0.774);
color: white;
border: 1px solid transparent;
border-radius: 100%;
}
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.1.1/css/all.min.css" integrity="sha512-KfkfwYDsLkIlwQp6LFnl8zNdLGxu9YAA1QvwINks4PhcElQSvqcyVLLD9aMhXd13uQjoXtEKNosOWaZqXgel0g==" crossorigin="anonymous" referrerpolicy="no-referrer" />
<div class="date">
<h2>Today <span id="date"> Thursday April 21</span></h2>
<i class="fa-solid fa-plus"></i>
<p class="addTaskP">Add Task</p>
</div>
I have a hover function over the icon but I want the same function to activate on the p tag when I hover on the P tag.