IT/- 프로그래밍
HTML5/CSS3 div 블록 레이아웃 가운데 정렬하기
혁준7519
2017. 6. 11. 16:45
div 블록 레이아웃 가운데 정렬하기
html)
width를 지정하고 margin : 0 auto를 준다
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 | <!DOCTYPE html> <html> <head> <meta charset="utf-8"> <meta name="viewport" content="width=device-width, height=device-height, minimum-scale=1.0, maximum-scale=1.0, initial-scale=1.0"> <title>Insert title here</title> <style> div { margin: 0 auto; background : #FFD8D8; width : 50%; height : 300px; } </style> </head> <body> <div></div> </body> </html> | cs |
결과