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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T20:15:17+00:00 2026-06-13T20:15:17+00:00

Ok, so I have a section in a page (wordpress) <header id=masthead role=banner> <div

  • 0

Ok, so I have a section in a page (wordpress)

<header id="masthead" role="banner">
    <div id="header_fix"></div>
</header>

and the css

#masthead {
    width: 100%;
    margin-left: auto;
    margin-right: auto;
    background-repeat:no-repeat;
    background-size:cover;
    padding: 70px 0;
} 
#header_fix {
    margin: 0 auto;
    width: 1355px;
    height: 164px;  
    text-align: center;
    background-image:url(images/Banner_SF.png);
    /*background-size: contain;*/
}

I want to have the header_fix div overflow the parent header (the head_fix fiv image is a really long banner, like 1800px), and always aligns the center of the div (and therefore the center of bg-image) to the center of the window.

    ______________________________________
    |    masthead always window width     |
____|_____________________________________|___
|   |     header_fix always centered      |   |
|___|_____________________________________|___|
    |                                     |
    |_____________________________________|

tried variety of things… is it something to do with parent-child relationship? like is header just not treated like a div, or at least needs display:block; or something? any help appreciated.

  • 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-13T20:15:19+00:00Added an answer on June 13, 2026 at 8:15 pm

    You don’t need the extra element. You can just use background-position to center your background image. It will already be the same size as the source image.

    Here it is in shorthand:

    #masthead {
        width: 100%;
        margin: auto;
        background: url(images/Banner_SF.png) no-repeat center top;
    }
    

    To answer your other questions: No, the <header> element is not rendered differently from a normal <div> element, other than it not being supported in some browsers. It is still a block-level element by default.

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

Sidebar

Related Questions

I have scripts in my ASPX page, in the header section. I want to
I have a div like this <section class=item_container> <article class=item> <h2>Page Title</h2> <p><a class=delete_page
I have a section on a page where a user can change their username.
On my page I have a section where I would like to pull in
On a blog detail page, I have a tags section. The html looks like:
I have a wordpress site, and in the home page , there is side
I have setup a custom post type in Wordpress. It is a section where
I have recently set up my wordpress site, but the comments section below each
I have a page.php template and I want the first section to be wrapped
I have a wordpress website where in post page I have a jquery fixed

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.