current position:Home>CSS box centered

CSS box centered

2022-04-29 15:13:00Elephants and ants

0.CSS Centering method of

CSS The center in can be divided into horizontal center and vertical center . Horizontal centering can be divided into two cases: in line element centering and block element centering , The block elements are divided into fixed width block elements in the middle and variable width block elements in the middle

1. Center up, down, left, right

div { 
    
position:fixed;
margin:auto;
left:0;
right:0;
top

copyright notice
author[Elephants and ants],Please bring the original link to reprint, thank you.
https://en.qdmana.com/2022/04/202204291512574951.html

Random recommended