Bağlantı vurgusunda madde işaretlerini genişletme

0

Soru

Vurgulu olmadan önce sözde öğeyi genişleten bir bağlantı kurmaya çalışıyorum.

.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>

Ancak geçiş oldukça garip ve noktalar alttan atlıyor gibi görünüyor. Nasıl düzleştirilir ve soldan genişlemiş gibi görünür?

Keman https://jsfiddle.net/1u0tzxfg/

Güncelleme

İşte biraz daha iyi bir geçiş:

.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>

css hyperlink pseudo-element
2021-11-12 09:00:39
1

En iyi cevabı

0

Sadece ekle: white-space: nowrap; to the.açık bağlantı::etiketten önce.

<style>
  .open-link::before {
    content: '•';
    position: relative;
    display: inline-block;
    width: 10px;
    transition: width .3s;
    margin-right: 10px;
    white-space: nowrap;
  }
  
  .open-link:hover::before {
    content: '• • •';
    width: 30px;
  }
</style>

<a class="open-link" href="#">Link</a>

2021-11-12 09:27:10

Diğer dillerde

Bu sayfa diğer dillerde

Русский
..................................................................................................................
Italiano
..................................................................................................................
Polski
..................................................................................................................
Română
..................................................................................................................
한국어
..................................................................................................................
हिन्दी
..................................................................................................................
Français
..................................................................................................................
Česk
..................................................................................................................
Português
..................................................................................................................
ไทย
..................................................................................................................
中文
..................................................................................................................
Español
..................................................................................................................
Slovenský
..................................................................................................................