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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 19, 20262026-05-19T22:01:37+00:00 2026-05-19T22:01:37+00:00

<div id=photo_leftPanel style=float: left; width: 604px; position: relative;> <img src=bla.jpg> </div> How can i

  • 0
<div id="photo_leftPanel" style="float: left; width: 604px; position: relative;">
<img src="bla.jpg">
</div>

How can i make the image start from the middle of this box? (middle both vertical and horizontal)

  • 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-19T22:01:37+00:00Added an answer on May 19, 2026 at 10:01 pm

    There are several ways to do this, and if it needs to work in all browsers (IE7+ and the rest) you need to do different things to make it work in some of the cases.

    1. Use absolute position. This only works if you know the size of the image.
      Here you set it to position: absolute; left: 50%; top: 50%; margin: -<half height of image> 0 0 -<half width of image>.

      See example here: http://jsfiddle.net/JPch8/

    2. Use margin: 0 auto;text-align: center; and line-height/font-size.
      This is a bit more tricky, since line-height doesn’t work as it should in IE for inline-block elements like images. That’s where the font-size comes in.
      Basically, you set the line-height of the image container to the same as the container’s height. This will vertically align inline elements, but in IE you need to set the font-size instead to make it work.

      See example here: http://jsfiddle.net/JPch8/2/

    3. In modern browsers that support display: flex you can do it by simply setting the container div to display: flex; align-items: center; justify-content: center;

      See example here: https://jsfiddle.net/ptz9k3th/

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

Sidebar

Related Questions

I have this HTML code: <div id=content> <div class=profile_photo> <img style=float:left;margin-right:7px; src=http://gravatar.com/avatar/53566ac91a169b353a78b329bdd35c95?s=50&d=identicon class=profile_img alt={username}/>
<div class=item> <p><img src=images/photos_sample1.jpg border=0 rel=images/google_map.jpg></p> <p>Dining Area</p> </div> <div class=item> <p><img src=images/photos_sample2.jpg border=0
HTML: <div id=media-photo> <img src=/uploads/photos/16.jpg alt= /> </div> <a href=/uploads/photos/5.jpg class=img> <img src=/uploads/photos-thumbs/5.jpg alt=
var data = <div><table width='100%'><tr><td align='right' ><div class='close16'/></td></tr></table><div><table><tr><td rowspan='4' width='50px;'><img src=' + staffItem.Photo +
I have... <div id=tabs> <!-- ... --> <div id=interior-photo> <img src=...> </div> <!-- ...
CSS: .posting-logo-div { } .posting-logo-img { height: 120px; width: 120px; } .posting-photo-div { height:
I have the following markup: <div class=user-photo> <img src= /> </div> I want to
i have some photos: <div class=photo> <a rel=example_group href=http://download.com/79.jpg><img class=edit_multimedia_img src=http://download.com/79.jpg></a> <a rel=example_group href=http://download.com/80.jpg><img
I have this: <div id=userPhoto> <a href=profil.php?id=<?php echo $sid; ?>> <img src=images/profilePhoto/thumbs/<?php if($vP[photo]){ echo
div#thing { position: absolute; top: 0px; z-index: 2; margin: 0 auto; } <div id=thing>

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.