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

  • Home
  • SEARCH
  • 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 7780305
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T18:51:12+00:00 2026-06-01T18:51:12+00:00

How does facebook vertically align its photos? I inspected their img tag and its

  • 0

How does facebook vertically align its photos? I inspected their img tag and its parent. The parent doesn’t use padding and the img doesn’t use margins. There is vertical-align, but I don’t think it applies in this case(see Image not vertical-align:middle). I normally vertically align using margins (and sometimes with javascript) so I’m interested in how facebook does it without padding or margins. Does anyone know how they do it?

  • 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-01T18:51:14+00:00Added an answer on June 1, 2026 at 6:51 pm

    After doing some research in facebook’s website i found the answer,here is the code

    <!DOCTYPE html>
     <html>
     <head>
    <style type="text/css">
            .img_contain {
    
                height: 700px;
                text-align: center;
                line-height: 700px;
                border: #333333 1px solid;
            }
            .img_contain img {
                display: inline-block;
                vertical-align: middle;
            }
    
        </style>
    </head>
    <body>
        <div class="img_contain">
            <img src="images/image.jpg" />
        </div>
    </body>
        </html>
    
    
    Only thing i was missing is adding <!DOCTYPE html> at the top of the document.Now its working.
    

    And one more thing the height and line-height of the parent should be equal and it should be greater than height of the image it contains

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

Sidebar

Related Questions

How does Facebook structure their data for messages. I have heard they use Cassandra
Anyone know what tool does facebook use for uploading multiple photos? It is so
Facebook does not allow callbacks on ip addresses. So how does one test their
Similar to what Facebook does on its newsfeed, I want to allow commenting on
Does their API allow my Facebook-connected user to add a friend?
The following code doesn't work. How does Facebook do this? Is there any way
Does Facebook in its gallery put image width and height in database? Using JavaScript,
I just want to know what tech does facebook use to show the posts
How does facebook take care of their real-time data? if you're viewing your activity
Does Facebook provide a URL the user can access that will take him to

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.