利用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像素以下景點圖片會被隱藏,而超過這個大小圖片就會自動顯示,大家也可以自行用行動裝置瀏覽這個網址,也準備這個範例的原始檔讓大家下載研究。
Have you ever considered about including a little bit more than just your articles? I mean, what you say is fundamental and all. Nevertheless just imagine if you added some great graphics or videos to give your posts more, “pop”! Your content is excellent but with images and clips, this site could certainly be one of the greatest in its field. Great blog!
Если вы искали где отремонтировать сломаную технику, обратите внимание – техпрофи
Профессиональный сервисный центр по ремонту бытовой техники с выездом на дом.
Мы предлагаем:ремонт крупногабаритной техники в новосибирске
Наши мастера оперативно устранят неисправности вашего устройства в сервисе или с выездом на дом!
This is a really good tip particularly to those fresh to the blogosphere. Short but very accurate info… Thank you for sharing this one. A must read article!
https://viastoer.blogspot.com/2024/07/blog-post_34.html
https://gajweor.pixnet.net/blog/post/162317287
This is a topic that is near to my heart… Cheers! Where can I find the contact details for questions?
I blog often and I really thank you for your content. This article has truly peaked my interest. I’m going to book mark your website and keep checking for new details about once a week. I opted in for your Feed too.
I’m pretty pleased to discover this web site. I need to to thank you for ones time just for this fantastic read!! I definitely savored every bit of it and I have you saved as a favorite to see new information in your website.
Although the condition can be associated with anxiety disorders, many patients without anxiety experience hyperventilation.
All these online providers sell how does lasix help shortness of breath at reduced prices
Health Services offers the Rapid Oral HIV test for Brown students.
Если вы искали где отремонтировать сломаную технику, обратите внимание – ремонт бытовой техники
Good post. I will be facing a few of these issues as well..
Профессиональный сервисный центр по ремонту планшетов в Москве.
Мы предлагаем: сколько стоит заменить стекло на планшете самсунг
Наши мастера оперативно устранят неисправности вашего устройства в сервисе или с выездом на дом!
This is an eye-opening perspective.오피
Everything is very open with a clear explanation of the issues. It was really informative. Your website is useful. Thanks for sharing!
Профессиональный сервисный центр по ремонту фото техники от зеркальных до цифровых фотоаппаратов.
Мы предлагаем: ремонт фототехники
Наши мастера оперативно устранят неисправности вашего устройства в сервисе или с выездом на дом!
Hello there! This article couldn’t be written any better! Going through this post reminds me of my previous roommate! He continually kept talking about this. I’ll send this post to him. Pretty sure he’s going to have a very good read. Thanks for sharing!
https://www.metooo.io/u/66973d4f7d959422b10fb4bc
Having read this I thought it was very informative. I appreciate you taking the time and energy to put this information together. I once again find myself spending a significant amount of time both reading and leaving comments. But so what, it was still worth it.
hy vee pharmacy: tesco pharmacy artane – fred’s dollar store pharmacy
prx online pharmacy: metoclopramide online pharmacy – drug store news
https://ameblo.jp/naveridbuy/entry-12860973483.html
I couldn’t resist commenting. Perfectly written!
I truly love your site.. Very nice colors & theme. Did you create this amazing site yourself? Please reply back as I’m looking to create my own personal website and want to learn where you got this from or exactly what the theme is named. Appreciate it.
Wow, cool post. I’d like to write like this too – taking time and real effort to make a good article… but I procrastinate too much and never seem to get started. Thanks though.
This is a topic which is near to my heart… Thank you! Where are your contact details though?
Weight loss can be one of the more subtle symptoms of diabetes.
Big discounts offered on stromectol over the counter at a cheaper price?
If you have already been diagnosed with allergies, it is probably safe to say the allergies are the cause of your itchy eyes.
You have a sensation of a shade being pulled over your eyes or a curtain being drawn from the side, above, or below.
Retail pharmacies in your area are the best place to zithromax sun exposure pills.
Quality cranberry juice produces hippuric acid in the urine which acidifies the urine and prevents bacteria from sticking to the walls of the bladder.
Если вы искали где отремонтировать сломаную технику, обратите внимание – ремонт техники в челябинске
Nice post. I learn something totally new and challenging on websites I stumbleupon on a daily basis. It will always be helpful to read through articles from other writers and use a little something from other websites.