Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR CSS

center div using flex

<div class="container">
  <div class="item"></div>
</div>

div.container {
  background: gray;
  width: 80px;
  height: 80px;
  display: flex;
  justify-content: center;
  align-items: center;
}

div.item {
  background: silver;
  width: 30px;
  height: 30px;
}
Source by learnlayout.com #
 
PREVIOUS NEXT
Tagged: #center #div #flex
ADD COMMENT
Topic
Name
3+3 =