북

노란색박스가 가운데로 오게하려면 어떻게 하나요?

· 2016-03-09 (수) 11:31:22 · 1253 · 2

<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>무제 문서</title>
<style type="text/css">

body {
 margin:0;
 width:100%;
 background-image: url();
}

.main_wrap{
width:100%;


background-color:red;
valign:top; 
height:300px;
}
.main_wrap .inner{
width:50%;
float:center;
height:100px;
background-color:yellow;
valign:top; 
}
-->
</style>
</head>

 

 

<body  leftmargin="0" topmargin="0" marginwidth="0" marginheight="0">


  
  <!-- 메인 --> 
  
  <div class="main_wrap">
  <div class="inner">
   
  sorry.
  

</div> 

</div>

</body>
</html> 

 

-------------------------------------

노란색박스 float:center; 해주는데도 가운데로 안와요..

그리고

 

  .main_wrap .inner{

 

는

.main_wrap {}

.inner{ }

 

분리해도 상관없나요? 어떤차이가 있는지요?

 

|

댓글 2개

float:center ----> margin:0 auto; 로 한번 해보시고요

.main_wrap .inner{ 이거는 main_wrap 안에 있는 inner 만 적용 될거고요

그냥 .inner 는 inner라는 클래스에 다 적용될 거고요

맞겠죠?
감사합니다~~~~~!!
댓글을 작성하시려면 로그인이 필요합니다.

토크

3,606건

오픈소스 관련 다양한 이야기를 자유롭게 나눠요

+
제목 글쓴이 날짜 조회
16-05-16 조회 2,324
16-05-15 조회 1,547
16-05-12 조회 1,397
16-05-11 조회 1,195
16-05-11 조회 1,301
16-05-11 조회 1,445
16-05-04 조회 1,384
16-05-01 조회 1,216
16-04-28 조회 1,493
16-04-27 조회 1,939
16-04-01 조회 1,966
16-04-12 조회 1,271
16-03-31 조회 1,313
16-03-29 조회 1,678
16-03-11 조회 2,113
16-03-10 조회 1,352
16-03-09 조회 1,817
16-03-09 조회 1,254
16-02-18 조회 1,968
16-02-16 조회 1,654
16-02-03 조회 1,478
16-02-02 조회 1,869
16-03-21 조회 1,393
16-03-21 조회 1,227
16-03-19 조회 1,284
16-03-19 조회 1,387
16-03-17 조회 1,129
16-03-17 조회 1,028
16-03-14 조회 1,261
16-03-13 조회 1,092