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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T17:19:53+00:00 2026-05-27T17:19:53+00:00

JSFIDDLE HTML: <div class=SummaryTable> <div class=AddressContainer> <div class=Address> <b>Ship To: </b> <ul> <li>John Smith</li>

  • 0

JSFIDDLE

HTML:

<div class="SummaryTable">

    <div class="AddressContainer">

        <div class="Address">
          <b>Ship To: </b>
            <ul>
                <li>John Smith</li>
                <li>45 Holland drv.</li>
            </ul>
        </div>

            <div class="Address">
             <b>Bill To: </b>
                <ul>
                    <li>John Smith</li>
                    <li>P.O Box 456</li>
                </ul>
            </div>
    </div>
</div>

CSS:

.SummaryTable
{
width: 650px;   
text-align:center;
}


.SummaryTable .AddressContainer
{
width:650px;
}

.SummaryTable .Address
{
width:323px;
background-color:Yellow;
float:left;
border: 1px solid black;
height:200px;
}

.Address ul
{
width:130px;
min-width:130px;
max-width: 280px;
margin-left:auto;
margin-right:auto;
background-color:Green;
text-align:left;
padding:0px;
}

.Address li
{
list-style-type: none;
}

JSFIDDLE

  • I want to keep the green box\element (ul) centred in the 323px wide/200px or Auto high (.Address) layer both horizontally and vertically.
  • I have achieved horizontal centering of <ul> by setting fixed width + margin:0px auto, but addresses vary in length and I don’t just want some fixed size box where one longer address would appear centred under (Ship To\Bill To) heading and another shorter one will look out of place since text is aligned to the left.
  • I want to see the text in the <li> stretch to the <ul> green box up to the maximum-width setting (e.g 280px) and the green box, whatever its size will be to remain centered horizontally and vertically in the .Address layer and consequently under the Ship To\Bill To headings.

  • Main reason for this is that shorter addresses would look offset to the left in a fixed width ul element and if I make the width small than a line break would ensue for longer address, spreading the first and last name and or address over two lines. Using centrally aligned text in the ul element
    -Of course solves this problem, but I need left aligned text.

  • 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-27T17:19:54+00:00Added an answer on May 27, 2026 at 5:19 pm

    DEMO jsBin

    If I understood well your question

    Here is the modified CSS:

    .SummaryTable{
      width: 650px;   
      text-align:center;
    }    
    .AddressContainer{
      width:650px;
    }   
    .Address{
      width:323px;
      background-color:white;
      float:left;
      border: 1px solid black;
      height:200px;
    }
    .address b{
        display:block;           /*should do the trick*/
    }
    .Address ul{
      display:inline-block;     /*should do the trick*/
      background-color:orange; 
      text-align:left;
      padding:0px; 
    }
    .Address li{
        list-style-type: none;
    }
    

    I removed some margin-reft/right:auto, widths, min-width, max width and formatted a bit your .summaryTable css ‘appearances’. Than a bit of playing with display property have done the trick.

    Here is a demo using jQuery : demo jsBin with jQ

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

Sidebar

Related Questions

I have this jQuery and HTML http://jsfiddle.net/UgX3u/30/ <div class=container> <div class=yellow></div> <div class=red></div> <div
HTML: <ul id=mode> <li><a href=#tab1>tab1</a> <div class=extra>tada</div> </li> <li><a href=#tab2>tab2</a> <div class=extra>tada</div> </li> </ul>
Here is HTML code: <div class=row> <span class=item><a href=#>A</a></span> <span class=item><a href=#>B</a></span> <span class=item><a
I have some basic HTML... <div id=panel> <h3>abc</h3> <address>a</address> <address>b</address> <address>c</address> </div> ...and CSS...
My problem is with the below html <div class=editor-container> <div class=editor-row curFocus> <div class=editor-label>
Here is my HTML code <span class=xxt style=>Hide Me</span> <div><br/></div> <div></div> <span style=> <table>
I have the following code: HTML: <div id=login class=transparent-div login_leaf_class> <input class=pointer login_fields_button id=submit_button
the HTML below <div class=commentlinks> <a class=commentlinked blogcount>3</a> <a class=commentlinked fbcount>2</a> <a class=commentlinked disqcount>1</a>
Consider following HTML, I have a div class magic inside main . The magic
HTML: <div id=div_id><div class=div_class><p>test</p> </div> <div class=two> <p>asd</p></div> </div> CSS: #div_id p { color:red;

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.