لینکی درێژکراوە
هەر توخمێکی HTML یان پێکهاتەی Bootstrap بکە بە "کشانی" بەستەرێکی هێلانەکراو لە ڕێگەی CSS.
Add .stretched-link to a link to make its containing block clickable via a ::after pseudo element. In most cases, this means that an element with position: relative; that contains a link with the .stretched-link class is clickable. Please note given how CSS position works, .stretched-link cannot be mixed with most table elements.
Cards have position: relative by default in Bootstrap, so in this case you can safely add the .stretched-link class to a link in the card without any other HTML changes.
Multiple links and tap targets are not recommended with stretched links. However, some position and z-index styles can help should this be required.
Card with stretched link
Some quick example text to build on the card title and make up the bulk of the card's content.
Go somewhere<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>
ئۆبجێکتی میدیا position: relativeبە شێوەی دیفۆڵت نییە، بۆیە پێویستە .position-relativeلێرە زیاد بکەین بۆ ئەوەی ڕێگری لە درێژبوونەوەی بەستەرەکە بکرێت لە دەرەوەی ئۆبجێکتی میدیا.
میدیا بە لینکی کشاوە
ئەمە هەندێک ناوەڕۆکی شوێنگرەوەیە بۆ ئۆبجێکتی میدیا. مەبەست لێی تەقلیدکردنی ئەوەیە کە هەندێک ناوەڕۆکی جیهانی ڕاستەقینە چۆن دەبن، ئێمە لێرەدا بەکاری دەهێنین بۆ ئەوەی کەمێک جەستە و قەبارە بە پێکهاتەکە بدەین.
بڕۆ شوێنێک<div class="media position-relative">
<img src="..." class="mr-3" alt="...">
<div class="media-body">
<h5 class="mt-0">Media with stretched link</h5>
<p>This is some placeholder content for the media object. 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>
ستوونەکان position: relativeبە شێوازی پێشوەختەن، بۆیە ستوونە کلیککراوەکان تەنها پێویستیان بە .stretched-linkپۆلەکە هەیە لەسەر بەستەرێک. بەڵام درێژکردنەوەی بەستەرێک بەسەر تەواوییەکدا .rowپێویستی .position-staticبە لەسەر ستوونەکە و .position-relativeلەسەر ڕیزەکە هەیە.
ستوونەکان بە بەستەری کشاوە
نموونەیەکی تری ناوەڕۆکی شوێنگرەوە بۆ ئەم پێکهاتە تایبەتەی تر. مەبەست لێی تەقلیدکردنی ئەوەیە کە هەندێک ناوەڕۆکی جیهانی ڕاستەقینە چۆن دەبن، ئێمە لێرەدا بەکاری دەهێنین بۆ ئەوەی کەمێک جەستە و قەبارە بە پێکهاتەکە بدەین.
بڕۆ شوێنێک<div class="row no-gutters 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 position-static p-4 pl-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>
ناسینەوەی بلۆکی تێدایە
ئەگەر پێدەچێت بەستەری کشاو کار نەکات، ئەوا بە ئەگەرێکی زۆرەوە بلۆکی تێدایە هۆکارەکە دەبێت. ئەم تایبەتمەندیانەی خوارەوەی CSS توخمێک دەکەنە بلۆکی تێدایە:
positionبەهایەک جگە لە ...static- A
transformیانperspectiveبەهایەکی تر جگە لەnone will-changeبەهایەک لەtransformیانperspectivefilterبەهایەک جگە لە یانnoneبەهایەکیwill-change(filterتەنها لەسەر فایەرفۆکس کاردەکات)
کارتێک بە لینکی کشاوە
هەندێک دەقی نموونەی خێرا بۆ بنیاتنانی لەسەر ناونیشانی کارتەکە و پێکهێنانی بەشێکی زۆری ناوەڕۆکی کارتەکە.
لینکی کشاو لێرەدا کار ناکات، چونکە position: relativeزیاد کراوە بۆ بەستەرەکە
ئەم بەستەرە کشاوە تەنها بەسەر p-tagدا بڵاودەبێتەوە، چونکە گۆڕانکارییەک بۆی جێبەجێ دەکرێت.
<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>