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
  • 1 View
  • 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
I have a file upload, it works great in everything except for firefox, it
Im getting issue with redirect_uri, but everything is set up properly. I had left
I am converting a VB.Net application to C#. Everything else is going great. Except
This isn't cross-platform code... everything is being performed on the same platform (i.e. endianess
using jquery ui 1.8 trying autocomplete Everything works apart from that the ui-menu isn't
Everything works with no errors, but in the xml, tvfinalgrade stays 0.0... Why isn't
the second function isnt working? $('.edit_hover').live('hover', function(e){ $(this).stop(); var half_width = ($(this).css('width').slice(0, -2))/2; var
Alright I don't see why this isnt working. It seems pretty simple. Here is
From what I can see ui:dialog isnt a standard psuedo css element, so I

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.