小div在大div中水平垂直居中(两个div都固定宽高)

方法一:儿子绝对定位或相对定位,这样儿子脱离标准流,父亲有固定宽高,用儿子的margin去挤父亲 <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <title>Title</title> <style> .father{ width: 600px;
相关文章
相关标签/搜索