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

<!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라는 클래스에 다 적용될 거고요

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

퍼블리셔톡

+
제목 글쓴이 날짜 조회
9년 전 조회 290
9년 전 조회 282
9년 전 조회 224
9년 전 조회 1,258
9년 전 조회 432
9년 전 조회 506
9년 전 조회 661
10년 전 조회 624
10년 전 조회 667
10년 전 조회 668
10년 전 조회 1,055
10년 전 조회 582
10년 전 조회 1,045
10년 전 조회 565
10년 전 조회 603
10년 전 조회 1,282
10년 전 조회 1,534
10년 전 조회 812
10년 전 조회 1,338
10년 전 조회 1,045
10년 전 조회 1,072
10년 전 조회 1,423
10년 전 조회 1,340
10년 전 조회 885
10년 전 조회 1,052
🐛 버그신고