div {
width: 100%;
height: 200px;
display: flex;
justify-content: center;
align-items: center;
background: blue;
}
text {
background: orange;
}
<div>
<text>Centered horizontally and vertically</text>
</div>
h1{text-align: center;}
Code Example |
---|
Css :: set border only left and right css |
Css :: css darkmode |
Css :: how to disable margin collapsing |
Css :: css lighten function |
Css :: how to push text to the right css |
Css :: avoid side scrolling css |
Css :: disable right click with css |
Css :: center a button wordpress |
Css :: how to scale a bg image acc to size of div |
Css :: html center image |
Css :: how to wrap text in css |
Css :: for sass |
Css :: css background properties |
Css :: black gradient background effect |
Css :: how to create space inbetween text css |
Css :: color code for cyan |
Css :: css checkbox':checked change color |
Css :: css light grey |
Css :: gradient 3 colors |
Css :: css change the button text value |
Css :: glass css |
Css :: what port does wss use |
Css :: add css to express app |
Css :: media screen hp |
Css :: css wrap |
Css :: h2 in px css |
Css :: wordpress remove sticky header |
Css :: removing space between words css |
Css :: media-queries |
Css :: input area bootstrap highlight |