Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6116455
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T15:12:28+00:00 2026-05-23T15:12:28+00:00

Is there any way to remove the extra space displayed at the bottom of

  • 0

Is there any way to remove the extra space displayed at the bottom of an HTML List Item tag without setting a fixed height on the list item? I.e. I would like the list item to wrap to its content.

The following code shows 3 images in a horizontal list but the height of each li tag is 4px more than the image. I would like it to wrap around the image i.e. to have the same width and height. The width is currently the same but I just can’t get the height to match.

HTML:

<ul>
    <li><img alt="img1" src="img1.jpg" /></li>
    <li><img alt="img2" src="img2.jpg" /></li>
    <li><img alt="img3" src="img3.jpg" /></li>
</ul>

CSS:

li 
{ 
    display:block; 
    float:left; 
    margin:0;
    padding:0;
    background-color:Yellow;
}
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-23T15:12:28+00:00Added an answer on May 23, 2026 at 3:12 pm

    This is your code: http://jsfiddle.net/23LcK/

    The gap is nothing to do with the lis. It’s the space reserved for descenders in letters like g and p (because the imgs are inline elements).

    You can remove it with any of these applied to li img:

    • display: block: http://jsfiddle.net/23LcK/1/
    • vertical-align with top or bottom: http://jsfiddle.net/23LcK/2/
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

is there any way to programatically remove all microsoft html formatting that gets put
Is there any way to remove all forgeinKey and primary key contriants from Database
Is there any way to remove the contents of an file in php, do
is there any way to remove an attachment from Zend_Mail object? Simple example: $mail
Is there any way to manually remove an object which the garbage collection refuses
Is there any way to completely remove the comment with the copyright notice when
I want to know is there any way that I can remove duplicates from
Using regular expressions in C#, is there any way to find and remove duplicate
Is there a way in any browser to add/remove class names? For example, if
Is there any way to remove the minus sign when in editing mode and

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.