<picture> with img-thumbnail class
See original GitHub issueI am trying to implement <picture> tag to selectively serve pictures; webp format for Chrome based browsers and jpeg fallback for other browsers. However using Bootstrap’s img-thumbnail class is not working properly, it creates handlebar like artifact on border sides.

Sample code:
<picture class="img-thumbnail img-fluid">
<source srcset="/path/to/image.webp" type="image/webp">
<img class="img-thumbnail img-fluid" src="/path/to/image.jpg" alt="">
</picture>
Bootstrap version: 4 beta
Issue Analytics
- State:
- Created 6 years ago
- Comments:9 (4 by maintainers)
Top Results From Across the Web
Images - Bootstrap
Images in Bootstrap are made responsive with .img-fluid . max-width: 100%; and height: auto; are applied to the image so that it scales...
Read more >Bootstrap Images - W3Schools
The .img-rounded class adds rounded corners to an image (IE8 does not support rounded corners): ... The .img-thumbnail class shapes the image to...
Read more >img-thumbnail - Bootstrap CSS class
Bootstrap CSS class img-thumbnail with source code and live preview. You can copy our examples and paste them into your project!
Read more >What is Image Thumbnail in Bootstrap 4 ? - GeeksforGeeks
It is created using the .img-thumbnail class. ... Image Thumbnails: In Bootstrap 4, the image thumbnail is a border surrounded by the image....
Read more >Bootstrap - Thumbnails - Tutorialspoint
Add an <a> tag with the class of .thumbnail around an image. · This adds four pixels of padding and a gray border....
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

I’ve just tested it. @t5k6 you are right, the way we setup images and figures don’t support
picture.This is fixed by
display: inline-block;thepictureelement. A possible solution is to follow what we do with thefigureelement with the class.figure.I’ll follow the same approach and send a PR.
Yeah, good idea—I think it’d be helpful to have a code example and snippet in the Image docs page.