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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T19:29:59+00:00 2026-05-30T19:29:59+00:00

I am wondering if the div in this css and html will stay at

  • 0

I am wondering if the div in this css and html will stay at the center if I i view this site on a larger screen. since I am only working on a 16 inch screen/ monitor. will the div in this code will stay at the center even if I move or view it in a larger/different screen? ?

The Html

<html>
 <head>
  <title>Midterm Practice</title>
  <link rel = "stylesheet" type = "text/css" href = "layout.css"/>
 </head>
  <body>
    <div id = "container">
      <div id = "navbar">
        <ul>

        </ul>
      </div>
    </div>
  </body>
</html>

The CSS rules

body{background-color: pink;}
#container{background-color: white;margin-left: auto;margin-right: auto;border: 1px solid white;border-radius: 15px;width: 1000px;height: 800px;}
#navbar{position:absolute;}

I am just starting out with CSS please don’t add advance or above average answers

  • 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-30T19:30:01+00:00Added an answer on May 30, 2026 at 7:30 pm

    Using margin-left: auto; margin-right: auto; should have the desired effect for you. They will basically centre the “container” div in the body tag. You could always test it out yourself by reducing the width of the container to something you can test in your browser (Chrome and Firefox’s dev tools are useful for playing with CSS within the browser).

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

Sidebar

Related Questions

I was wondering how they fixed this kind of effect: On scroll to <div
I was wondering how to toggle a child div only, clicking in a button
I'm wondering why $this->Form->select() in CakePHP 2.1 doesn't come with a wrapping div and
I was wondering if it's possible to create a HTML div container with some
I have the follow HTML <div>This is some <span>special <a href=#>text</a></span> and it's super</div>
I'm building an html5/js/css application that will exist inside of a div on my
I have the following HTML (excerpt from larger code-base) <div class=diary-event ui-corner-all title=[title]> <span
I have this css styling and was wondering what I need to change in
I am wondering which selector is better practice and why? Sample HTML Code <div
So I have simplified my example down to this: <html> <head> <link type=text/css rel=stylesheet

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.