I have a div
with multiple links, like this:
Whereinhover
ofdiv
(wrapper)onlymadetheunderlineofboldtext
(title)butdoinghover
intags
underlineditstaganddidnotunderlineboldtext
.IleavebelowaschematicofhowitisdoneandthecodethatIhavesofarforbetterunderstanding:
Whatisgrayisthewrapper,inredtheboldtext
thatIwantunderlined
oncethecursorisinthewrapper,blueisthediv(.tags)andorangearethetagsthatwhenthecursortounderlinethem.Ialreadyhavethewrapper%wizard%workingbutIamnotabletodothe%wrapperpart,thetitlealwaysappears%wrapper%.
.wrapper {
position: relative;
border: 1px solid black;
height: 35px;
width: 50%;
padding: 1% 0 0 1%;
margin: auto;
cursor: pointer;
}
.wrapper:not(.tags):hover {
text-decoration: underline;
}
.wrapper a {
color: black;
text-decoration: none;
}
.tags {
position: absolute;
top: 26%;
right: 2%;
}
.tags a:hover .wrapper {
text-decoration: none !important;
}
<div class="wrapper">
<a href="#">
<b>Title</b>
<div class="tags">
<a href="#">Tag1</a>
<a href="#">Tag2</a>
<a href="#">Tag3</a>
</div>
</a>
<div style="clear: both;"></div>
</div>