Link a inzawm khawm
CSS hmanga nested link “stretch”-in HTML element emaw Bootstrap component emaw eng pawh click theih turin siam rawh.
.stretched-link
Link pakhatah dah la , a containing block::after
chu pseudo element hmanga click theih turin a siam ang. A tam zawkah chuan class position: relative;
nena link awmna element nei chu click theih a ni tihna a ni. .stretched-link
Khawngaihin hre reng ang che given how CSS position
works , .stretched-link
table element tam zawk nen mix theih a ni lo.
Card te position: relative
hian Bootstrap ah default in an nei a, chuvangin hetiang a nih chuan .stretched-link
HTML tihdanglam ngai lovin card chhunga link pakhatah class chu him takin i dah thei ang.
Link tam tak leh tap target te hi stretched link te nen chuan a tha lo. Mahse, thenkhat position
leh z-index
style te hian hei hi a tul a nih chuan a pui thei a ni.
Card ah chuan link a inzawm a
Card title-a siam tur leh card-a thu awm tam zawk siam turin quick example text thenkhat.
Khawi emaw laiah kal rawh<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>
Custom component tam zawk hian default-in an nei lo va , chuvangin parent element pawn lama link a stretch loh nan here hi position: relative
kan add a ngai a ni..position-relative
Custom component a ni a, a link pawh a stretched bawk
Hei hi custom component atana placeholder content thenkhat a ni. Khawvel tak tak content thenkhat chu eng ang nge a nih ang tih ang chia siam tum a ni a, hetah hian component taksa leh size tlem tal pek nan kan hmang a ni.
Khawi emaw laiah kal rawh<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>
Column te chu stretched link a ni
He custom component dang atan hian placeholder content instance dang. Khawvel tak tak content thenkhat chu eng ang nge a nih ang tih ang chia siam tum a ni a, hetah hian component taksa leh size tlem tal pek nan kan hmang a ni.
Khawi emaw laiah kal rawh<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>
A chhunga block awmte hriatchhuah
Stretched link hian hna a thawk lo ang tih a hriat chuan containing block hi a chhan a ni ngei ang. A hnuaia CSS property te hian element pakhat chu containing block a siam ang:
- A
position
value dang tih loh chustatic
- A
transform
emawperspective
value dang emaw tih loh chunone
- A
will-change
value oftransform
orperspective
filter
Value dang emaw value dangnone
emaw (Firefox-ah chauh a thawk)will-change
filter
Card ah chuan links stretched a awm
Card title-a siam tur leh card-a thu awm tam zawk siam turin quick example text thenkhat.
He stretched link hi -tag ah chauh a darh ang p
, a chhan chu a chungah transform a apply a ni.
<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>