Using Flexbox
/* Method 1 - Centering DIV using Flexbox */
.div1 h1{
display: flex;
justify-content: center;
align-items: center;
flex-direction: column;
}
Using Grid
/* Method 2 - Center DIV using Grid */
.div2 h1{
display: grid;
place-content: center;
}
So simple 😀
And make sure to center(align-mind: center
)😜 your focus towards my YouTube Channel
Top comments (3)
cool
Thank you 🙂
can you please remove the JS tag?