利用Dreamweaver CS5.5設計行動裝置網頁
智慧型手機竄紅、平板電腦普及、行動網路發達,讓上網不再是只需要宅在家裡才能做到的事情,不管是走路、等車、坐車、吃飯、蹲馬桶以及許多的時候,都可以利用這些裝置來進入網際網路的花花世界,所以許多的網站也針對這些行動裝置來製作獨立的頁面,甚至根據螢幕尺寸來最佳化頁面。
上面這兩張圖,就是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中除了提供多螢幕預覽的模式之外:
還可以針對不同的螢幕尺寸來設定該使用哪個CSS樣式表檔,只要按下多螢幕預覽上方的媒體查詢按鈕。
上面的範例是針對螢幕寬度小於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像素以下景點圖片會被隱藏,而超過這個大小圖片就會自動顯示,大家也可以自行用行動裝置瀏覽這個網址,也準備這個範例的原始檔讓大家下載研究。
You’ve made some decent points there. I did looking about them and found most guys goes together with along with your blog.
This design is steller! You most certainly know how to keep a reader entertained. Between your wit and your videos, I was almost moved to start my own blog (well, almost…HaHa!) Wonderful job. I really loved what you had to say, and more than that, how you presented it. Too cool!
This is the perfect website for everyone who hopes to find out about this topic. You know so much its almost tough to argue with you (not that I actually would want to…HaHa). You certainly put a new spin on a subject that’s been discussed for decades. Wonderful stuff, just wonderful.
Oh my goodness! an incredible article dude. Thanks a ton However We are experiencing problem with ur rss . Don’t know why Struggling to register for it. Perhaps there is everyone finding identical rss difficulty? Anyone who knows kindly respond. Thnkx
Howdy, I do think your site could possibly be having web browser compatibility problems. Whenever I look at your blog in Safari, it looks fine but when opening in IE, it has some overlapping issues. I just wanted to give you a quick heads up! Apart from that, fantastic website.
Hey! QuiteRather insightful post you have there. This actually assisted us a tremendous amount!
What is the name of a hip hop song with continual wolf whistles?
Easily, the post is really the greatest on this laudable topic. I concur with your conclusions and will thirstily watch forward to your future updates. Saying thank will not just be sufficient, for the great c lucidity in your writing. I will instantly grab your rss feed to stay privy of any updates. Solid work and much success in your business enterprise!
Oh my goodness! Awesome article dude! Thank you, However I am encountering issues with your RSS. I don’t understand the reason why I cannot subscribe to it. Is there anyone else having similar RSS problems? Anyone that knows the answer will you kindly respond? Thanx!!
Здесь вы найдете разнообразный видео контент ялта интурист официальный сайт забронировать
soma rx pharmacy
Hey there! Do you know if they make any plugins to
assist with Search Engine Optimization? I’m trying to
get my site to rank for some targeted keywords but I’m not seeing very
good results. If you know of any please share. Appreciate it!
You can read similar text here
best online pharmacy alprazolam
lortab 10 pharmacy price
Your style is very unique in comparison to other folks I have read stuff from. Thanks for posting when you have the opportunity, Guess I will just book mark this web site.
tramadol pharmacy us
Your style is really unique compared to other folks I’ve read stuff from. Many thanks for posting when you’ve got the opportunity, Guess I’ll just book mark this blog.
Remarkable post! Chatting about how taken pleasure in the exact examining. I’m hoping to see significantly more from your website. It looks you might have very good knowledge combined with perception. My corporation is very much fulfilled with this particular tips.
I couldn’t refrain from commenting. Perfectly written.
Your style is really unique compared to other folks I have read stuff from. Many thanks for posting when you have the opportunity, Guess I’ll just book mark this blog.
buy feldene 20mg for sale – purchase feldene generic buy rivastigmine paypal
estradiol patch online pharmacy
Malegra DXT
online viagra pharmacy no prescription
greenstone alprazolam pharmacy
buy vasotec 10mg online – doxazosin 1mg generic order latanoprost sale
vardenafil generico en farmacias
cialis 20 mg tadalafil
cipla tadalafil review
I have been browsing online more than 3 hours nowadays, yet I by no means found any fascinating article like yours. It is beautiful value enough for me. In my view, if all website owners and bloggers made excellent content material as you did, the web shall be much more useful than ever before!