2014-05-19 3 views
2

하여 두 iframe을 측을 넣어하는 방법 : 누군가가 나를 위해이 문제를 해결할 수 있는지나는이 같은 몇 가지 코드를 시도 측면

<div class="box"><iframe src="https://embed.spotify.com/?uri=spotify:user:1290230929:playlist:6nTIVNGZfnZ4urUiwHIgpT" 
         frameborder="0" 
         scrolling="no" 
         width="100%" 
         height="512" 
         align="left"> </iframe> </div> 
<div class="box"><iframe src="https://embed.spotify.com/?uri=spotify:user:1285279066:playlist:56KI83cMiMTOocIdXq2R5j" 
         frameborder="0" 
         scrolling="no" 
         width="100%" 
         height="512" 
         align="right"> 
    </iframe> 

을 그리고 나란히 작동하지 않습니다, 감사합니다.

답변

1

문제는 여기에 있습니다 :

enter image description here

width 100 %? 그리고 왜 div에?

이 시도 (이 방법은, 그들은 측면 :-) 나란히 없을 것) : 여기

http://jsbin.com/hirirazu/3/edit

enter image description here

6

당신이 이동합니다. div에 float 사용 다음 번에 게시하기 전에 검색을 기본으로 사용하십시오.

HTML :

<div class="box"><iframe src="https://embed.spotify.com/?uri=spotify:user:1290230929:playlist:6nTIVNGZfnZ4urUiwHIgpT" frameborder="0" scrolling="no" width="100%" height="512" align="left"> </iframe> </div> 

<div class="box"> <iframe src="https://embed.spotify.com/?uri=spotify:user:1285279066:playlist:56KI83cMiMTOocIdXq2R5j" frameborder="0" scrolling="no" width="100%" height="512" align="right"> 
    </iframe> 

CSS :

.box{ 
    float:left; 
    margin-right:20px; 
} 
.clear{ 
    clear:both; 
} 

http://jsfiddle.net/E5WFT/

2

1.가 iframe을에서 width="100%"를 제거합니다.

두 번째 iframe을 완전하게 나란히 배치하려면 align="right"에서 align="left"으로 변경하십시오.

3.이 CSS를 추가

.box { display:inline-block; } 

DEMO

0

폭이 100 % 인 곳은 iframe 대응의 폭이 100 %임을 상태로이 작동하지 않을 수 있습니다 몸. 또한 인라인 스타일을 사용하지 마십시오. 가능한 한 많은 스타일이 지원되지 않을 예정입니다.

관련 문제