To center a div both horizontally and vertically, we use flex. if you want the full code , here it is : <! DOCTYPE html > < html lang = "en" > < head > < style > body { margin : 0 ; overflow : hidden ; } #centered { width : 100 ; height : 99vh ; display : flex ; justify-content : center ; align-items : center ; } </ style > < meta charset = "UTF-8" > < meta name = "viewport" content = "width=device-width, initial-scale=1.0" > < title > yt </ title > </ ...
Comments
Post a Comment