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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T08:05:04+00:00 2026-05-26T08:05:04+00:00

I have a simple request which CSS appears unable to deliver… I’d like 3

  • 0

I have a simple request which CSS appears unable to deliver…

I’d like 3 DIVs side-by-side – the first and third DIVs contain a single image – the second DIV contains a line of text, an image, another line of text.

They should appear this

IMAGE1  TEXT1  IMAGE2
        IMAGE2
        TEXT2

With – and this is the bit I cannot make work – TEXT1, IMAGE2 and TEXT2 centered within the width of the 2nd DIV – something like this

   MY TEXT
MY WIDER IMAGE
     TEXT

The CENTER tag would have done this in seconds, but CSS cannot apparently do something as simple as that!?!?

p.s. in reply to a request for code – something like this for starters

<DIV>
  <IMG src=image1.jpg>
</DIV>
<DIV>
  <p>text 1</p>
  <IMG src=image2.jpg>
  <p>text 2</p>
</DIV>
<DIV>
  <IMG src=image3.jpg>
</DIV>

The basic CSS would be

.DIV {
  display: inline;
  float: left;
}

All I need is the magic to make that centre DIV align it’s contents centrally in the way the CENTER tag would have achieved in milliseconds…

and I’ve tried a variety of things including inline-block, margin: auto etc. –

  • 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-26T08:05:04+00:00Added an answer on May 26, 2026 at 8:05 am

    Try something like this.

    1. float your divs
    2. use text-align:center for the text
    3. wrap your images and give them margin:1em auto

    HTML

    <DIV>
        <p><IMG src=image1.jpg></p>
    </DIV>
    <DIV>
        <p>text 1</p>
        <p><IMG src=image2.jpg></p>
        <p>text 2</p>
    </DIV>
    <DIV>
        <p><IMG src=image3.jpg></p>
    </DIV>
    

    CSS

    div{
        float:left;
        border:1px solid black;
        width:150px;
        height:200px;
    }
    
    div p{
        text-align:center;
    }
    
    div p img{
        width:20px;
        margin:1em auto;
    }
    

    Example: http://jsfiddle.net/PvgSr/

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

Sidebar

Related Questions

I have a simple jquery/ajax request to the server which returns the structure and
Simple request (hopefully) here. I have a string which whilst it varies in length,
I have a simple AJAX request which sends data to a PHP and the
i have a simple Jquery code which is for sending $.ajax request and passing
I have simple SSIS package which reads data from flat file and insert into
I have simple HTML code with some JavaScript. It looks like: <html> <head> <script
I have simple SSIS package in which On Error event handler I have created
I have my .htaccess file setup like the following. It's a simple concept where
I have a simple request that I have spent much time on (embarrassingly).. I
I have a simple php error coming up of which i cannot find the

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.