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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T22:48:28+00:00 2026-05-30T22:48:28+00:00

This has probably been done before but I can’t find a solution for my

  • 0

This has probably been done before but I can’t find a solution for my specific case. I have the following:

<div class="holder" style="height:260px;width:260px;">
<a href="#"><img src="image.jpg" /></a>
</div>

How can I get the image to align into the middle of the div?

  • 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-30T22:48:29+00:00Added an answer on May 30, 2026 at 10:48 pm

    Normally, img is an inline-element, which means, that it’s being aligned to the baseline of the text of your parent-element. This leaves a nasty space underneath your image.

    You can prevent this with

    img{
       display:[inline-]block; /* or inline-block if the img isn't the only element in your div*/
    }
    

    This removes the reserved space underneath the image.

    you can change the alignment by

    img{
       vertical-align: [top|middle|bottom|baseline|...] ;
    }
    

    to align it according to your text.

    In general, you can only vertical-align inline elements. So an image with display:block won’t be affected by a vertical alignment declaration.

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

Sidebar

Related Questions

This has probably been answer already but I am trying to return the primary
This probably has a simple answer, but I must not have had enough coffee
I'm sure this has already been done, but Google isn't helping me - I'm
This is probably a simple question but i've been unable to find a quick
This is probably a stupid question, but I haven't done this before in Svn.
So, I know this has been done to death but all the answers I've
Ok, this probably has a really simple answer, but I've never tried to do
This is probably a silly question, but curiosity has gotten the better of me.
I fear this is probably a bit of a dummy question, but it has
This has been driving me crazy for a few days. Why doesn't the following

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.