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

<!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년 전 조회 2,989
9년 전 조회 2,003
9년 전 조회 1,463
9년 전 조회 1,975
9년 전 조회 1,954
9년 전 조회 2,499
9년 전 조회 1,766
9년 전 조회 2,640
9년 전 조회 1,846
9년 전 조회 1,537
9년 전 조회 1,230
9년 전 조회 1,676
9년 전 조회 1,781
9년 전 조회 1,787
9년 전 조회 1,200
9년 전 조회 1,918
9년 전 조회 4,853
9년 전 조회 1,348
9년 전 조회 1,197
9년 전 조회 1,255
9년 전 조회 1,828
9년 전 조회 1,963
9년 전 조회 1,323
9년 전 조회 1,765
9년 전 조회 2,019
9년 전 조회 1,656
9년 전 조회 1,169
9년 전 조회 1,157
9년 전 조회 1,158
9년 전 조회 2,710