in English

ખેંચાયેલી કડી

CSS દ્વારા નેસ્ટેડ લિંકને "સ્ટ્રેચિંગ" કરીને કોઈપણ HTML ઘટક અથવા બુટસ્ટ્રેપ ઘટકને ક્લિક કરવા યોગ્ય બનાવો.

સ્યુડો એલિમેન્ટ દ્વારા તેના સમાવિષ્ટ બ્લોકને.stretched-link ક્લિક કરવા યોગ્ય બનાવવા માટે લિંકમાં ઉમેરો . મોટા ભાગના કિસ્સાઓમાં, આનો અર્થ એ થાય છે કે વર્ગ સાથેની લિંક ધરાવતી એક ઘટક ક્લિક કરવા યોગ્ય છે.::afterposition: relative;.stretched-link

બૂટસ્ટ્રેપમાં કાર્ડ્સ position: relativeડિફૉલ્ટ રૂપે હોય છે, તેથી આ કિસ્સામાં તમે .stretched-linkકોઈપણ અન્ય HTML ફેરફારો વિના કાર્ડની લિંકમાં વર્ગને સુરક્ષિત રીતે ઉમેરી શકો છો.

ખેંચાયેલી લિંક્સ સાથે બહુવિધ લિંક્સ અને ટેપ લક્ષ્યોની ભલામણ કરવામાં આવતી નથી. જો કે, આ જરૂરી હોવા જોઈએ તો કેટલીક positionઅને શૈલીઓ મદદ કરી શકે છે.z-index

Card image cap
ખેંચાયેલ લિંક સાથે કાર્ડ

કાર્ડના શીર્ષક પર બિલ્ડ કરવા અને કાર્ડની મોટાભાગની સામગ્રી બનાવવા માટે કેટલાક ઝડપી ઉદાહરણ ટેક્સ્ટ.

ક્યાંક જાઓ
<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

Generic placeholder image
ખેંચાયેલ લિંક સાથે મીડિયા

ક્રાસ સીટ અમેટ નિભ લિબેરો, ગ્રેવિડા નુલ્લામાં. નુલ્લા વેલ મેટસ સેલેરિસ્ક એન્ટે સોલિસીટ્યુડિન. ક્રાસ પ્યુરસ ઓડિયો, વેસ્ટિબુલમ ઇન વલ્પુટેટ એટ, ટેમ્પસ વિવેરા ટર્પિસ. Fusce condimentum nunc ac nisi vulputate fringilla. ડોનેક લેસીનિયા કોંગ્યુ ફેલિસ ઇન ફૌસીબસ.

ક્યાંક જાઓ
<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>Cras sit amet nibh libero, in gravida nulla. Nulla vel metus scelerisque ante sollicitudin. Cras purus odio, vestibulum in vulputate at, tempus viverra turpis. Fusce condimentum nunc ac nisi vulputate fringilla. Donec lacinia congue felis in faucibus.</p>
    <a href="#" class="stretched-link">Go somewhere</a>
  </div>
</div>

કૉલમ position: relativeડિફૉલ્ટ રૂપે હોય છે, તેથી ક્લિક કરી શકાય તેવી કૉલમને ફક્ત .stretched-linkલિંક પરના વર્ગની જરૂર હોય છે. જો કે, એક લિંકને સમગ્ર પર ખેંચવા માટે કૉલમ અને પંક્તિ પર .rowજરૂરી છે..position-static.position-relative

Generic placeholder image
ખેંચાયેલી લિંક સાથે કૉલમ

ક્રાસ સીટ અમેટ નિભ લિબેરો, ગ્રેવિડા નુલ્લામાં. નુલ્લા વેલ મેટસ સેલેરિસ્ક એન્ટે સોલિસીટ્યુડિન. ક્રાસ પ્યુરસ ઓડિયો, વેસ્ટિબુલમ ઇન વલ્પુટેટ એટ, ટેમ્પસ વિવેરા ટર્પિસ. Fusce condimentum nunc ac nisi vulputate fringilla. ડોનેક લેસીનિયા કોંગ્યુ ફેલિસ ઇન ફૌસીબસ.

ક્યાંક જાઓ
<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>Cras sit amet nibh libero, in gravida nulla. Nulla vel metus scelerisque ante sollicitudin. Cras purus odio, vestibulum in vulputate at, tempus viverra turpis. Fusce condimentum nunc ac nisi vulputate fringilla. Donec lacinia congue felis in faucibus.</p>
    <a href="#" class="stretched-link">Go somewhere</a>
  </div>
</div>

સમાવિષ્ટ બ્લોકની ઓળખ

જો ખેંચાયેલી લિંક કામ કરતી નથી લાગતી, તો સમાવિષ્ટ બ્લોક કદાચ કારણ હશે. નીચેની CSS પ્રોપર્ટીઝ એક ઘટકને સમાવિષ્ટ બ્લોક બનાવશે:

  • કરતાં positionઅન્ય મૂલ્યstatic
  • A transformઅથવા perspectiveકરતાં અન્ય મૂલ્યnone
  • અથવા નું will-changeમૂલ્યtransformperspective
  • filterકરતાં અન્ય મૂલ્ય noneઅથવા will-changeમૂલ્ય filter(ફક્ત ફાયરફોક્સ પર કામ કરે છે )
Card image cap
ખેંચાયેલી લિંક્સ સાથે કાર્ડ

કાર્ડના શીર્ષક પર બિલ્ડ કરવા અને કાર્ડની મોટાભાગની સામગ્રી બનાવવા માટે કેટલાક ઝડપી ઉદાહરણ ટેક્સ્ટ.

સ્ટ્રેચ્ડ લિંક અહીં કામ કરશે નહીં, કારણ કે position: relativeલિંકમાં ઉમેરવામાં આવી છે

ખેંચાયેલી લિંક માત્ર -ટેગ પર જ ફેલાયેલી હશે p, કારણ કે તેના પર એક રૂપાંતરણ લાગુ કરવામાં આવ્યું છે.

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