Answers for "center div in center of page"

CSS
3

css center div in page

.center {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
  }
Posted by: Guest on July-02-2021
-1

how to put container in center of page

#container
{
    width: 400px;
    margin-left: auto;
    margin-right: auto;
}
Posted by: Guest on November-09-2020
2

how to horizontal center a div in css

#inner {
  width: 50%;
  margin: 0 auto;
}
Posted by: Guest on June-18-2020
8

css center div

<!-- 
	 Simple CSS CENTER DIV Example
 	 
	 * See Fiddle in link for PoC *
-->

<div class="parent">
  <div class="child">
    <p>
      Eh Up Me Duck!
    </p>
  </div>
</div>

<style>
.parent {
  /* Just for aesthetics: see fiddle */
  border: 1px solid black;
  padding: 2px;
}

.child {
  border: 1px solid red;
  width: 50%;
  
  /* This is where the magic happens */
  margin-left: auto;
  margin-right: auto;
  /**********************************/
}

p {
  /* As you do */
  text-align: center;
}
</style>
Posted by: Guest on February-23-2020
3

how to center a div

margin:auto
Posted by: Guest on August-13-2020
0

how to put container in center of page

div.InSkinAlignCenter {
margin: 0 auto;
}
Posted by: Guest on November-09-2020

Browse Popular Code Answers by Language