利用Dreamweaver CS5.5設計行動裝置網頁

智慧型手機竄紅、平板電腦普及、行動網路發達,讓上網不再是只需要宅在家裡才能做到的事情,不管是走路、等車、坐車、吃飯、蹲馬桶以及許多的時候,都可以利用這些裝置來進入網際網路的花花世界,所以許多的網站也針對這些行動裝置來製作獨立的頁面,甚至根據螢幕尺寸來最佳化頁面。

iPhone 臉書網站直式
iPhone 臉書網站橫式

上面這兩張圖,就是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 多螢幕預覽介面

還可以針對不同的螢幕尺寸來設定該使用哪個CSS樣式表檔,只要按下多螢幕預覽上方的媒體查詢按鈕。

Dreamweaver CS5.5 媒體查詢

上面的範例是針對螢幕寬度小於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 may also like...

5,441 Responses

  1. I happen to be writing to make you be aware of of the exceptional encounter my friend’s daughter enjoyed browsing your web site. She noticed so many things, which included what it’s like to possess an amazing giving character to have many people smoothly understand various problematic topics. You really did more than our own desires. Thanks for distributing such productive, dependable, informative and easy thoughts on your topic to Kate.

  2. ngentot anak表示:

    Everyone loves it when individuals get together and share opinions. Great website, continue the good work.

  3. This is sensible info! Where else will if ind out more?? Who runs this joint too? sustain the good work

  4. bokep jepang表示:

    I enjoy looking through an article that can make men and women think. Also, thanks for allowing for me to comment.

  5. bokep indo表示:

    Right here is the perfect site for everyone who wants to understand this topic. You realize so much its almost hard to argue with you (not that I personally will need to…HaHa). You definitely put a fresh spin on a subject that’s been discussed for ages. Wonderful stuff, just wonderful.

  6. Если вы искали где отремонтировать сломаную технику, обратите внимание – сервисный центр в челябинске

  7. bokep indo表示:

    You should take part in a contest for one of the best blogs on the web. I’m going to highly recommend this website!

  8. Если вы искали где отремонтировать сломаную технику, обратите внимание – профи тех сервис барнаул

  9. An intriguing discussion might be priced at comment. I do believe you should write on this topic, it might certainly be a taboo subject but usually individuals are too little to speak on such topics. Yet another. Cheers

  10. Jessewrify表示:

    The Significance of Oscillation Regulation Apparatus in Machines
    Within manufacturing environments, devices as well as turning systems act as the support of output. However, one of the most prevalent concerns that can obstruct its functionality along with lifespan is resonance. Oscillation may lead to a variety of complications, such as reduced accuracy and efficiency to elevated wear and tear, in the end causing high-cost downtime as well as fixes. Such a situation is why resonance control systems is essential.

    Why Vibrations Mitigation remains Critical

    Vibration inside equipment can bring about several detrimental consequences:

    Lowered Production Efficiency: Excessive vibrations could lead to imbalances and unbalance, reducing the efficiency of the devices. This could lead to reduced output times and elevated energy consumption.

    Increased Damage: Constant vibration accelerates the erosion of mechanical parts, resulting in increased repairs along with the chance for unanticipated unexpected breakdowns. This doesn’t merely elevates operating costs but also limits the longevity for the devices.

    Security Hazards: Excessive oscillation can pose considerable safety risks to both the equipment and the workers. In, extreme situations, this may lead to devastating equipment breakdown, endangering employees and resulting in widespread destruction to the site.

    Exactness as well as Quality Concerns: For industries which rely on high precision, such as manufacturing or space industry, resonance might lead to discrepancies in production, resulting in faulty goods along with more waste.

    Cost-effective Alternatives for Vibration Management

    Investing in the vibration control systems is not only a necessity and a smart decision for all businesses that any company that uses machinery. We offer modern vibration control systems are intended to reduce oscillation from any equipment and spinning equipment, guaranteeing seamless along with efficient functioning.

    What distinguishes such tools apart is its reasonable pricing. It is recognized that the significance of cost-effectiveness within the competitive market of today, thus we offer premium oscillation control tools at costs that are affordable.

    By selecting these tools, you’re not only protecting your equipment along with boosting its performance but also investing towards the long-term achievement in your organization.

    Conclusion

    Oscillation control is a vital component in ensuring the efficiency, safety, as well as longevity of your machinery. Using our cost-effective vibration control equipment, it is possible to make sure your production run smoothly, your products remain top-tier, along with all personnel stay secure. Don’t let resonance undermine your machinery—invest in the correct apparatus today.

  11. I in addition to my guys were taking note of the good information and facts from your web site and so instantly I had a horrible suspicion I had not expressed respect to you for those tips. All the men became consequently joyful to see them and have sincerely been enjoying them. Thanks for being quite kind and for picking out this form of fantastic ideas millions of individuals are really needing to learn about. My personal honest regret for not expressing gratitude to sooner.

  12. Iwkdgg表示:

    cheap generic rumalaya – cheap rumalaya without prescription buy elavil 50mg sale

  13. Если вы искали где отремонтировать сломаную технику, обратите внимание – профи челябинск

  14. Если вы искали где отремонтировать сломаную технику, обратите внимание – ремонт бытовой техники в барнауле

  15. AncrPaish表示:

    From mild to very strong cramping during abortion procedure.
    People look for the cheapest price of generic sildenafil 100mg at low prices, you need to compare online offers
    Sneezing Inhaling pollen or other allergens can irritate your nose and trigger a release of histamine, causing you to sneeze.

  16. There is noticeably a bundle to learn about this. I suppose you made certain nice points in features also.

  17. I dugg some of you post as I cerebrated they were extremely helpful very beneficial

  18. Если вы искали где отремонтировать сломаную технику, обратите внимание – сервисный центр в новосибирск

  19. Music began playing as soon as I opened this site, so frustrating!

  20. I can’t really help but admire your blog, your blog is so adorable and nice ,   

發佈留言

發佈留言必須填寫的電子郵件地址不會公開。