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

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

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

토크

개발과 관련된 어떤 얘기도 괜찮습니다.

+
제목 글쓴이 날짜 조회
14년 전 조회 1,889
14년 전 조회 2,009
14년 전 조회 1,698
14년 전 조회 1,705
14년 전 조회 1,990
9년 전 조회 1,025
9년 전 조회 1,131
9년 전 조회 1,467
9년 전 조회 1,257
9년 전 조회 1,089
9년 전 조회 1,199
9년 전 조회 1,841
9년 전 조회 1,585
10년 전 조회 1,375
10년 전 조회 1,490
10년 전 조회 2,097
10년 전 조회 3,835
10년 전 조회 1,705
10년 전 조회 1,722
10년 전 조회 1,521
10년 전 조회 1,564
10년 전 조회 1,547
10년 전 조회 2,842
10년 전 조회 1,516
10년 전 조회 3,051
10년 전 조회 1,390
10년 전 조회 1,912
10년 전 조회 2,141
10년 전 조회 2,678
10년 전 조회 1,640