Answers for "align css element"

CSS
1

center css elements

body{
  display: grid;
  place-items: center;
}
Posted by: Guest on November-11-2020
2

how to horizontal center a div in css

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

center a div

<div id="outer">
  <div id="inner">Foo foo</div>
</div>
//css:, demo with border
<style>
#inner {
  display: table;
  margin: 0 auto;
  border: 1px solid black;
}

#outer {
  border: 1px solid red;
  width:100%
}
</style>
Posted by: Guest on August-20-2020

Browse Popular Code Answers by Language