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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T18:47:49+00:00 2026-06-09T18:47:49+00:00

I have a problem with some basic css stuff I was browseing the net

  • 0

I have a problem with some basic css stuff I was browseing the net for this but found examples but none of that explained my problem:

Page template [HTML]:

    <div id="container" class="gallery-list"> <!-----gallery-list---->
    <div id="content" role="main">
        <h1 class="page-title"><?php the_title(); ?></h1>
        <div id="gallery-list-container" class="list-container">
                <?php wp_reset_query(); ?> 
                <?php
                // Set up the arguments for retrieving the pages
                $args = array(
                    'post_type' => 'page',
                    'numberposts' => -1,
                    'post_status' => null,
                // $post->ID gets the ID of the current page
                'post_parent' => $post->ID,
                    'order' => ASC,
                    'orderby' => title
                    );
                 $subpages = get_posts($args);
                  if ($subpages[0]) :?>
                        <div class="gallery-list-wrap">
                            <?php
                             // Just another WordPress Loop
                             foreach($subpages as $post) :
                                setup_postdata($post);
                            ?>
                                <div id="post-<?php the_ID(); ?>" class="list-entry-container">
                                    <?php 
                                        $count++;
                                        // Show the Post thumbnail
                                        if ( has_post_thumbnail() ) : ?>

                                                <div class="list-entry">
                                                    <a class="size-small" href="<?php the_permalink(); ?>"><?php the_post_thumbnail('thumbnail'); ?></a>
                                                    <h2 class="list-entry-title"><a href="<?php the_permalink(); ?>" title="<?php printf( esc_attr__( 'Permalink to %s', 'highart' ), the_title_attribute( 'echo=0' ) ); ?>" rel="bookmark"><?php the_title(); ?></a></h2>
                                                </div><!-- .entry-content -->                   
                                            <?php
                                        // Show the High Art image
                                         else : ?>
                                            <div class="entry-content">
                                                <?php highart_entry_image_attachment('thumbnail') ?>
                                            </div><!-- .entry-content -->                       
                                        <?php endif; ?>

                                        <div class="entry-utility">
                                            <?php edit_post_link( __( 'Edit', 'highart' ), '<span class="edit-link">', '</span>' ); ?>
                                        </div><!-- .entry-utility -->
                                </div>
                        <?php endforeach; ?>
                    </div>
                 <?php endif; ?>
        </div>
    </div><!-- #content -->
</div><!-- #container -->

[CSS]

#main .gallery-list{margin:0;width:925px;overflow:hidden; display:block;}
#main .gallery-list #content{width:925px;}
.list-container{margin:0 auto; display:block; padding:11px 0 0; list-style:none; border-bottom: 1px solid lightgray;}
.gallery-list #gallery-list-container {margin-top:-22px;float:none; width:925px;}
.gallery-list li {display:inline;width:185px;height:241px;margin-right:25px;padding:22px 0 44px;border:1px solid lightgray;border-width:0 0 0; position:relative; overflow:hidden;}
.gallery-list #gallery-list-container li {min-height:252px; display:inline;clear:none;padding-bottom:25px;}
.gallery-list-wrap{display:inline; float:left; margin:0 auto;}
.list-entry-container {display:inline; float:left;}
.gallery-list .list-entry{display:inline;width:165px;font-size: 9px; font-weight:400; line-height:11px; text-transform:uppercase; padding:5px 0 6px;}
.gallery-list-line-wrap{margin: 0 auto; display:block;}

why the div: gallery-list-wrap is not centering on the container?
It just stay’s aligned to the left of the container.

In this case I don’t really understand how the browser processes this.

Probably a newbie question but I just can’t seem to figure it out

EDIT1:
According to the answers below this could be a problematic approach on this so some backstory:
I have a div that is containing div’s of subpages with thumbnails and titles of a page. so far so good the problem is I don’t know how manny there are so I don’t know if I have 1,2,3 or 4 per line I would like to have maximum 4 per line and each line centered to the container

is this eaven doable?

Thanks for help.

  • 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-06-09T18:47:50+00:00Added an answer on June 9, 2026 at 6:47 pm

    You need to remove

    display:inline;
    float:left;
    

    and add a width to the gallery-list-wrap.

    At the moment you have margin-left and margin-right set to auto which is the correct thing to do, however for it to work properly you need to define a width as well.

    So if you are having two div’s in there, work out their combined width and apply that to the gallery-list-wrap.

    I hope this helps.

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

Sidebar

Related Questions

I have a problem with some basic ajax and asp.net web service. In my
I have some questions about basic CSS that I was unable to understand or
I have some problem with this mongoid. It's my first time to use mongoDB,
I have some problem with MySQL Workbench in that I sometimes can't set foreign
I have some problem with displaying emoji icon in Android TextView First, I found
I have a problem with understanding of some basic OOP concepts. I'll try to
I'm trying to get deeper into advanced-SQL'ing but have a slight problem with some
I have some basic tabs in HTML, with CSS to change the colour once
ok, I have been through some basics but I'm not able to get this
I have some code in HTML and CSS where HTML looks like this: <div

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.