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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T18:52:39+00:00 2026-05-27T18:52:39+00:00

Basically I have a set of divs that are pretty much identical in structure,

  • 0

Basically I have a set of divs that are pretty much identical in structure, then following them I have a div that is unique to the set. Basically the first divs are a bunch of different categories and the last div is a userprofile type square. What I can’t figure out is why the user profile square is being rendered with a higher position than the other divs.

they all have the same css

  cursor: pointer;
  display: inline-block;
  margin: 10px;
  padding: 5px 5px 10px 5px;
  width: 219px;
  height: 219px;
  background: #fff;

and the container has this css

display: block;
float: left;
width: 100%;
text-align: center;
padding: 15px;
white-space: nowrap;
overflow-x: auto;
overflow-y: hidden;
box-sizing: border-box;
-webkit-box-sizing: border-box;
-moz-box-sizing: border-box;
-o-box-sizing: border-box;
-ms-box-sizing: border-box;

this is what it looks like
enter image description here

I’m guessing it’s because the divs internal structure is different, but I’m not sure why it’s doing this. I also noticed that if for example one of the category divs’ images do not load it behaves the same way as my rogue div.

Any light there is to be shed on this issue is much appreciated.

  • 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-27T18:52:40+00:00Added an answer on May 27, 2026 at 6:52 pm

    With display: inline-block; it’s best to always add vertical-align: top; to the children (and then format from there as needed), especially if you have different element types or images in your container. Even images inside of your child elements can mess up the layout of inline-block;. inline-block elements also suffer from the “whitespace problem”, which can affect layout. To prevent that you can either put all child elements together or comment out the whitespace.

    Demo: http://jsfiddle.net/ThinkingStiff/wwwkJ/

    HTML:

    <div id="container">
        <div class="child">one</div>
        <div class="child">two</div>
        <img class="child" />
    </div>
    
    <div id="container-align">
        <div class="child-align">one</div>
        <div class="child-align">two</div>
        <img class="child-align" />
    </div>
    
    <div id="container-align-whitespace">
           <div class="child-align">one</div><!--
        --><div class="child-align">two</div><!--
        --><img class="child-align" />
    </div>
    

    CSS:

    .child {
        border: 1px solid red;
        display: inline-block;
        height: 50px;
        width: 50px;
    }
    
    .child-align {
        border: 1px solid red;
        display: inline-block;
        height: 50px;
        vertical-align: top;
        width: 50px;
    }
    
    #container, #container-align, #container-align-whitespace {
        border: 1px solid black;
        height: 100px;
        width: 300px;
    }
    

    Output:

    enter image description here

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

Sidebar

Related Questions

I have a function called testimonials() that basically cycles through a set of divs,
basically I have 4 images with divs set up like this: <div id=selector> <div
I basically have a div with set dimensions and overflow: hidden . That div
We have a set of applications that basically display a bunch of bitmaps and
I have an archiving process that basically deletes archived records after a set number
lets say i have a tree of the following structure: <div>node level1 <div>node level2
I have some pretty basic HTML/CSS that isn't working as I expect. Basically I
I have a set of divs like so: <div id=textArea> <div id=text></div> </div> CSS
I basically have to do a update of a record. I have a set
I basically have a server set up and I'm accepting new clients(UNIX) and i'm

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.