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

  • Home
  • SEARCH
  • 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 4244776
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 21, 20262026-05-21T03:45:10+00:00 2026-05-21T03:45:10+00:00

Could someone help me resolve the discrepancies between the following two cases. In both

  • 0

Could someone help me resolve the discrepancies between the following two cases. In both cases I have split an image into several pieces and placed them in a table so that it still appears to be a single image.

However, in one case, I have set the doctype to and in the other there is no doctype set. My expected result is shown when there is no doctype set ( no border-spacing or cellspacing or any other spaces between the cells and the rows). However, when the doctype is set, there is a 1px padding in-between rows.

The HTML for both cases is the same except for the doctype

<!DOCTYPE html>
<html>
<head>
<style type='text/css'>
    .table{
        display: table;
    }

    .row{
        display: table-row;
    }

    .cell{
        display: table-cell;
    }
</style>
</head>
<body>
    <div id='slider' class='table'>
        <div class='row'>
            <div class='cell'><img src='slides/1/1_01.gif' alt='slide' /></div>
            <div class='cell'><img src='slides/1/1_02.gif' alt='slide' /></div>
            <div class='cell'><img src='slides/1/1_03.gif' alt='slide' /></div>
            <div class='cell'><img src='slides/1/1_04.gif' alt='slide' /></div>
            <div class='cell'><img src='slides/1/1_05.gif' alt='slide' /></div>
            <div class='cell'><img src='slides/1/1_06.gif' alt='slide' /></div>
        </div>
        <div class='row'>
            <div class='cell'><img src='slides/1/1_07.gif' alt='slide' /></div>
            <div class='cell'><img src='slides/1/1_08.gif' alt='slide' /></div>
            <div class='cell'><img src='slides/1/1_09.gif' alt='slide' /></div>
            <div class='cell'><img src='slides/1/1_10.gif' alt='slide' /></div>
            <div class='cell'><img src='slides/1/1_11.gif' alt='slide' /></div>
            <div class='cell'><img src='slides/1/1_12.gif' alt='slide' /></div>
        </div>
        <div class='row'>
            <div class='cell'><img src='slides/1/1_13.gif' alt='slide' /></div>
            <div class='cell'><img src='slides/1/1_14.gif' alt='slide' /></div>
            <div class='cell'><img src='slides/1/1_15.gif' alt='slide' /></div>
            <div class='cell'><img src='slides/1/1_16.gif' alt='slide' /></div>
            <div class='cell'><img src='slides/1/1_17.gif' alt='slide' /></div>
            <div class='cell'><img src='slides/1/1_18.gif' alt='slide' /></div>
        </div>
    </div>
</body>
</html>

could someone explain to me why there is a 1px gap between the rows when the doctype is set to HTML ?

  • 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-21T03:45:10+00:00Added an answer on May 21, 2026 at 3:45 am

    @Shafee: Try —

    .row img {
        display: block;
    }
    

    Edit

    Short explanation: your code with the DOCTYPE was triggering strict mode in your browser which handles the display of images differently.

    Longer explanation:

    In the early days, experiments with
    strict mode invariably raised the
    comment that images suddenly got an
    odd bottom margin that couldn’t be
    removed. The cause was that in strict
    mode <img /> is an inline element,
    which means that some space should be
    reserved for possible descender
    characters like g, j, or q. Of course
    an image doesn’t have descender
    characters, so the space was never
    used, but it still had to be reserved.

    The solution was to explicitly declare
    images block level elements: img
    {display: block}
    .

    Nonetheless browser vendors, Mozilla
    especially, thought this was such a
    confusing situation that they
    introduced “almost strict mode”. This
    was defined as strict mode, but with
    images continuing to be blocks, and
    not inline elements.

    Most common doctypes, including the
    one I use, trigger almost strict mode.
    The treatment of images is by far the
    most important difference between
    almost strict mode and really strict
    mode.

    Source: http://www.quirksmode.org/css/quirksmode.html

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a SQL Server error I'm trying to resolve. Could someone please help
Could someone help to know which sensor uses which part of phone's hardware or
Could someone help me with getting the syntax of this SQL query down? Here
could someone help me to solve an issue with combobox behaviour. Here is my
I have scheduled a TimerTask to run at a fixed time with a interval
google.maps.Marker.prototype.hide = function() { if (this.div_) { this.div_.style.visibility = hidden; } }; google.maps.Marker.prototype.show =
I am trying port my iPad project to latest iPad 2. I installed iOS
I am trying to write a copy method which can be used to copy
When you search on web you will find very easy answers for How to

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.