css 질문좀 드립니다.

매출이 오르면 내리는 수수료! 지금 수수료센터에서 전자결제(PG)수수료 비교견적 신청해 보세요!
css 질문좀 드립니다.

QA

css 질문좀 드립니다.

답변 3

본문

안녕하세여


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 코드는 위치:(어디?) 입니다.
답변을 작성하시기 전에 로그인 해주세요.
QA 내용 검색
질문등록
전체 73
© SIRSOFT
현재 페이지 제일 처음으로