Proyb2
Proyb2

Reputation: 993

Gapless between image

There would be a gap between left and right photos. How do I produce a gapless? I tried using float and display which seem not workable?

echo '<li><a href="'.$row['id'].'"><img alt="'.$row['username'].'" src="photo/'.$phm.'"></img></a></li>';

Upvotes: 0

Views: 376

Answers (3)

David Oliver
David Oliver

Reputation: 2502

If there are gaps between li's that you're displaying using inline-block due to white space in the markup (new lines or spaces), you can remove it by using font-size: 0 on the containing element.

Upvotes: 1

clairesuzy
clairesuzy

Reputation: 27624

if the li's are floating already, add display: block to your images

Upvotes: 1

Hussein
Hussein

Reputation: 42818

Not having enough code to look at makes it hard to determine what exactly is causing the gap. Try to reset your li, img and a tags and see if it help. Add this to the top of your css file.

li, a, img{
 padding:0;
 margin:0;
 border:0;
}

If this doesn't work. You need to post more code to look at.

Upvotes: 1

Related Questions