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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T23:30:09+00:00 2026-05-31T23:30:09+00:00

I would like to use a very wide image on my website. There is

  • 0

I would like to use a very wide image on my website. There is one main item on the image, the rest is sort of a background. But I would like this main item to be aligned at all times, while the image should show the more or less background depending on how wide the window size is…

I’ve tried to make it clear in an image:
enter image description here

So, the red border is the whole image (it had a width of 4000px) but it has only one main item on it. In my case a photo of a girl. The background (everything inside the red border besides the green border) is filled with some flowers. What I want is to be the girl (green border) to be aligned in the middle by all means. And depending on the size of the window, the flowers should be more or less visible (but without a scrollingbar).

But I don’t have any idea how to do this… Anyone with advice?

enter image description here

  • 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-31T23:30:10+00:00Added an answer on May 31, 2026 at 11:30 pm

    If it’s a single decorative image, then you can use:

    background-image: url(whole.jpg) 50% 50% no-repeat
    

    Adjust the first percentage if your interesting part of the image is not exactly in the center.

    If you’d like to use a separate <img> for the girl, and separate image for the flowers, then use one of the usual vertical-CSS-centering hacks for the <img> e.g.

    #container {position:relative; overflow:hidden}
    #container img {position:absolute; top:50%; left:50%; 
        margin-top:-half-of-image-in-px; margin-left:-half-of-the-image-in-px;}
    

    and the former style for the background.

    If you want to be cutting-edge, you can use CSS3 object-fit property.

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

Sidebar

Related Questions

I am very new to Visual Studio but i would like to use it
I am (very) new to qmake, but i would like to use qmake to
I would like to use R to generate a very basic world map with
I know this is very basic. I would like to use jQuery to change
For class, I would like a to use PHP MVC framework very similar to
I would like to use the logout function from Django but not sure how
i would like to use jquery ui selectmenu from felixnagel. it works but i
I would like to use the boot() and boot.ci() functions from library(boot) for very
I have a very uncommon font that I would like to use for a
I have an array of Integers in Java, I would like use only a

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.