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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T07:59:31+00:00 2026-06-15T07:59:31+00:00

I am doing a website in wordpress. And under the navigation I have container(id=cover_photo)

  • 0

I am doing a website in wordpress. And under the navigation I have container(id=”cover_photo”) for image(id=”cover_photo_image).I center it with margin but I want to move it down, and center it in the container, but the container follow if I put margin on it.

HTML

    <div id="cover_photo">
        <p id="cover_photo_image">
        </p>
    </div>

CSS

#cover_photo {
    width: 100%;
    height: 278px;
    background-color: #6b0c0b;
    box-shadow: inset 0px 0px 3px 0px #888, 0px 0px -3px 0px #888;
}

p#cover_photo_image {
    width: 821px;
    height: 172px;
    display: block;
    margin: 0 auto;
    margin-top: 6px;
    background-image: url(images/cover_photo.png);
}
  • 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-15T07:59:32+00:00Added an answer on June 15, 2026 at 7:59 am

    Plopped your code into a fiddle and saw what you mean. The problem is that you haven’t set positioning for #cover_photo or #cover_photo_image. The outer element needs to be relative, the inner needs to be an absolute.

    #cover_photo {
    position: relative;
    }
    
    p#cover_photo_image {
    position: absolute;
    }​
    

    I changed the sizes so it would fit into the preview, and if you try adjusting the margin values it should move around and not move the #cover_photo container.

    http://jsfiddle.net/ESCNm/

    Just in case you’re are looking to automatically vertically and horizontally align an element within an element, there are a LOT more methods that manual positioning. Manual positioning is such a hassle, and I try to avoid absolutes whenever possible.

    Here an article about it: http://www.vanseodesign.com/css/vertical-centering/

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

Sidebar

Related Questions

I have a website based on wordpress. I want to implement a click tracking
I have a website, with a user system. I want to integrate wordpress's user
I'm doing the migration of a site, from MovableType to WordPress. The website contain
I have a WordPress driven website and I need to be able to close
I recently redesigned my college newspaper's website and have been doing everything I can
I've created a hover effect for my website navigation. http://www.preview.brencecoghill.com/ I have got the
I've been designing a website with Wordpress and began doing testing in different browsers,
I'm having magento ecommerce website & wordpress blog site. I want to display recent
OK, so I have this website I maintain, uses WordPress, etc. One of the
I am doing a website in cakephp. I have a toolbar on the top

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.