2010-07-29 6 views
0

2 개의 div가 있습니다. 각 div에는 배경 이미지가 있으며 나란히 배치해야합니다. 그러나 어떤 이유로 그들은 수직으로 올라가고 있습니다. 반면에 저는 그것들을 수평 적으로 원합니다.div 위치가 올바르게 지정되지 않았습니다.

두 div에 대한 코드는 다음과 같습니다. 이 문제를 어떻게 해결할 수 있습니까?

#header 
{ 
top: 40px; 
width:310px; 
height: 90px; 
background: url(Images/logo.jpg) no-repeat; 
} 
#logo 
{ 
top: 40px; 
left: 3200px; 
height: 100px; 
background: url(Images/banner.jpg) no-repeat; 
} 
+0

당신이뿐만 아니라 HTML을 게시 할 예정 있으면 알려 주시기 havent 한? – kbrimington

+0

로고의 경우 "왼쪽"은 3200px입니까? – Hoque

답변

1
<div id="header-container"> 
<!-- stick your HTML here --> 
</div> 

    #header-container { overflow:hidden; zoom:1; } 

는 이러한 속성을 추가 할 CSS를 수정 :이 가정

#header { float:left; } 
    #logo { float:left; width:[the width] } 

그들은 형제 자매 그리고 그들은 서로의 내부 없습니다.

0
<div id="header-wrapper"> 
    <div class="header">hello</div> 
    <div class="logo"></div> 
    </div> 

통해 UR CSS : 또한 작동합니다

/* this width = .header + .logo + any left or right padding on them.. or it can be 100% */ 
    #header-wrapper {width: 1000px;} 

    .header {background: url(Images/logo.jpg) no-repeat; width:500px;height:90px;float:left;} 
    .logo {background: url(Images/banner.jpg) no-repeat;width:500px; height:90px;float:left;} 

, 그래서 테스트는하지 않습니다

관련 문제