Solution 1 :

:not(span) will be used to exlude

Hope this will be helpful for you

.Project {
    font-family: 'Lirma';
    }


.Project:hover :not(span) {
  cursor: default;
  text-decoration: underline;
}
<li class="Project" data-modal="myModal_1">

                    <span id="myBtn_1">
                        Lirma Type
                    </span>

                    <span id="year">
                        2019
                    </span>

                    <div class="Describtion">
                        <p>
                           Typedesign
                       </p>
                       <br>
                        <span class="PopUp">Images</span>

                        </div>
                     
                
                    <div id="myModal_1" class="modal">

                    <div class="modal-content">

                    <div id="demo" class="carousel slide" data-ride="carousel">
                          
                          <!-- The slideshow -->
                          <div class="carousel-inner">

                            <div class="carousel-item active">    
                              <img class="Image" data-src="Images/Lirma/type.jpg" alt="img" width="100%">
                            </div>
                          </div>

                   </div>
                </div>
            </div>
        </li>

Problem :

I have a portfolio-page, where I have tried that’s placed in

  • tag, within this, there’s a span-tag called .Popup to view images of the project.
  • I wish that the project will be underlined, when hovered, but at this point in time the span-tag is also hovered. which I want to avoid.

    I have tried targetting the anchor like: ul li .Describtion . .PopUp

    I have tried embedding the Span. Popup in a but still, with no results.

    Can someone please tell provide insights? thank you so much.

    .Project {
        font-family: 'Lirma';
        }
    
    
    .Project:hover  {
      cursor: default;
      text-decoration: underline;
    }
            <li class="Project" data-modal="myModal_1">
    
                        <span id="myBtn_1">
                            Lirma Type
                        </span>
    
                        <span id="year">
                            2019
                        </span>
    
                        <div class="Describtion">
                            <p>
                               Typedesign
                           </p>
                           <br>
                            <span class="PopUp">Images</span>
    
                            </div>
                         
                    
                        <div id="myModal_1" class="modal">
    
                        <div class="modal-content">
    
                        <div id="demo" class="carousel slide" data-ride="carousel">
                              
                              <!-- The slideshow -->
                              <div class="carousel-inner">
    
                                <div class="carousel-item active">    
                                  <img class="Image" data-src="Images/Lirma/type.jpg" alt="img" width="100%">
                                </div>
                              </div>
    
                       </div>
                    </div>
                </div>
            </li>

    span text-decoration

    Comments

    Comment posted by Temani Afif

    display: inline-block; ot the span

    Comment posted by Carina Thornval

    Unfortunately, this gave no result. Do you have any other idea?

    Comment posted by Faizan Sadiq

    check text decoration removed from

    Comment posted by Faizan Sadiq

    i think you are looking for to remove underline from

    Comment posted by stackoverflow.com/questions/13856330/…

    like they do in this thread?

    Comment posted by Faizan Sadiq

    Yes you can target specific element like this

    By