display, float, clear

display, float, clear


1. display


block의 정렬은 float  
inline의 요소의 정렬은 text-align


ps. block의 중앙정렬은 정렬을 원하는 block요소에서 margin: 0 auto;를 해주면 중앙 정렬이 된다
단  block의 특성상 width값을 줘야중앙정렬이 된다.



2. float

 block의 정렬을 담당

Attribute
-noneDefault. Object displays where it appears in the text.
-leftText flows to the right of the object.
-rightText flows to the left of the object.



float는 왼쪽으로 붙을지 오른쪽으로 붙을지 결정

float해준 다음 Element 녀석들은 무조껀 그 효과로 인해서 붙어버린다.

이것을 미연에 방지하기위에서 clear을 해주는것이다.
2. clear
clear Attribute
-noneDefault. Floating objects are allowed on both sides.
-leftObject is moved below any floating object on the left side.
-rightObject is moved below any floating object on the right side.
-bothObject is moved below any floating object.

 float된  초기화 

clear:left; : 왼쪽으로 붙은 녀석들만 원래대로
clear:right; : 오른쪽으로 붙은 녀석들만 원래대로
clear:both; 다 떨어져 !
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////



First