利用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像素以下景點圖片會被隱藏,而超過這個大小圖片就會自動顯示,大家也可以自行用行動裝置瀏覽這個網址,也準備這個範例的原始檔讓大家下載研究。
amoxicillin 250mg canada buy amoxil medication cost amoxil 250mg
ventolin 2mg drug albuterol generic buy ventolin online
order isotretinoin 40mg for sale accutane 10mg oral isotretinoin 40mg ca
buy semaglutide 14 mg without prescription buy generic rybelsus order semaglutide 14mg pill
prednisone price deltasone 20mg pill buy deltasone for sale
order semaglutide 14mg generic order semaglutide online semaglutide 14 mg canada
tizanidine ca tizanidine 2mg cheap cheap tizanidine 2mg
clomid cheap cheap clomid 50mg order clomiphene 100mg for sale
levitra 10mg us order levitra 10mg generic
buy synthroid 150mcg synthroid tablets order synthroid 75mcg pills
order generic augmentin 1000mg amoxiclav usa
buy albuterol order albuterol 4mg purchase albuterol
purchase monodox online cheap doxycycline 200mg cheap
amoxicillin 250mg uk amoxil 500mg generic buy cheap amoxicillin
oral omnacortil prednisolone 40mg uk buy generic omnacortil for sale
where to buy lasix without a prescription order furosemide 40mg sale
purchase azithromycin generic buy generic azipro for sale buy azipro 250mg pills
order neurontin 600mg pill order neurontin 800mg sale
zithromax 500mg drug azithromycin 250mg drug generic azithromycin
care one nighttime sleep aid buy melatonin 3 mg generic
purchase amoxicillin sale order amoxil 250mg online amoxicillin pills
We wish to thank you once more for the beautiful
ideas you offered Jeremy when preparing a post-graduate research and
also, most importantly, pertaining to providing all the ideas in one blog post.
Provided we had been aware of your web site a year ago, we will have been rescued from the pointless measures we were choosing.
Thanks to you. adults toys
buy cheap isotretinoin buy accutane 10mg for sale isotretinoin 20mg cost
strongest medicine for gerd purchase lincocin online cheap
cause of pimples in adults deltasone 20mg sale acne medication by prescription
medication for cramping stomach otc buy epivir without prescription
prednisone 5mg oral prednisone 5mg uk
buy sleeping tablets online usa purchase meloset sale
Hmm is anyone else experiencing problems with the images on this blog loading?
I’m trying to find out if its a problem on my end or if it’s
the blog. Any responses would be greatly appreciated.
best allergy medicine for itching most recommended allergy medication antihistamine generic names