Snažím se, aby odkaz, který rozšiřuje o pseudo-element , než na visu.
.open-link::before {
content: '•';
position: relative;
display: inline-block;
width: 10px;
transition: width .3s;
margin-right: 10px;
}
.open-link:hover::before {
content: '• • •';
width: 30px;
}
<a class="open-link" href="#">Link</a>
Ale přechod je spíše divné a vypadá to, že tečky skočit ze dna. Jak hladké je a aby to vypadalo, jako by se rozšířit od levého?
Housle https://jsfiddle.net/1u0tzxfg/
AKTUALIZACE
Tady je trochu lepší přechod:
.open-link {
display: flex;
align-items: center;
text-decoration: none;
}
.open-link::before {
content: '• • •';
overflow: hidden;
width: 10px;
position: relative;
display: inline-block;
transition: all 0.3s ease;
margin-right: 10px;
white-space: nowrap;
}
.open-link:hover::before {
width: 50px;
}
<a class="open-link" href="#">Link</a>