Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Images display with spurious top and bottom margins

Status
Not open for further replies.

OfficeAnimal

Technical User
Joined
Jun 4, 2009
Messages
277
Location
AU
I have a block which displays a GIF which is 14px by 14px.
The image appears with a 2px gap above and below.
Margins, borders, and padding are set to none, 0, and 0 respectively.

What else could cause this?
 
Spaces. Images are inline elements, so usually they appear in the middle of the text. Try making the image a block (add display: block; to its css) and see if that takes the gaps away.

[small]Do something about world cancer today: Comprehensive cancer control information at PACT[/small]
 
Errors in your CSS could also cause the reset styles to be ignored.

Make sure your CSS and HTML both validate.

Dan



Coedit Limited - Delivering standards compliant, accessible web solutions

Dan's Page [blue]@[/blue] Code Couch:
Code Couch Tech Snippets & Info:
 
Vragabond has it. Displaying the images as a block solved the problem.

Thanks folks
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top