I have a long text string that I want to auto-shorten using CSS with text-overflow: ellipsis
, but it's removing the underline from my link. Here is the code:
NORMAL
.link {
font-weight: bold;
cursor: pointer;
color: black;
text-decoration: underline;
text-underline-position: under;
}
.link:hover {
text-decoration: none;
}
<a class="link" href="#">AEEF8CDB5ADF2F28016F39E1FBFC237DAF98D402</a>
SHORTENED
.link {
font-weight: bold;
cursor: pointer;
color: black;
text-decoration: underline;
text-underline-position: under;
max-width: 100px;
display: inline-block;
text-overflow: ellipsis;
overflow: hidden;
}
.link:hover {
text-decoration: none;
}
<a class="link" href="#">AEEF8CDB5ADF2F28016F39E1FBFC237DAF98D402</a>
If anyone can help, I would appreciate it. Thank you!