利用Dreamweaver CS5.5設計行動裝置網頁
智慧型手機竄紅、平板電腦普及、行動網路發達,讓上網不再是只需要宅在家裡才能做到的事情,不管是走路、等車、坐車、吃飯、蹲馬桶以及許多的時候,都可以利用這些裝置來進入網際網路的花花世界,所以許多的網站也針對這些行動裝置來製作獨立的頁面,甚至根據螢幕尺寸來最佳化頁面。
![iPhone 臉書網站直式 iPhone 臉書網站直式](http://cloudlab.tw/wp/wp-content/uploads/1/2011/09/iphone_fb_v-200x300.jpg)
![iPhone 臉書網站橫式 iPhone 臉書網站橫式](http://cloudlab.tw/wp/wp-content/uploads/1/2011/09/iphone_fb_h-300x200.jpg)
上面這兩張圖,就是Facebook為了行動裝置而製作的頁面,左邊是iPhone直拿觀賞,右手邊則是橫拿,可以看到在左邊最上排只看到「個人檔案、訊息、更多」,右邊可看到「個人檔案、訊息、朋友、相片、更多」,橫拿比直拿多出了兩個選項,雖然只是小地方,但設計就是要掌握每一個細節,那我們該如何設計這樣的網頁呢?就讓我們慢慢來體驗吧!
很久很久以前在製作網頁的時候,我們可以在同一個頁面使用不同媒體的CSS樣式表來控制顯示內容,例如:
<link href="css/screen.css" rel="stylesheet" type="text/css" media="screen" /> <link href="css/handheld.css" rel="stylesheet" type="text/css" media="handheld" /> <link href="css/print.css" rel="stylesheet" type="text/css" media="print" />
上面的第一行是代表螢幕樣式、第二行為行動裝置樣式、第三行為列印樣式,不過目前有關行動裝置樣式已經因為時代的演進與科技的發達,已經瀕臨淘汰的邊緣了,現在我們製作行動裝置樣式,主要是靠裝置的螢幕寬度來決定不同的樣式表。
在Dreamweaver CS5.5中除了提供多螢幕預覽的模式之外:
![Dreamweaver CS5.5 多螢幕預覽 Dreamweaver CS5.5 多螢幕預覽](http://cloudlab.tw/wp/wp-content/uploads/1/2011/09/dw55-1-300x257.jpg)
![Dreamweaver CS5.5 多螢幕預覽介面 Dreamweaver CS5.5 多螢幕預覽介面](http://cloudlab.tw/wp/wp-content/uploads/1/2011/09/dw55-2-300x267.jpg)
還可以針對不同的螢幕尺寸來設定該使用哪個CSS樣式表檔,只要按下多螢幕預覽上方的媒體查詢按鈕。
![Dreamweaver CS5.5 媒體查詢 Dreamweaver CS5.5 媒體查詢](http://cloudlab.tw/wp/wp-content/uploads/1/2011/09/dw55-3-244x300.jpg)
上面的範例是針對螢幕寬度小於320像素的裝置使用phone.css,螢幕尺寸介於321像素~768像素之間的裝置使用tablet.css,加入了這樣的設定後在頁面內會多出兩段CSS的連結語法:
<link href="css/phone.css" rel="stylesheet" type="text/css" media="only screen and (max-width:320px)" /> <link href="css/tablet.css" rel="stylesheet" type="text/css" media="only screen and (min-width:321px) and (max-width:768px)" />
當然要看你在這兩個CSS中如何設定呈現頁面樣式囉!我的範例是在phone.css裡面將景點圖片的display設為none,另外要注意在<head></head>區段中要加入以下的語法:
<meta name="viewport" content="initial-scale=1.0, maximum-scale=1.0, user-scalable=no, width=device-width">
否則在手機橫向後頁面將會被放大,這樣我們的樣式表就會失效,瀏覽的效果可以參考下面的影片:
可以看到在320像素以下景點圖片會被隱藏,而超過這個大小圖片就會自動顯示,大家也可以自行用行動裝置瀏覽這個網址,也準備這個範例的原始檔讓大家下載研究。
After exploring a few of the articles on your website, I really like your technique of blogging. I added it to my bookmark site list and will be checking back in the near future. Please check out my website as well and let me know your opinion.
술먹고 비아그라 먹으면
술과 비아그라 복용: 조합의 효과와 주의사항
https://iridescent-alligator-dc4vlm.mystrikingly.com/blog/a950c43776b
https://cooperative-freesia-dc4vlv.mystrikingly.com/blog/8375526b2e5
처방전 필요없는 비아그라
처방전 필요없는 비아그라: 법적 및 건강 영행 이해
20대 비아그라 처방
20대에서 비아그라 처방: 성 기능과 건강의 논란
How Long Does Viagra Last?
How Long Does Viagra Last?
purchase speman generic – purchase himplasia pills finasteride buy online
There’s definately a lot to find out about this issue. I really like all of the points you made.
https://cinnamon-daffodil-dc4vl5.mystrikingly.com/blog/5cf18f27568
I need to to thank you for this great read!! I absolutely loved every little bit of it. I have got you book-marked to look at new things you post…
https://medium.com/@nsw5288/%EB%B9%84%EC%95%84%EA%B7%B8%EB%9D%BC-%EA%B0%99%EC%9D%B4-%EB%A8%B9%EC%9C%BC%EB%A9%B4-%EC%95%88%EB%90%98%EB%8A%94-%EC%95%BD-e6a7bb6e99ff
비아그라와 운동: 건강한 성생활을 위한 조언
비아그라와 운동: 건강한 성생활을 위한 조언
Can I simply say what a comfort to find somebody who truly understands what they are talking about on the web. You certainly understand how to bring a problem to light and make it important. More and more people need to check this out and understand this side of the story. I was surprised that you’re not more popular because you surely have the gift.
When I originally left a comment I seem to have clicked the -Notify me when new comments are added- checkbox and from now on every time a comment is added I recieve 4 emails with the exact same comment. There has to be a means you can remove me from that service? Appreciate it.
비아그라 자주 먹으면
비아그라 자주 복용: 주의할 점과 효과에 대한 이해
I could not refrain from commenting. Very well written.
https://viastoer.blogspot.com/2024/07/blog-post_92.html
https://www.mixcloud.com/shepparduvg897/
https://medium.com/@dqvchristopherwhite824/%EB%84%A4%EC%9D%B4%EB%B2%84-%EC%95%84%EC%9D%B4%EB%94%94-%EC%83%9D%EC%84%B1-%EC%8B%9C-%EC%A3%BC%EC%9D%98%ED%95%B4%EC%95%BC-%ED%95%A0-%EC%82%AC%ED%95%AD-1e7ff7203c15
It’s hard to find knowledgeable people in this particular topic, however, you sound like you know what you’re talking about! Thanks
https://cinnamon-daffodil-dc4vl5.mystrikingly.com/blog/9f22fd52b8f
I used to be able to find good advice from your content.
비아그라 원리
비아그라의 과학: 발기부전 치료에 작용하는 방법
https://naveridbuy.blogspot.com/2024/07/blog-post_16.html
https://cinnamon-cyclamen-dc4vl9.mystrikingly.com/blog/cfe6e9547f5
Great web site you have here.. It’s hard to find good quality writing like yours nowadays. I honestly appreciate individuals like you! Take care!!
https://emerald-watermelon-dc4vl2.mystrikingly.com/blog/7107e76a0e1
Your article resonates with me on many levels.Google Genius
https://funny-lion-dc4vln.mystrikingly.com/blog/f70eeb6f544