When dealing with situations where users are more likely to click a link rather than read it, a simple solution is to apply overflow: hidden
to the direct container, such as the li
elements within the list.
To further indicate that the link is truncated on the screen, you can also include text-overflow: ellipsis;
in the styling:
ul.link_list li {
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
ul.link_list {
padding: 20px;
}
<h4>Link List</h4>
<ul class="link_list">
<li><a href="https://www.example.com/kjhadfkjh/oiuwoijwrv/ljnsvkjns/oiwueroiuwe/kjnsdvkjn/llksuerlkulku/lkamsclkm/lkjaelrkjl">https://www.example.com/kjhadfkjh/oiuwoijwrv/ljnsvkjns/oiwueroiuwe/kjnsdvkjn/llksuerlkulku/lkamsclkm/lkjaelrkjl</a></li>
</ul>