ষ্ট্ৰেচড লিংক
CSS ৰ যোগেদি এটা নেষ্টেড সংযোগ “stretching” কৰি যিকোনো HTML উপাদান বা Bootstrap উপাদান ক্লিকযোগ্য কৰক।
.stretched-linkএটা লিংকত যোগ কৰক যাতে ইয়াৰ ধাৰণকাৰী ব্লকটো::after এটা ছ্যুডো উপাদানৰ জৰিয়তে ক্লিক কৰিব পৰা যায় । বেছিভাগ ক্ষেত্ৰতে, ইয়াৰ অৰ্থ হ'ল শ্ৰেণীটোৰ position: relative;সৈতে এটা লিংক থকা এটা উপাদান .stretched-linkক্লিকযোগ্য। অনুগ্ৰহ কৰি মন কৰক যে CSS কেনেকৈ positionকাম কৰে , .stretched-linkবেছিভাগ টেবুল উপাদানৰ সৈতে মিহলি কৰিব নোৱাৰি।
কাৰ্ডসমূহৰ position: relativeঅবিকল্পিতভাৱে বুটষ্ট্ৰেপত থাকে, গতিকে এই ক্ষেত্ৰত আপুনি .stretched-linkশ্ৰেণীটোক কাৰ্ডত এটা সংযোগত সুৰক্ষিতভাৱে যোগ কৰিব পাৰিব অন্য কোনো HTML পৰিবৰ্তন নোহোৱাকৈ ।
ষ্ট্ৰেচড লিংকৰ সৈতে একাধিক লিংক আৰু টেপ টাৰ্গেট উপদেশিত নহয়। কিন্তু ইয়াৰ প্ৰয়োজন হ’লে কিছুমান positionআৰু z-indexশৈলীয়ে সহায় কৰিব পাৰে।
ষ্ট্ৰেচড লিংকৰ সৈতে কাৰ্ড
কাৰ্ডৰ শিৰোনামৰ ওপৰত নিৰ্মাণ কৰিবলৈ আৰু কাৰ্ডৰ বিষয়বস্তুৰ ডাঙৰ অংশ গঠন কৰিবলৈ কিছুমান দ্ৰুত উদাহৰণ লিখনী।
ক’ৰবালৈ যাওক<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="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>
টানি লোৱা লিংক থকা স্তম্ভ
এই অন্য স্বনিৰ্বাচিত উপাদানৰ বাবে স্থানধাৰী বিষয়বস্তুৰ অন্য এটা উদাহৰণ। ইয়াৰ উদ্দেশ্য হৈছে কিছুমান বাস্তৱ জগতৰ বিষয়বস্তু কেনেকুৱা হ'ব তাক অনুকৰণ কৰা, আৰু আমি ইয়াত ইয়াক উপাদানটোক অলপ শৰীৰ আৰু আকাৰ দিবলৈ ব্যৱহাৰ কৰিছো।
ক’ৰবালৈ যাওক<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>
ধাৰণকাৰী ব্লক চিনাক্ত কৰা
যদি ষ্ট্ৰেচ কৰা লিংকটোৱে কাম কৰা যেন নালাগে, তেন্তে কণ্টেইনিং ব্লকটোৱেই সম্ভৱতঃ কাৰণ হ’ব। নিম্নলিখিত CSS বৈশিষ্ট্যসমূহে এটা উপাদানক ধাৰণকাৰী ব্লক কৰি তুলিব:
- ৰ বাহিৰে অন্য এটা
positionমানstatic - A
transformবাperspectiveঅন্য মানnone - বা ৰ এটা
will-changeমানtransformperspective - A
filtervalue other thannoneor awill-changevalue offilter(only works on Firefox)
Card with stretched links
Some quick example text to build on the card title and make up the bulk of the card's content.
Stretched link will not work here, because position: relative is added to the link
This stretched link will only be spread over the p-tag, because a transform is applied to it.
<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>