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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T23:52:32+00:00 2026-05-16T23:52:32+00:00

Consider the following HTML and CSS. The desired result is the two pink boxes

  • 0

Consider the following HTML and CSS. The desired result is the two pink boxes are centered within the single green box. The text is NOT centered. There is padding on the left and right of each box. I should be able to have 1 or more of these boxes, up to as many as 8; they should all float to fill in the container div. I’ve been bangin my head on this one for weeks now, and nothing I read or try seems to work – margin: auto, display:inline, etc etc. I added the box-margin div to create the padding when trying to use margin:auto, but it still didn’t get the result I was looking for. Halp?

HTML

<body>
    <div id="page">

        <div id="main">

            <div class="box-group">

                <div class="box-margin">
                    <div class="box">
                        <h2>Data</h2>
                        <ul>
                            <li><a href="/URL">Link</a></li>
                        </ul>
                    </div>
                </div>

                <div class="box-margin">
                    <div class="box">
                        <h2>Reports</h2>
                        <ul>
                            <li><a href="/URL/">Link</a></li>
                        </ul>
                    </div>
                </div>
            </div>
        </div>
    </div>
</body>

CSS

body
{
    margin: 0;
    padding: 0;
}
#page
{
    width: 95%;
    min-width:800px;
    border: thin solid red;
}
#main
{
    padding: 30px 30px 15px 30px;
    margin-bottom: 30px;
    min-width: 875px;
    border: thin solid black;
}
.box-group
{
    width: 100%;
    padding: 10px;
    border: thin solid green;
}
.box-margin
{
    margin: auto;
    width: 275px;
    float: left;
    padding: 15px;
}
.box
{
    border: thin ridge pink;
    height: 200px;
    width: 250px;
}      
  • 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-16T23:52:33+00:00Added an answer on May 16, 2026 at 11:52 pm

    Have a look at this page on centered floats. It has a neat trick that might not work for you (it will center them as a group, but not per-line, if they wrap), but it also details a fix for display: inline-block in IE.

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

Sidebar

Related Questions

Consider the following code : HTML: <div> <label for='name'>Name:</label> <input type='text' id='name' /> </div>
Consider the following HTML: <div class=foo id=obj> I should be changed red <div class=bar
Consider the following Html file: <!DOCTYPE HTML PUBLIC -//W3C//DTD HTML 4.01//EN http://www.w3.org/TR/html4/strict.dtd> <html> <head>
Consider the following code : HTML: <table> <tr> <td>Hello</td> <td>Stack</td> <td>Overflow</td> </tr> <tr> <td>some</td>
Consider the following HTML: (Written for Google Chrome) <html> <head> <script language=javascript> function AddToIFrame(){
Here's my problem: Consider the following html: <div id=item1 class=green_large> <div id=item2 class=green_large> <div
Consider following DOM fragment: <div id=div-1>foo</div> <div id=div-2>bar</div> Is it possible to insert HTML
I have the following HTML code (which is placed within several files), which inserts
Consider following example : public class SomeBusinessLayerService : DataService<MyEntityContainer> { [WebInvoke] void DoSomething(string someParam)
Consider following class class test { public: test(int x){ cout<< test \n; } };

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.