2013-05-09 40 views
0

我有三個div S和這個谷歌地圖iframe代碼與下面的CSS:三的div的響應IFRAME

#contact_map { border-radius: 200px; width: 320px; height: 320px; overflow: hidden; max-width: 100%; position: relative; right: 0px; } 
#contact_map_fake { border-radius: 200px; width: 320px; height: 320px; top:0px; 
    box-shadow: inset 0px 3px 5px 1px rgba(0, 0, 0, .5); pointer-events:none; position: absolute; border: 1px solid rgba(255,255,255,.6); 
} 
#contact_map_container { border-radius: 200px; overflow: hidden; width: 320px; height: 320px; } 

我怎樣才能改變CSS,使這個反應,使地圖下的跳躍其他div當我在iPhone上查看頁面?

回答

2

您可以使用CSS @media標籤

@media screen and (max-width: 480px) and (orientation: portrait){ 
    /* some CSS here */ 
    /*define css for all divs*/ 

} 

/* #### Mobile Phones Landscape #### */ 
@media screen and (max-width: 640px) and (orientation: landscape){ 
    /* some CSS here */ 
    /*define css for all divs*/ 
} 

/* #### Mobile Phones Portrait or Landscape #### */ 
@media screen and (max-width: 640px){ 
    /* some CSS here */ 
    /*define css for all divs*/ 
} 
+0

你好,我的意思是在瀏覽器中,當你改變大小。地圖必須適應下來。 – Carsten 2013-05-09 12:16:23

+0

@Carsten你告訴我如何更改CSS以使其響應,以便當我在iPhone上查看頁面時,地圖跳轉到其他div下? – 2013-05-09 12:18:48

+0

http://imageshack.us/photo/my-images/855/webseitey.png/ – Carsten 2013-05-09 12:20:53

0

使用CSS媒體查詢做到這一點@media

@media all and (max-width: 640px){ 
#contact_map{ 
width: 100%; 
height: 100%; 
} 
}