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

CSS

Daniel Campbell
Daniel Campbell
10,148 Points

CSS formatting of Instagram feed on http://kiti.ca

Hello,

Inspired by the AJAX Flickr Gallery exercise,

https://teamtreehouse.com/library/ajax-basics/ajax-and-apis/flickr-s-api

I put together an Instagram feed to show photos with the tag #kitty on my practice page. It works, but I'm trying to style it and got stuck.

How could I remove the white spacing between each line of the images?

http://kiti.ca/gallery.html

Thanks forum!

2 Answers

Chris Shaw
Chris Shaw
26,676 Points

Hi Daniel,

To achieve this, you need to make two small changes. The first is to change float direction of the anchor tags to left and set the display type of the images to block.

#instafeed a {
  border: 0;
  padding: 0;
  text-decoration: none;
  border-bottom: none;
  float: left;
}

#instafeed img {
  border: 0;
  padding: 0;
  display: block;
}

Floating the anchor tags removes the default browser spacing which can also be removed by using an unordered list or flex and setting the display type of block on the images ensures they sit within the bounds of their parent which by default they leak out.

Daniel Campbell
Daniel Campbell
10,148 Points

Hi Chris,

Ìt works, thank you. (float:left & display:block)

I used normalize.css on the page. I thought it would have removed all browser added spacing. I thought I was using flex divs.