.container{
display:bock;
width:fit-content;
margin:auto;
}
// add to the parent element
.parent {
display: grid;
place-items: center;
}
body{
display: grid;
place-items: center;
}
.element {
position: absoloute;
margin: auto;
left: 0;
right: 0;
top: 0;
bottom: 0;
}
/* CSS */
.mx-auto {margin-left: auto;margin-right: auto;}
<!-- HTML -->
<div class="mx-auto">
<!-- content -->
</div>
element {display: block; float: left; vertical-align: middle; text-align: center}
Not so easy huh?
.element {
margin: auto;
}
Code Example |
---|
Css :: ionic ios remove button appearance |
Css :: css text vertical spacing |
Css :: html button scale to fit text |
Css :: style scroll bar css |
Css :: how to increase height of input box in css |
Css :: css selected color |
Css :: Find element that is causing overflow css |
Css :: make an image smaller css |
Css :: remve arrow from input ype number |
Css :: css fit iframe to div |
Css :: css flip text |
Css :: how to make auto scroll to the end in css |
Css :: css clearfix |
Css :: css position sticky |
Css :: table td data in middle |
Css :: onclick jquery add css |
Css :: css div went over top menu |
Css :: css bg code |
Css :: change bot description background top.gg |
Css :: css counters |
Css :: border radius 4 values |
Css :: add more than 2 css jquery |
Css :: input outline focus |
Css :: normalize css npm |
Css :: hidden vs visible |
Css :: making a circle css |
Css :: row reverse grid |
Css :: webpack/load/css |
Css :: rotate image in css |
Css :: border width css |