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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T22:44:54+00:00 2026-06-15T22:44:54+00:00

I have divisions( same width and height ) with image( different width and height

  • 0

I have divisions(same width and height) with image(different width and height). I try to center on that image inside the division. so use

{ text-align: center}

here the image comes center but top value is not changed.

Here the eg image what i exactly need.

enter image description here

Here the jsfiddle what i tried. I am waiting for your advice.
Thank you.

  • 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-15T22:44:55+00:00Added an answer on June 15, 2026 at 10:44 pm

    You can use display:table-cell to align the inner images to middle of the div.

    But in this case you cant give margin because table-cell forces div to act as a td and technically you cant give margin to table td.

    So I have added border to div with white color.

    CSS

    .background-image{
        width: 150px;
        height: 160px;
        background: #C8BFE7;
        text-align: center;
        display:table-cell;
        vertical-align:middle;
        border:white 5px solid
    }
    ​
    

    DEMO

    ——————————OR—————————————-

    You can add an outer div to each div and specify margin to outer div.

    CSS

    .outer{margin: 0 0 10px 10px; display:inline-block}
    .background-image{
        width: 150px;
        height: 160px;
        background: #C8BFE7;    
        text-align: center;
        display:table-cell;
        vertical-align:middle;
    }
    ​
    

    DEMO 2

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

Sidebar

Related Questions

I have a division operation inside a cycle that repeats many times. It so
I have one input field and one division with span children <input type=text id=input
First of all, I don't have multiplication, division operations so i could use shifting/adding,
I have separated my screen into 4.I like to use the same static variable
I have just implemented these ToggleButtons using ControlTemplates that set the Image content according
i have table with same fields,want to update that fields,with where clause, update tmp_aus_inv_data
I need to have some float divisions that must be accurate like double version
Scenario: I have a customer object with lazy loading enabled. I use that throughout
I have a real entity Division under database model (EF 4.0). Also I have
I have trouble figuring out why a simple division like this one always returns

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.