question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

<picture> with img-thumbnail class

See original GitHub issue

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

image

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:closed
  • Created 6 years ago
  • Comments:9 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
andresgalantecommented, Sep 30, 2017

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; the picture element. A possible solution is to follow what we do with the figure element with the class .figure.

I’ll follow the same approach and send a PR.

0reactions
mdocommented, Oct 3, 2017

@mdo There is nothing wrong with the way we handle images. Do you you I think it has value to document this on our docs under images?

Yeah, good idea—I think it’d be helpful to have a code example and snippet in the Image docs page.

Read more comments on GitHub >

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

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found