例如以下手機圖片:
其中圖片尺寸分別為380px (Height) 與700px (Width)、白色矩形的右上角分別為27px (Top) 與85px (Left)、長寬分別為320px (Height) 與533px (Width),藉此設定以下CSS:
#preview {
height: 380px;
width: 700px;
background: url(images/phone_landscape.png)
center no-repeat;
}
#preview iframe {
width: 533px;
height: 320px;
top: 27px;
left: 85px;
}
並在HTML網頁中,以下列方式顯示jQuery Mobile網頁 (demo.html):【執行結果】
同樣的,以相同方式處理平板,以下為平板圖片:
其中圖片尺寸分別為640px (Height) 與1050px (Width)、白色矩形的右上角分別為70px (Top) 與125px (Left)、長寬分別為500px (Height) 與800px (Width),藉此設定以下CSS:
#preview {
height: 640px;
width: 1050px;
background: url(images/smalltablet_landscape.png)
center no-repeat;
}
#preview iframe {
width: 800px;
height: 500px;
top: 70px;
left: 125px;
}
並在HTML網頁中,以下列方式顯示jQuery Mobile網頁 (demo.html):【執行結果】
© Chia-Hui Huang




最近的程式畫面都走向CSS化了,我也正在學習中…
回覆刪除