TUTORIAL 8: Enhancing a Web Site with Advanced CSS

Slides:



Advertisements
Similar presentations
Introduction to Web Design Lecture number:. Todays Aim: Introduction to Web-designing and how its done. Modelling websites in HTML.
Advertisements

Copyright © Terry Felke-Morris WEB DEVELOPMENT & DESIGN FOUNDATIONS WITH HTML5 Chapter 7 Key Concepts 1 Copyright © Terry Felke-Morris.
Cascading Style Sheets
Copyright © Terry Felke-Morris WEB DEVELOPMENT & DESIGN FOUNDATIONS WITH HTML5 Chapter 6 Key Concepts 1 Copyright © Terry Felke-Morris.
Copyright © Terry Felke-Morris WEB DEVELOPMENT & DESIGN FOUNDATIONS WITH HTML5 Chapter 6 Key Concepts 1 Copyright © Terry Felke-Morris.
Cascading Style Sheets. CSS stands for Cascading Style Sheets and is a simple styling language which allows attaching style to HTML elements. CSS is a.
Web Development & Design Foundations with XHTML Chapter 7 Key Concepts.
INTRODUCTORY Tutorial 7 Creating Liquid Layouts. XP Objectives Discern the differences among various types of layouts Create a liquid layout Create a.
Web Development & Design Foundations with XHTML Chapter 7 Key Concepts.
Advance CSS (Menu and Layout) Miftahul Huda. CSS Navigation MENU It's truly remarkable what can be achieved through CSS, especially with navigation menus.
1 Pengantar Teknologi Internet W03: CSS Cascading Style Sheets.
Web Pages and Style Sheets Bert Wachsmuth. HTML versus XHTML XHTML is a stricter version of HTML: HTML + stricter rules = XHTML. XHTML Rule violations:
กระบวนวิชา CSS. What is CSS? CSS stands for Cascading Style Sheets Styles define how to display HTML elements Styles were added to HTML 4.0 to.
Unit 20 - Client Side Customisation of Web Pages
Web Design with Cascading Style Sheet Lan Vu. Overview Introduction to CSS Designing CSS Using Visual Studio to create CSS Using template for web design.
Tutorial 4: Creating page layout with css
CONCEPTS FOR FLUID LAYOUT Web Page Layout. Website Layouts Most websites have organized their content in multiple columns (formatted like a magazine or.
4.01 Cascading Style Sheets
Working with Cascading Style Sheets. 2 Objectives Introducing Cascading Style Sheets Using Inline Styles Using Embedded Styles Using an External Style.
Copyright © Terry Felke-Morris WEB DEVELOPMENT & DESIGN FOUNDATIONS WITH HTML5 7 TH EDITION Chapter 7 Key Concepts 1 Copyright © Terry Felke-Morris.
Chapter 8 More on Links, Layout, and Mobile Key Concepts Copyright © 2013 Terry Ann Morris, Ed.D 1.
INTRODUCTION TO WEB DEVELOPMENT AND HTML Lecture 06: Tables - Spring 2011.
LEARN THE QUICK AND EASY WAY! VISUAL QUICKSTART GUIDE HTML and CSS 8th Edition Chapter 12: Building Responsive Webpages.
CSS (Cascading Style Sheets): How the web is styled Create Rules that specify how the content of an HTML Element should appear. CSS controls how your web.
CIT 256 Mobile Web Development Dr. Beryl Hoffman.
Chapter 8 More on Links, Layout, and Mobile Copyright © 2013 Terry Ann Morris, Ed.D revised by Bill Pegram, 9/24/
CIS 1310 – HTML & CSS 7 More on Links, Layout & Mobile.
Page Layout & Mobile Web Using columns, grid systems, etc… to layout sites for desktops and mobile.
Creating A Simple Web Page. Step 1- Open Dreamweaver & Create A New Page (File New) and blank.
Working with Cascading Style Sheets. Introducing Cascading Style Sheets Style sheets are files or forms that describe the layout and appearance of a document.
XP Tutorial 7New Perspectives on Creating Web Pages with HTML, XHTML, and XML 1 Working with Cascading Style Sheets Creating a Style for Online Scrapbooks.
Copyright © Texas Education Agency, All rights reserved. 1 Web Technologies Website Development with Dreamweaver.
Eat Your Words! Creating webpage Layout. CONTENT The Layout of a Webpage HEADER FOOTER Each of these sections represents a ‘div’ (or divider). By linking.
CONCEPTS FOR FLUID LAYOUT Web Page Layout. Website Layouts Most websites have organized their content in multiple columns (formatted like a magazine or.
Week 8 – Part 3 More on Links, Layout, and Mobile Key Concepts 1.
 This presentation introduces the following: › 3 types of CSS › CSS syntax › CSS comments › CSS and color › The box model.
Tutorial 8 Enhancing a Web Site with Advanced CSS
Copyright © Terry Felke-Morris WEB DEVELOPMENT & DESIGN FOUNDATIONS WITH HTML5 7 TH EDITION Chapter 7 Key Concepts 1 Copyright © Terry Felke-Morris.
HTML, CSS, and XML Tutorial 8 Enhancing a Web Site with Advanced CSS.
Tutorial #6 – Creating Fixed Width Layouts. Tutorial #5 Review – Box Model Every html element is surround by a box Content, Padding, Border, Margin Can.
Copyright © Terry Felke-Morris WEB DEVELOPMENT & DESIGN FOUNDATIONS WITH HTML5 Chapter 7 Key Concepts 1 Copyright © Terry Felke-Morris.
CNIT 132 – Week 4 Cascading Style Sheets. Introducing Cascading Style Sheets Style sheets are files or forms that describe the layout and appearance of.
INFO1300 LAB7 OCT.11TH RESPONSIVE DESIGN. WHAT IS RESPONSIVE WEB DESIGN A mix of flexible grids and layouts, images and an intelligent use of CSS media.
Positioning Objects with CSS and Tables
04 – CSS Informatics Department Parahyangan Catholic University.
Chapter 4 and 5. Objectives Introduce markup: elements and attributes How browsers interpret HTML documents Basic structure of HTML document What do style.
XP Tutorial 7New Perspectives on HTML and XHTML, Comprehensive 1 Working with Cascading Style Sheets Creating a Style for Online Scrapbooks Tutorial 7.
CONCEPTS FOR FLUID LAYOUT Web Page Layout. Essential Questions What challenges do mobile devices present to Web designers? What are the basic concepts.
CSS.
Working with Cascading Style Sheets
Web Development & Design Foundations with HTML5
Web Development & Design Foundations with HTML5 7th Edition
4.01 Cascading Style Sheets
Concepts for fluid layout
Creating Page Layouts with CSS
Web Development & Design Foundations with HTML5
Cascading Style Sheets (Layout)
>> CSS Layouts.
Objectives Create a media query Work with the browser viewport
Web Development & Design Foundations with HTML5 7th Edition
Web Development & Design Foundations with HTML5 8th Edition
IS333: MULTI-TIER APPLICATION DEVELOPMENT
Chapter 8 More on Links, Layout, and Mobile Key Concepts
Web Development & Design Foundations with HTML5 8th Edition
Web Development & Design Foundations with H T M L 5
Responsive Web Design (RWD)
Web Development & Design Foundations with HTML5
Concepts for fluid layout
4.01 Cascading Style Sheets
Session IV Chapter 15 - How Work with Fonts and Printing
Presentation transcript:

TUTORIAL 8: Enhancing a Web Site with Advanced CSS Session 8.1.

OBJECTIVES Designing for the Mobile Web Testing a Mobile Design Configuring the Viewport Introducing Media Queries within HTML Documents Creating a Mobile Style Sheet Introducing Media Queries within CSS Files Designing for Portrait Orientation Designing for Landscape Orientation

DESIGNING FOR THE MOBILE WEB

TESTING ON MOBILE DEVICES Six Free Mobile Devices Emulators for testing your site: http://www.webdesignerdepot.com/2012/11/6-free-mobile-device-emulators-for-testing-your-site/

CONFIGURING THE VIEWPORT Mobile devices can display pages written for the larger screens found on desktop computers. The contents of a Web page are displayed within a window known as the viewport. Visual viewport Layout viewport Widths of Layout Viewport: - Layout viewport: complete content of the page. - Visual viewport: Web page content that appears on the screen Mobile version of Safari running on iPhone: 980px => Even if the iPhone screen is only 320px wide, the mobile browser acts as if the device was 980 px or more in width -

CONFIGURING THE VIEWPORT The page layout is always scaled to match the resolution of the device screen.

PRACTICE: CONFIGURING THE VIEWPORT Open the tmc.htm file. Add the viewport meta tag.

INTRODUCING MEDIA QUERIES WITHIN THE HTML DOCUMENT To create a media query for loading a style sheet, add the media attribute media = “devices and|or (features)” to the link element, where devices is a list of media devices, and features is a list of display features and their values as found on those devices

INTRODUCING MEDIA QUERIES WITHIN THE HTML DOCUMENT To associate a style sheet with screen devices that are less than or equal to a specific width, use the query media = “screen and (max-width: value)” where value is the maximum allowable width of the screen’s viewport To associate a style sheet with screen devices that are greater than or equal to a specific width, use the query media = “screen and (min-width: value)” where value is the minimum allowable width of the screen’s viewport.

INTRODUCING MEDIA QUERIES WITHIN THE HTML DOCUMENT To associate a style sheet with screen devices that fall within a range of screen widths, use the following query: media = “screen and (min-width: value and max-width: value)” To associate a style sheet with screen devices in portrait or landscape mode, use the query media = “screen and (orientation: type)” where type is either portrait or landscape.

PRACTICE: MEDIA QUERIES WITHIN HTML Add a link to the tmceffects.css style sheet file, using the style sheet for screen devices that have a minimum width of 501 pixels. Add the same media query for the tmclayout.css style sheet file. Use an Internet Explorer conditional comment for versions of IE before version 9 to link to the tmclayout.css and tmceffects.css style sheet for screen devices. Many patients and visitors visit the TMC website using mobile devices. Create a mobile version for TMC. Open tmcmobile.css from your data file folder in your text editor. Enter your name and the date in the comment section of the file, and then save tmcmobile.css. Create a link to the tmcmobile.css file to be accessed by only screen devices with maximum widths of 500 pixels.

CREATING A MOBILE STYLE SHEET

PRACTICE: CREATING A MOBILE STYLE SHEET Within the tmcmobile.css file, add a style rule to hide the nav tag within the header element, the image tag within the header element, the main section, the aside and the footer. Set the background color of the body to (107, 140, 80). For the header element, create a style rule to: Change the background with the image file hospview.jpg placed in the center-bottom of the background with no tiling Set the width to 100% Set the height to 150 pixels.

PRACTICE: CREATING A MOBILE STYLE SHEET 4. The navigation list containing links to each of the departments at TMC has the id depts. Create a style rule to set the width of this navigation list to 100%. 5. For the h1 elements within the depts navigation list, create a style rule to: Set the font size to 25 pixels Set the font color to white Set the margin to 15 pixels Center the text of the heading

INTRODUCING MEDIA QUERIES WITHIN CSS To apply a media query to a collection of style rules, apply the @media rule @media devices and|or (features) { styles } in your style sheet, where styles is those styles applied to the specified devices and features. To import a style sheet based on a media query, apply the following @import rule: @import url(url) devices and|or (features)

DESIGNING FOR PORTRAIT ORIENTATION

DESIGNING FOR LANDSCAPE ORIENTATION

PRACTICE: MEDIA QUERIES WITHIN CSS The preceding styles will be applied by default to the page in portrait orientation. Create an @media rule for the page in landscape orientation. Add the following style rule for list items of the nav element with the depts id displayed in landscape orientation: Set the width to 30% Float the list items on the left Set the margins to 5 pixels For portrait orientation, the navigation list containing links to each of the departments at TMC has the id depts. Create a style rule for the navigation links to: Display the links as blocks and set their width to 100% Set the text color to white and align the text in the center Set the space between lines to 50px

PRACTICE: MEDIA QUERIES WITHIN CSS 4. Along with the “portrait orientation” styles, create style rule for list items in the depts navigation list to: Display the items as blocks Add the background image file arrow.png to the right-center of the background with no tiling Set the width to 60% and the height to 50 pixels Add top and bottom margins of 5 pixels, and add left and right margins of auto Add a 1px solid white border and a radius of 10px