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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T00:56:09+00:00 2026-05-14T00:56:09+00:00

Why isnt everything aligned? No yellow should be visible and no orange should be

  • 0

Why isnt everything aligned? No yellow should be visible and no orange should be visible except for the right side and bottom left where theres space for another image.

Basically my images are pretty much aligned to the center (i have other pics not in this example which is easier to see). However in this case when i have 150px height image the 150 width seems start lower. Also why are there spaces in between

http://i42.tinypic.com/2jag1w7.jpg

alt text
alt text

<!DOCTYPE HTML PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"><head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>ldfk;sd</title>
<style type="text/css">



div.ImgGallery
{
    max-width: 630px;
    background: orange;
}

.ImgGallery div
{
    display: inline;
}
/* http://www.brunildo.org/test/img_center.html */
.ImgGallery div div
{
    display: table-cell;
    text-align: center;
    background: gray;
    width: 150px;
    height: 150px;
}

.ImgGallery div{
background: yellow;
vertical-align: middle;


}
//.ImgGallery div div :nth-child(2n+1) { background: red; }
.ImgGallery * {
    vertical-align: middle;
}

.ImgGallery a
{
    display: block;
}
.ImgGallery a *
{
    border-style: none;
}


</style>
</head>
<div class="smallGallery">
<div class="ImgGallery">

<div><div><a href="http://google.com"><img src="a.jpg" alt="a.jpg"></a></div></div>
<div><div><a href="http://google.com"><img src="a.jpg" alt="a.jpg"></a></div></div>
<div><div><a href="http://google.com"><img src="a.jpg" alt="a.jpg"></a></div></div>
<div><div><a href="http://google.com"><img src="a.jpg" alt="a.jpg"></a></div></div>
<div><div><a href="http://google.com"><img src="a.jpg" alt="a.jpg"></a></div></div>
<div><div><a href="http://google.com"><img src="b.jpg" alt="a.jpg"></a></div></div>
<div><div><a href="http://google.com"><img src="a.jpg" alt="a.jpg"></a></div></div>
<div><div><a href="http://google.com"><img src="a.jpg" alt="a.jpg"></a></div></div>
<div><div><a href="http://google.com"><img src="b.jpg" alt="a.jpg"></a></div></div>
<div><div><a href="http://google.com"><img src="a.jpg" alt="a.jpg"></a></div></div>
<div><div><a href="http://google.com"><img src="a.jpg" alt="a.jpg"></a></div></div>

</div></div>

</body></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-14T00:56:10+00:00Added an answer on May 14, 2026 at 12:56 am

    Here’s the code:

    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="pl" lang="pl">
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
        <title>Przykładowy dokument</title>
        <style type="text/css">
            * {
                margin: 0;
                padding: 0;
            }
    
            li {
                list-style-type: none;
            }
    
            a img {
                border: none;
            }
    
            #gallery {
                width: 650px;
    
                background: orange;
            }
    
            #gallery li {
                display: inline-block;
    
                background: yellow;
                border: 1px solid black;
            }
    
            #gallery img {
                vertical-align: middle;
            }
        </style>
        <script type="text/javascript"></script>
    </head>
    <body>
        <ul id="gallery">
            <li><a href="#"><img src="http://i41.tinypic.com/14jyv88.jpg" /></a></li
            ><li><a href="#"><img src="http://i40.tinypic.com/25506e1.jpg" /></a></li
            ><li><a href="#"><img src="http://i41.tinypic.com/14jyv88.jpg" /></a></li
            ><li><a href="#"><img src="http://i40.tinypic.com/25506e1.jpg" /></a></li
            ><li><a href="#"><img src="http://i41.tinypic.com/14jyv88.jpg" /></a></li
            ><li><a href="#"><img src="http://i40.tinypic.com/25506e1.jpg" /></a></li
            ><li><a href="#"><img src="http://i41.tinypic.com/14jyv88.jpg" /></a></li
            ><li><a href="#"><img src="http://i40.tinypic.com/25506e1.jpg" /></a></li
            ><li><a href="#"><img src="http://i41.tinypic.com/14jyv88.jpg" /></a></li
            ><li><a href="#"><img src="http://i40.tinypic.com/25506e1.jpg" /></a></li
            ><li><a href="#"><img src="http://i41.tinypic.com/14jyv88.jpg" /></a></li
            ><li><a href="#"><img src="http://i40.tinypic.com/25506e1.jpg" /></a></li
            ><li><a href="#"><img src="http://i41.tinypic.com/14jyv88.jpg" /></a></li
            ><li><a href="#"><img src="http://i40.tinypic.com/25506e1.jpg" /></a></li
            ><li><a href="#"><img src="http://i41.tinypic.com/14jyv88.jpg" /></a></li
            ><li><a href="#"><img src="http://i40.tinypic.com/25506e1.jpg" /></a></li
            ><li><a href="#"><img src="http://i41.tinypic.com/14jyv88.jpg" /></a></li
            ><li><a href="#"><img src="http://i40.tinypic.com/25506e1.jpg" /></a></li
            ><li><a href="#"><img src="http://i41.tinypic.com/14jyv88.jpg" /></a></li
            ><li><a href="#"><img src="http://i40.tinypic.com/25506e1.jpg" /></a></li>
        </ul>
    </body>
    </html>
    

    And here is the explanation:

    1. Gallery is a kind of list so it should be presented in code as a list.
    2. These blank spaces between images where caused by the fact that images were treated as inline elements. And you should know that one or more white char (space, enter, tab and so on) between inline elements in code is presented as a single space in browser. It’s the same situation as when writing a text (which is inline).
    3. Vertical alignment can be obtained using vertical-align property.
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Ive been trying to make a scrollable/zoomable app and everything has gone great except
How do you properly ensure that a user isnt tampering with querystring values or
I am new to silverlight and from what I gathered there isnt any direct
isnt there any software/plugin to netbeans/eclipse that auto indent the whole code after i've
I am joining a few tables for a selection If there isnt anything matching
Hey i want to create a list like this. The pic below isnt my
I created a Process that is targeted to the Java.exe file. The process should
Isn't the use of delegates to help with some asynchronous cases? I tried the
This isn't legal: public class MyBaseClass { public MyBaseClass() {} public MyBaseClass(object arg) {}
This isn't a holy war, this isn't a question of which is better. What

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.