css 질문좀 드립니다.

css 질문좀 드립니다.

QA

css 질문좀 드립니다.

본문

안녕하세여


css질문좀 드릴려고요 ㅠ


table 태그만 쓰다가 css를 배워보려고 공부중인데


보시는것처럼


가로 세로 100% (흰색으로..) 된


 화면 세로 정중앙 (세로 중앙)에 검정색 라인을 위치시키려 합니다..



<style>

#intro_wrap {width:100%;height:100%;background:#ffffff top center repeat-y;}
#intro_line {width:100%;height:220px;background:#000000 center middle repeat-x;vertice-align:middle}

</style>


<div id="intro_wrap">
 <div id="intro_line">
 </div>
</div>


잘안되는데 도움좀 주십시옹 ㅠㅠ


제목 없음-1.jpg
 

이 질문에 댓글 쓰기 :

답변 3


<style>
html {100%}
body {100%;margin:0}
#intro_wrap {width:100%;height:100%;background:#ffffff top center repeat-y;}
#intro_line {width:100%;height:220px;background:#000000 center middle repeat-x;vertice-align:middle;position:absolute;top:50;margin-top:-110px;}
</style>

<div id="intro_wrap">
 <div id="intro_line">
 </div>
</div>


html과 body에 height 100%를 잡지 않으면 div height 100%가 인시되지 않습니다.

line 경우에는 전체 height에서 50%만큼 top에서 포지션을 준 후, height/2 를 빼주시면 가운데 배치가 됩니다.

html5 로 작업하시면 

#intro_line {width:100%;height:220px;background:#000000 center middle repeat-x;vertice-align:middle;margin:auto 0;} 

이 될지는 안해봤습니다만.. 되지않을까요 ㅋ

<div id="intro_wrap">dd
 <div id="intro_line">dd
 </div>
</div>
<style>
#intro_wrap {width:100%;height:100%; padding:50px 0; background:#ffffff top center repeat-y;}
#intro_line {border:1px solid #000; background:#000; text-align:center; }
</style>

이렇게 하시면 됩니다

단어를 정렬하려면 텍스트 - 위치 : (어디?)

이렇게 사용해야되고

float:left; 같은 css 코드는 위치:(어디?) 입니다.
답변을 작성하시기 전에 로그인 해주세요.
전체 123,591 | RSS
QA 내용 검색

회원로그인

(주)에스아이알소프트 / 대표:홍석명 / (06211) 서울특별시 강남구 역삼동 707-34 한신인터밸리24 서관 1404호 / E-Mail: admin@sir.kr
사업자등록번호: 217-81-36347 / 통신판매업신고번호:2014-서울강남-02098호 / 개인정보보호책임자:김민섭(minsup@sir.kr)
© SIRSOFT