Adobe
產品
Acrobat
Creative Cloud
Creative Suite
Digital Marketing Suite
Digital Publishing Suite
Elements
Photoshop
Touch Apps
更多產品
解決方案
數位行銷
數位媒體
教育機構
金融服務業
政府機關
網頁體驗管理
更多解決方案
教學 說明 下載 公司
購買
家庭使用 適用於個人和家庭辦公室
授權方案 適用於企業、學校和政府機關
其他購買方式
搜尋
 
資訊 登入
歡迎, 我的購物車 我的貨品 我的客戶支援
我的帳戶
登出
為何要登入?登入即可管理您的帳戶並取得試用下載、產品擴充功能、社群討論區等。
Adobe
產品 產業 購買   搜尋  
解決方案 公司
說明 學習資源
登入 登出 我的貨品 我的客戶支援
Date Date
Qty:
Subtotal
Checkout
開發人員中心 / Dreamweaver 開發人員中心 /

Customizable starter design for multiscreen development

作者 Chris Converse

Chris Converse
  • Codify Design Studio

Content

  • Summarizing the template features
  • Watch the video: Stepping through the template
  • Preview and download the template

Created

11 July 2011

頁面工具

在 Facebook 上共用
在 Twitter 上共用
在 LinkedIn 上共用
書籤
列印

Tags

系統需求

使用者等級

全部

要求的產品

  • Dreamweaver (Download trial)

Many developers and designers have had to face the challenge of creating a mobile version of a website. Typically this has consisted of creating a series of HTML and CSS files that target specific devices or mobile browsers. With CSS3 being adopted at breakneck speeds, it is time to leverage the power of CSS3 media queries.

Read the article to learn about key advantages of using media queries and the features of this template, preview and download the template and related files and assets, and watch a short video to get an overview of the template's features.

  • Overview: Summarizing the template features
  • Watch the video: Stepping through the template
  • Preview and download the template

Summarizing the template features

Media queries allow you to create CSS rules that are sensitive to the size of the browser's viewport. This means you can change your design based on the amount of space the user's browser has. When you combine this with techniques such as absolute positioning, float properties, CSS sprites, and font styles, you can morph a single HTML web page into a customized design and user experience.

This template demonstrates the possibilities available to you when you plan your design across different devices. One of the first things you may notice is the banner area. As you decrease the horizontal real estate from common computer-size to common tablet-size, you change the height and image of the banner, use a smaller version of the logo, and resize and reposition the navigation. When you decrease the size even more, you decrease the banner and logo again, and also move the navigation down below the content. This convention follows many mobile navigation systems, as it elevates the content before the navigation options.

Figure 1.  In each optimized view, you change the CSS rules applied to a single set of HTML markup, allowing individual devices to display the same web page in different constructs, based on the pixels available in the device's viewport.
Figure 1. In each optimized view, you change the CSS rules applied to a single set of HTML markup, allowing individual devices to display the same web page in different constructs, based on the pixels available in the device's viewport.

Varied image compression

Another advantage of media queries is the fact that you can use CSS to load images based on screen size as well. This template uses CSS to load all imagery. This technique allows you to load specific images based on the results of the CSS3 media query. What's more, you can apply more compression to images targeted at hand-held devices, and less compression on images targeted at tablets and computer screens.

With many phones and tablets sporting resolutions of 140ppi or better, highly compressed JPEG images still hold up very well on these screens. This allows you to make the images very small in file size, and still keep much of the integrity of the original image.

Figure 2 shows the combined file size used by each set of images. As you can see, the hand-held, or small version, of the graphics use only 75% of the file size used in the larger, or computer-sized, images.

Figure 2. Combined file size of image sets.
Figure 2. Combined file size of image sets.

Activating and deactivating absolute positioning

Another nice feature of this template is the way the top navigation drops below the content on smaller screens (see Figure 3). This is achieved by applying the navigation markup after the content container, then using absolute positioning to move it to the top of the screen for medium and larger displays.

Figure 3. The navigation drops below the content on smaller screens.
Figure 3. The navigation drops below the content on smaller screens.

This provides an optimal user experience for each display, as it is customary to provide navigation after content on hand-held devices, whereas setting top, or left, navigation on larger displays proves to be more user-friendly. In addition to moving the position of the navigation, you also change the design of the navigation to match more common hand-held design conventions.

Forging ahead with HTML5 and CSS3

This HTML template is created using HTML5. Included in the template is a reference to a JavaScript file, provided by Google, allowing versions of Internet Explorer 8 and earlier to render the HTML5 properly. In this case, HTML5 allows you to reduce the number of DIVs in the page by using such tags as <figure>, <nav>, <header>, and <footer>, to name a few. This reduces the number of HTML tags you'd normally use in earlier versions of HTML.

In order to let earlier versions of Internet Explorer understand HTML5, this template uses Google's publically available html5shiv JavaScript. This script is inserted with a conditional HTML comment that is unserstood by all versions of Internet Explorer, and is only used if the user is using a IE 8 or earlier (see Figure 4).

Figure 4. Workaround for Internet Explorer 8.
Figure 4. Workaround for Internet Explorer 8.

In addition to HTML5, I've also used CSS3 features for elements such as rounded corners, gradients, and drop shadows. In some cases, Internet Explorer will ignore all aspects of these CSS rule attributes. To ensure the design still looks good in in older versions of Internet Explorer, I've also created a special CSS file.

Watch the video: Stepping through the template

找不到 Flash 播放器 您是否需要 Flash 10? 您是否需要 Flash 10?

Preview and download the template

Download the HTML, CSS, and source Photoshop files related to this template.

fig05

More Like This

  • Turning a design into HTML and CSS using the Fireworks to Dreamweaver workflow – Part 1: Exporting the design
  • Turning a design into HTML and CSS using the Fireworks to Dreamweaver workflow – Part 2: Modifying the HTML and CSS
  • What's new in Dreamweaver CS5.5
  • Introduction to media queries – Part 1: What are media queries?
  • From table-based to tableless web design with CSS – Part 2: CSS starter pages
  • Creating your first website – Part 1: Set up your site and project files
  • Styling and inserting a Spry Menu Bar 2.0 widget with the Adobe Widget Browser
  • HTML5 and CSS3 in Dreamweaver CS5.5 – Part 1: Building the web page
  • HTML5 and CSS3 in Dreamweaver CS5.5 – Part 3: Using CSS media queries to target different screen resolutions
  • HTML5 and CSS3 in Dreamweaver CS5.5 – Part 2: Styling the web page

產品

  • Acrobat
  • Creative Cloud
  • Creative Suite
  • Digital Marketing Suite
  • Digital Publishing Suite
  • Elements
  • 行動應用程式
  • Photoshop
  • Touch Apps

解決方案

  • 數位行銷
  • 數位媒體
  • 網頁體驗管理

產業

  • 教育機構
  • 金融服務業
  • 政府機關

說明

  • 產品說明中心
  • 訂購與退貨
  • 下載與安裝
  • 我的 Adobe

學習資源

  • Adobe Developer Connection
  • Adobe TV
  • 培訓與認證
  • 論壇
  • 設計中心

購買方式

  • 適用於個人和家庭辦公室
  • 授權方案
  • 其他購買方式

下載

  • Adobe Reader
  • Adobe Flash Player
  • Adobe AIR
  • Adobe Shockwave Player

公司

  • 新聞室
  • 合作夥伴方案
  • 企業社會責任
  • 工作機會
  • 投資者關係
  • 事件
  • 法律聲明
  • 安全性
  • 聯絡 Adobe
選擇您所在的國家/地區 台灣 (變更)
選擇您所在的國家/地區 關閉

North America

Europe, Middle East and Africa

Asia Pacific

  • Canada - English
  • Canada - Français
  • Latinoamérica
  • México
  • United States

South America

  • Brasil
  • Africa - English
  • Österreich - Deutsch
  • Belgium - English
  • Belgique - Français
  • België - Nederlands
  • България
  • Hrvatska
  • Česká republika
  • Danmark
  • Eastern Europe - English
  • Eesti
  • Suomi
  • France
  • Deutschland
  • Magyarország
  • Ireland
  • Israel - English
  • ישראל - עברית
  • Italia
  • Latvija
  • Lietuva
  • Luxembourg - Deutsch
  • Luxembourg - English
  • Luxembourg - Français
  • الشرق الأوسط وشمال أفريقيا - اللغة العربية
  • Middle East and North Africa - English
  • Moyen-Orient et Afrique du Nord - Français
  • Nederland
  • Norge
  • Polska
  • Portugal
  • România
  • Россия
  • Srbija
  • Slovensko
  • Slovenija
  • España
  • Sverige
  • Schweiz - Deutsch
  • Suisse - Français
  • Svizzera - Italiano
  • Türkiye
  • Україна
  • United Kingdom
  • Australia
  • 中国
  • 中國香港特別行政區
  • Hong Kong S.A.R. of China
  • India - English
  • 日本
  • 한국
  • New Zealand
  • 台灣

Southeast Asia

  • Includes Indonesia, Malaysia, Philippines, Singapore, Thailand, and Vietnam - English

Copyright © 2012 Adobe Systems Incorporated. All rights reserved.

使用條款 | 隱私權政策和 Cookies (更新)