Aqbeż għall-kontenut prinċipali Aqbeż għan-navigazzjoni tad-dokumenti
Check
in English

Rabta mġebbda

Agħmel kwalunkwe element HTML jew komponent Bootstrap ikklikkjabbli billi "tiġġebbed" link imdaħħla permezz ta' CSS.

Żid .stretched-linkma 'link biex tagħmel il- blokka li fiha tikklikkja permezz ta' ::afterpsewdo element. Fil-biċċa l-kbira tal-każijiet, dan ifisser li element position: relative;li fih rabta mal- .stretched-linkklassi jista' jiġi kklikkjat. Jekk jogħġbok innota kif taħdem is -CSSposition , .stretched-linkma tistax titħallat mal-biċċa l-kbira tal-elementi tat-tabella.

Il -karti għandhom position: relativeawtomatikament f'Bootstrap, għalhekk f'dan il-każ tista 'żżid il- .stretched-linkklassi b'mod sikur ma' link fil-karta mingħajr ebda tibdil HTML ieħor.

Links multipli u miri tal-vit mhumiex rakkomandati b'links stirati. Madankollu, xi positionstili z-indexjistgħu jgħinu jekk dan ikun meħtieġ.

Card image cap
Karta b'rabta mġebbda

Xi eżempju ta' test ta' malajr biex jibni fuq it-titlu tal-karta u jagħmel il-biċċa l-kbira tal-kontenut tal-karta.

Mur x'imkien
html
<div class="card" style="width: 18rem;">
  <img src="..." class="card-img-top" alt="...">
  <div class="card-body">
    <h5 class="card-title">Card with stretched link</h5>
    <p class="card-text">Some quick example text to build on the card title and make up the bulk of the card's content.</p>
    <a href="#" class="btn btn-primary stretched-link">Go somewhere</a>
  </div>
</div>

Il-biċċa l-kbira tal-komponenti tad-dwana m'għandhomx position: relativeawtomatikament, għalhekk irridu nżidu l- .position-relativehawn biex nipprevjenu li l-link tiġġebbed barra l-element ġenitur.

Generic placeholder image
Komponent tad-dwana b'rabta mġebbda

Dan huwa xi kontenut ta' placeholder għall-komponent tad-dwana. Huwa maħsub biex jimita kif ikun xi kontenut tad-dinja reali, u aħna qed nużawha hawn biex nagħtu lill-komponent daqsxejn ta 'korp u daqs.

Mur x'imkien
html
<div class="d-flex position-relative">
  <img src="..." class="flex-shrink-0 me-3" alt="...">
  <div>
    <h5 class="mt-0">Custom component with stretched link</h5>
    <p>This is some placeholder content for the custom component. It is intended to mimic what some real-world content would look like, and we're using it here to give the component a bit of body and size.</p>
    <a href="#" class="stretched-link">Go somewhere</a>
  </div>
</div>
Generic placeholder image
Kolonni b'rabta mġebbda

Eżempju ieħor ta' kontenut ta' placeholder għal dan il-komponent personalizzat ieħor. Huwa maħsub biex jimita kif ikun xi kontenut tad-dinja reali, u aħna qed nużawha hawn biex nagħtu lill-komponent daqsxejn ta 'korp u daqs.

Mur x'imkien
html
<div class="row g-0 bg-light position-relative">
  <div class="col-md-6 mb-md-0 p-md-4">
    <img src="..." class="w-100" alt="...">
  </div>
  <div class="col-md-6 p-4 ps-md-0">
    <h5 class="mt-0">Columns with stretched link</h5>
    <p>Another instance of placeholder content for this other custom component. It is intended to mimic what some real-world content would look like, and we're using it here to give the component a bit of body and size.</p>
    <a href="#" class="stretched-link">Go somewhere</a>
  </div>
</div>

L-identifikazzjoni tal-blokka li fiha

Jekk il-link imġebbda ma jidhirx li jaħdem, il- blokk li jkun fih probabbilment ikun il-kawża. Il-proprjetajiet CSS li ġejjin se jagħmlu element il-blokk li fih:

  • Valur positiongħajrstatic
  • A transformjew perspectivevalur għajrnone
  • Valur will-changeta' transformjewperspective
  • Valur filterminbarra nonejew will-changevalur ta' filter(jaħdem biss fuq Firefox)
Card image cap
Karta b'links stirati

Xi eżempju ta' test ta' malajr biex jibni fuq it-titlu tal-karta u jagħmel il-biċċa l-kbira tal-kontenut tal-karta.

Link imġebbda mhux se taħdem hawn, għaliex position: relativehija miżjuda mal-link

Din il-link imġebbda se tkun mifruxa biss fuq it- ptag, minħabba li tiġi applikata trasformazzjoni għaliha.

html
<div class="card" style="width: 18rem;">
  <img src="..." class="card-img-top" alt="...">
  <div class="card-body">
    <h5 class="card-title">Card with stretched links</h5>
    <p class="card-text">Some quick example text to build on the card title and make up the bulk of the card's content.</p>
    <p class="card-text">
      <a href="#" class="stretched-link text-danger" style="position: relative;">Stretched link will not work here, because <code>position: relative</code> is added to the link</a>
    </p>
    <p class="card-text bg-light" style="transform: rotate(0);">
      This <a href="#" class="text-warning stretched-link">stretched link</a> will only be spread over the <code>p</code>-tag, because a transform is applied to it.
    </p>
  </div>
</div>