1

http://codepen.io/orangespire/pen/JXLXQa

Basically what I want is to get rid of the thumbnail whitespace on the left and right side of the image. I know that I could make the

img {
  width: 100%;
  }

to get rid of that, but that would just make the image larger. Any suggestions?

  • See this - [How to make image caption width to match image width?](http://stackoverflow.com/q/30686191/483779) – Stickers Apr 14 '16 at 16:06
  • 1
    Questions seeking code help must include the shortest code necessary to reproduce it **in the question itself**. Although you have provided a [**link to an example or site**](http://meta.stackoverflow.com/questions/254428/something-in-my-web-site-or-project-doesnt-work-can-i-just-paste-a-link-to-it), if the link were to become invalid, your question would be of no value to other future SO users with the same problem. – Paulie_D Apr 14 '16 at 16:06
  • What do you mean by *white-space*? I don't see much difference between your demo and the selected answer's result. Are you referring to the white "edges"/border around the thumbnail or is it actually a size-related question? More clarification needed. – Aziz Apr 14 '16 at 22:11

2 Answers2

0

Set thumbnail div styling to

<div class="thumbnail" style="width:60%; margin:0 auto">

and set the img width to 100%

Brad Miller
  • 124
  • 6
0
img {width: 100%;}

.thumbnail {width:62%; margin-right:auto; margin-left:auto;}

http://codepen.io/ruchiccio/pen/vGRzmg

Rachel S
  • 3,780
  • 3
  • 24
  • 37
  • Please explain how your answer solves the problem, it will help everyone understand your solution with more clarity and for future reference. – Aziz Apr 14 '16 at 22:11