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 6827235
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T22:14:32+00:00 2026-05-26T22:14:32+00:00

I was having a curious problem that I finally found a solution to, but

  • 0

I was having a curious problem that I finally found a solution to, but I’m not sure why it happens. I have a page that is being generated by PHP, so the resulting HTML is not always nicely formatted. Here’s the relevant code:

<html>
    <head>
        <style>
            body {background-color: #99ccff;}
            div#content {
                margin: 0 auto;
                text-align: center;
            }
            div#results_header {
                background-color: white;
                display: inline-block;
                font-family: sans-serif;
                font-size: 12px;
                margin: 5px 9px 0;
                padding-left: 18px;
                padding-top: 5px;
                text-align: left;
                border-bottom: 1px solid;
            }
            div.header {
                display: inline-block;
                font-weight: bold;
                padding-bottom: 5px;
            }
            div#ships {
                background-color: white;
                display: inline-block;
                font-family: sans-serif;
                font-size: 12px;
                height: 180px;
                margin: 0 9px 9px;
                overflow-y: auto;
                padding-left: 18px;
                text-align: left;
            }
            div.status {width: 10px;}
            div.name {width: 260px;}
            div.flag {width: 40px;}
            div.type {width: 50px;}
            div.sconum {width: 70px;}
            div.call_sign {width: 80px;}
            div.imo_number {width: 70px;}
            div.upseq {width: 140px;}
            div.photo {width: 50px;}
            div.my_photo {width: 50px;}
        </style> 
    </head>
    <body>
        <div id="content" style="width: 880px;">
            <div id="results_header" style="width: 840px;">
                <div class="name header">Name</div>
                <div class="flag header">Flag</div>
                <div class="type header">Type</div>
                <div class="sconum header">SCONUM</div>
                <div class="call_sign header">Call Sign</div>
                <div class="imo_number header">IMO #</div>
                <div class="upseq header">UPSEQ</div>
                <div class="photo header">Photo</div>
                <div class="my_photo header">My Photo</div>
            </div>
            <div id="ships" style="width: 840px;"></div>
        </div>
    </body>
</html>

I formatted it for readability (the CSS is actually in an external file, for instance). The page is actually generated by PHP so it doesn’t look nearly as pretty as this. Therein lies the problem. What I posted above displays fine and consistent in all browsers. When I remove the whitespace before the “ships” div, it is misaligned in Chrome (Firefox looks fine, haven’t had a chance to test in IE yet).

    <body>
        <div id="content" style="width: 880px;">
            <div id="results_header" style="width: 840px;">
                <div class="name header">Name</div>
                <div class="flag header">Flag</div>
                <div class="type header">Type</div>
                <div class="sconum header">SCONUM</div>
                <div class="call_sign header">Call Sign</div>
                <div class="imo_number header">IMO #</div>
                <div class="upseq header">UPSEQ</div>
                <div class="photo header">Photo</div>
                <div class="my_photo header">My Photo</div>
            </div>
<div id="ships" style="width: 840px;"></div>
        </div>
    </body>
</html>

Again, easily fixed, but I’m curious why this is happening at all.

  • 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-26T22:14:32+00:00Added an answer on May 26, 2026 at 10:14 pm

    Because it’s styled as an inline block. As it’s inline, whitespace is significant. Use display:block; to avoid this.

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

Sidebar

Related Questions

I'm having this problem with my AJAX, where it's not working in IE, but
I'm curious about the possibility of having a .NET class library that provides a
I have been curious to know what is the purpose of having a console
We're having a very curious problem with hsqldb. We are running some tests which
I'm having a bit of a curious problem with .NET and working with the
I've been trying to create my generic ReadOnlyCheckBox style/template but I'm having a problem
Same question as title. Not a real problem I'm having or anything, I was
... after having just read http://www.cocoadev.com/index.pl?CocoaInsecurity ... I am curious to know about your
Having a problem getting a TreeView control to display node images. The code below
I have a table that has a column which holds the id of a

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.