利用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像素以下景點圖片會被隱藏,而超過這個大小圖片就會自動顯示,大家也可以自行用行動裝置瀏覽這個網址,也準備這個範例的原始檔讓大家下載研究。
Recently, after contacting my neurologist to report a severe rapid decline in health with symptoms of coughing up blood after chest pain I was referred to see a psychiatrist.
Fix health problems with increasing lexapro dosage from 10mg to 15mg and save your cash.
Anemia caused by other diseases – Some diseases can affect the body’s ability to make red blood cells.
https://gajweor.pixnet.net/blog/post/157277737
There’s definately a lot to find out about this issue. I really like all of the points you have made.
I just put the link of your blog on my Facebook Wall. very nice blog indeed.~;,”~
https://consolebang.com/members/idmall.38490/#about
my blog post :: Daycares By Category
Профессиональный сервисный центр по ремонту фото техники от зеркальных до цифровых фотоаппаратов.
Мы предлагаем: ремонт проектора в москве
Наши мастера оперативно устранят неисправности вашего устройства в сервисе или с выездом на дом!
Профессиональный сервисный центр по ремонту фото техники от зеркальных до цифровых фотоаппаратов.
Мы предлагаем: ремонт шторки затвора фотоаппарата
Наши мастера оперативно устранят неисправности вашего устройства в сервисе или с выездом на дом!
Hello! I simply would like to offer you a big thumbs up for the great information you have here on this post. I’ll be coming back to your site for more soon.
Если вы искали где отремонтировать сломаную технику, обратите внимание – профи услуги
I really like reading through a post that can make people think. Also, thank you for allowing me to comment.
My blog post: kings korner childcare
Saved as a favorite, I like your blog.
Oh my goodness! Incredible article dude! Many thanks, However I am having issues with your RSS. I don’t know the reason why I am unable to subscribe to it. Is there anyone else having the same RSS problems? Anybody who knows the answer will you kindly respond? Thanks.
Профессиональный сервисный центр по ремонту варочных панелей и индукционных плит.
Мы предлагаем: ремонт варочных панелей на дому в москве
Наши мастера оперативно устранят неисправности вашего устройства в сервисе или с выездом на дом!
Having read this I thought it was really enlightening. I appreciate you spending some time and effort to put this information together. I once again find myself spending a lot of time both reading and leaving comments. But so what, it was still worth it.
Профессиональный сервисный центр по ремонту бытовой техники с выездом на дом.
Мы предлагаем:ремонт бытовой техники в екб
Наши мастера оперативно устранят неисправности вашего устройства в сервисе или с выездом на дом!
Great info. Lucky me I recently found your site by chance (stumbleupon). I have book marked it for later.
An impressive share! I’ve just forwarded this onto a colleague who was conducting a little homework on this. And he in fact ordered me lunch simply because I stumbled upon it for him… lol. So allow me to reword this…. Thanks for the meal!! But yeah, thanks for spending time to discuss this subject here on your website.
Were required to give you that very little remark only to thanks again because of these spectacular techniques you have provided in this posting. It’s so particularly generous with folks like you to provide unreservedly what many people could have marketed as a possible e-book to earn some dough in their own business, primarily given that you could have used it if you ever wanted. The tactics also acted to get good way to know that most of us have similar desire as my very own to grasp very much more about it condition. I’m sure there are countless nicer opportunities at the start for individuals who read through your blog site post.
You’re so cool! I don’t suppose I’ve truly read through a single thing like that before. So wonderful to find somebody with original thoughts on this issue. Seriously.. thank you for starting this up. This web site is something that is needed on the internet, someone with a little originality.
https://able-seal-dc4vln.mystrikingly.com/blog/4e8bd0ab9ef
An outstanding share! I’ve just forwarded this onto a coworker who had been doing a little homework on this. And he in fact bought me breakfast due to the fact that I stumbled upon it for him… lol. So let me reword this…. Thank YOU for the meal!! But yeah, thanx for spending time to discuss this topic here on your web page.
Great info. Lucky me I ran across your blog by chance (stumbleupon). I’ve saved it for later.
https://khaki-wombat-dc4vlj.mystrikingly.com/blog/021638e2005
ремонт фотоаппарат
https://methodical-fish-dc4vlt.mystrikingly.com/blog/55b2ce7bfca
Hi, I do believe your web site could possibly be having web browser compatibility issues. When I take a look at your site in Safari, it looks fine however when opening in Internet Explorer, it has some overlapping issues. I simply wanted to give you a quick heads up! Aside from that, great site!
Если вы искали где отремонтировать сломаную технику, обратите внимание – ремонт техники в челябинске
my web blog :: Daycare Near Me [http://www.mmogapower.com]