CSS 스타일시트에서 margin vertical-align 속성에 관하여.. 채택완료
홈짱닷컴
11년 전
조회 5,635

#title {float:left; width:180px; height:30px; margin:0 auto; text-align:center; vertical-align:middle; display:table-cell; background-color:red; }.banner { margin:30px 0 0 0; width:180px; text-align:center; clear:both;} .banner span { width:180px; height:30px; cursor:pointer;background-color:#1e4e9d; color:white; font-family:arial; display:inline-block; border-radius:0px; border:0px solid; padding-top:12px;} .banner span a { color:white; text-decoration:none;} .banner span a:hover { color:yellow; text-decoration:none;}배너 모음
왜 위 붉은색의 margin 값과 하늘색의 vertical-align이 적용 안 되는 걸까요?
즉,
margin 상단 값을 아무리 많이 줘도 파란색과 빨간색이 떨어지지 않습니다. ㅜㅜ
또, 빨간색 안의 글자들을 수직으로 중앙에 위치시키고자 하는데 vertical-align이 적용이 안되네요.
원인은 무엇이며, 해결책은 어떻게 될까요?
댓글을 작성하려면 로그인이 필요합니다.
답변 2개
답변을 작성하려면 로그인이 필요합니다.
로그인
근데, margin 속성이 적용 안되는 이유는 알 수 없을까요?