Why are Bootstrap 4 images using src data rather than src for image tags?

In the demo code below it uses data-src, but not img src. How is the image applied? Does javascript change this somehow?

http://v4-alpha.getbootstrap.com/components/card/

 <div class="card">
      <img class="card-img-top" data-src="..." alt="Card image cap">
      <div class="card-block">
        <h4 class="card-title">Card title</h4>
        <p class="card-text">Some quick example text to build on the card title and make up the bulk of the card content.</p>
        <a href="#" class="btn btn-primary">Button</a>
      </div>
    </div>
+4
source share
1 answer

The Bootstrap 4 documentation uses the holder.js file, see http://imsky.imtqy.com/holder/

Also see: https://github.com/imsky/holder#usage

Include the holder.js file in your HTML:

Holder then processes all the images using a specific src attribute, like this one:

The above tag will appear as a placeholder 300 pixels wide and 200 pixels wide.

404, data-src src.

http://v4-alpha.getbootstrap.com/assets/js/docs.min.js

+5

Source: https://habr.com/ru/post/1627079/


All Articles