Welcome to the Treehouse Community
Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.
Start your free trial
mrx3
8,742 PointsHaving some trouble with a caption I'm trying to add to a image.
I'm trying to add a caption to a image, just a small description about the image, and who owns the image. Now the problem I'm having is that there's a small space between the image and the caption. If tried to set the margin to 0 with the left class, just messing around, and that just puts the text too close to the margin. I've also tried to setting the caption class to margin zero, but nothing happens. Also is it possible to get the background to be the same length as the image? As you can tell with the browser window maximized the background is longer then the image. If anyone could help me with the I would really appreciate it, and thanks in advance for any help.
Here's my codepen link: http://codepen.io/mike316/full/pgKia/
I know you won't beable to see the image, but hopefully someone else has had this problem, and they know how to fix it.
3 Answers
John Romby Andersson
8,453 PointsHow about some negative margin like so:
.caption {
margin: -10px 0;
}
Not sure if I understand your question to it's fullest, on my way to bed ;)
Nemanja Pribilovic
5,366 Pointstry to add padding to image
mrx3
8,742 PointsI did what you said, it just pushed the text farther away because it makes the image smaller. Thanks for the help though.
mrx3
8,742 PointsSure will John I was waiting to see if anymore activity was coming. As far as the captions under the pictures goes, yeah I think I figured it out. Thanks man.
John Romby Andersson
8,453 PointsHappy to help out mate.
Thanks for the vote.
mrx3
8,742 Pointsmrx3
8,742 PointsThat did it. But, the background is still too long. The width of the image is 45% I did try to set the width of the caption to 45% but, I will continue to play around with the width property more. Thanks a million John!!!
John Romby Andersson
8,453 PointsJohn Romby Andersson
8,453 PointsMy pleasure buddy :)
I´ll help you more tomorrow, if you are still stuck on the rest.
John Romby Andersson
8,453 PointsJohn Romby Andersson
8,453 PointsDid you need more help Mr. X?
Also would you please trow in a Best Answer on my post mate?
Cheers :)