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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T20:46:56+00:00 2026-05-26T20:46:56+00:00

I have .centered-holder { margin-left: auto; margin-right: auto; clear: left; display: inline-block; } Then

  • 0

I have

.centered-holder {
    margin-left: auto;
    margin-right: auto;
    clear: left;
    display: inline-block;
}

Then

<div class="centered-holder">misc content 1</div>
<div class="centered-holder">misc content 2</div>
<div class="centered-holder">misc content 3</div>

I only want one max per line, is this actually possible somehow? It’s an iPhone HTML5 app so older browser restrictions aren’t an issue.

  • 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-26T20:46:57+00:00Added an answer on May 26, 2026 at 8:46 pm

    Depend of your CSS declarations and your markup, but you can try to put this CSS declaration on the parent container:

    white-space: pre-line;
    

    With this approach you avoid to transform the .centered-holder to a block element, and you can still use for example the text-align:center on the parent container.


    pre-line
    – This value will cause sequences of whitespace to collapse into a single space character. Line breaks will occur wherever
    necessary to fill line boxes, and at new lines in the markup (or at
    occurrences of “\a” in generated content). In other words, it’s like
    normal except that it’ll honor explicit line breaks.

    You can find more informations here about white-space:

    • http://reference.sitepoint.com/css/white-space
    • http://www.w3.org/TR/css3-text/#white-space

    To finish, you can use these CSS declarations :

    .parent-container {
        white-space: pre-line /* Create new line for each DIV */;
        line-height:0 /* Mask the extra lines */;
        *white-space: pre /*FixIE7*/;
        *word-wrap: break-word /*FixIE7*/;
    }
    
    .centered-holder {
        display: inline-block;
        line-height:100% /* Restore a default line-height */;
        *display: inline /*FixIE7*/;
        *zoom: 1 /*FixIE7*/;
    }
    

    I found this question very interesting, so I give also the CSS declarations for IE6-7 (pre-line and inline-block fixes). It should be usefull for some other people which have a similar problem.

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

Sidebar

Related Questions

I have a div $(#organizer_listings_container) initially centered using CSS margin: 0 auto; which uses
I have a centered div on my site, using a fixed width and margin:0
I have a centered div layout. The left side of the div in the
I have a centered layout using margin:0 auto; , but one of my child
I have this code: <div class=thumb_image_holder_orange> <img src=http://dummyimage.com/114x64/000/fff.png /> </div> The image is centred
I have a div centered in the site and containing a picture. The div
What I have Is a centered div in my webpage containing a picture that
I have a image centered on the screen. I need to display some text
The <center>Text</center> tag to have text centered horizontally is depreciated, so I tried <p
I have a website that is perfectely centered aligned. The CSS code works fine.

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.