Chapter 7 Page Layout Basics Key Concepts

Slides:



Advertisements
Similar presentations
Copyright © Terry Felke-Morris WEB DEVELOPMENT & DESIGN FOUNDATIONS WITH HTML5 Chapter 6 Key Concepts 1 Copyright © Terry Felke-Morris.
Advertisements

Layout using CSS. Using multiple classes In the head:.important{font-style:italic;}.title{color:red;} In the body: Here's a type of paragraph that is.
Copyright © Terry Felke-Morris WEB DEVELOPMENT & DESIGN FOUNDATIONS WITH HTML5 Chapter 6 Key Concepts 1 Copyright © Terry Felke-Morris.
Slide 1 CMPS 211 Internet Programming Spring 2008 Dynamic Effects with Styles Chapter 12 2/6/08.
Chapter 7 Page Layout Basics Key Concepts Copyright © 2013 Terry Ann Morris, Ed.D 1.
Very quick intro HTML and CSS. Sample html A Web Title.
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.
Links.  Styling Links  Links can be styled with any CSS property (e.g. color, font-family, background-color).  Special for links are that they can.
Web Development & Design Foundations with XHTML Chapter 7 Key Concepts.
Principles of Web Design 5 th Edition Chapter Nine Site Navigation.
Web Development & Design Foundations with XHTML Chapter 7 Key Concepts.
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.
CIS 1310 – HTML & CSS 6 Layout. CIS 1310 – HTML & CSS Learning Outcomes  Describe & Apply the CSS Box Model  Configure Float with CSS  Designate Positioning.
Navigation Bars Level 2 Extended Certificate Unit B12 Doing Business Online.
Class four: the box model and positioning. is an HTML tag which allows you to create an element out of inline text. It doesn’t mean anything! try it:
Unit 20 - Client Side Customisation of Web Pages
Web Development & Design Foundations with XHTML Chapter 6 Key Concepts.
Web Development & Design Foundations with XHTML Chapter 6 Key Concepts.
Page Layout & Mobile Web Using columns, grid systems, etc… to layout sites for desktops and mobile.
Web Development & Design Foundations with XHTML
Copyright © Terry Felke-Morris WEB DEVELOPMENT & DESIGN FOUNDATIONS WITH HTML5 7 TH EDITION Chapter 6 Key Concepts 1 Copyright © Terry Felke-Morris.
Basics of Web Design 1 Copyright © 2016 Pearson Education, Inc., Hoboken NJ.
Doman’s Sections Information in this presentation includes text and images from
Copyright © Terry Felke-Morris CSS Flow & Positioning 1 Copyright © Terry Felke-Morris.
Copyright © Terry Felke-Morris WEB DEVELOPMENT & DESIGN FOUNDATIONS WITH HTML5 7 TH EDITION Chapter 6 Key Concepts 1 Copyright © Terry Felke-Morris.
CSS Tutorial 1 Introduction Syntax How to use style specifications. Styles.
Week 8 – Part 2 Page Layout Basics Key Concepts 1.
Web Development & Design Foundations with HTML5 7th Edition
Copyright © Terry Felke-Morris WEB DEVELOPMENT & DESIGN FOUNDATIONS WITH HTML5 Chapter 6 Key Concepts 1 Copyright © Terry Felke-Morris.
Internet Technology Dr Jing LU Updated Dr Violet Snell / Dr Kalin Penev 1 Internet Technology (week 6)  Recap: Validating HTML  Page Layout.
INT222 - Internet Fundamentals Shi, Yue (Sunny) Office: T2095 SENECA COLLEGE.
Copyright © Osmosys O S M O S Y SO S M O S Y S D e p l o y i n g E x p e r i e n c e & E x p e r t i s e™ CSS Training.
Web Development & Design Foundations with XHTML Chapter 6 Key Concepts.
NAVIGATION USING HTML TO SET UP THE BASIC STRUCTURE OF A NAV BAR.
1 Cascading Style Sheets
WebD Introduction to CSS By Manik Rastogi.
CSS.
Cascading Style Sheets Layout
Web Development & Design Foundations with HTML5 7th Edition
Web Development & Design Foundations with XHTML
CSS Layouts: Positioning and Navbars
Semester - Review.
Creating Page Layouts with CSS
Web Development & Design Foundations with HTML5 8th Edition
Cascading Style Sheets (Layout)
Web Development & Design Foundations with HTML5 7th Edition
Web Development & Design Foundations with HTML5 8th Edition
Web Development & Design Foundations with HTML5
Cascading Style Sheets
COMP 101 Review.
IS333: MULTI-TIER APPLICATION DEVELOPMENT
Chapter 6 More CSS Basics Key Concepts
Basics of Web Design Chapter 7 Page Layout Basics Key Concepts
6 Layout.
Basics of Web Design Chapter 6 More CSS Basics Key Concepts
Basics of Web Design Chapter 6 More CSS Basics Key Concepts
Float Property Elements that seem to “float" on the right or left side of either the browser window or another element are often configured using.
Basics of Web Design Chapter 6 More CSS Basics Key Concepts
Web Development & Design Foundations with H T M L 5
Web Development & Design Foundations with HTML5 8th Edition
Web Development & Design Foundations with H T M L 5
Web Development & Design Foundations with HTML5
Nov. 1, 2018 Drop-down menu.
Web Development & Design Foundations with XHTML
Web Development & Design Foundations with HTML5
School of Business Administration
Web Client Side Technologies Raneem Qaddoura
Presentation transcript:

Chapter 7 Page Layout Basics Key Concepts Basics of Web Design Chapter 7 Page Layout Basics Key Concepts

Learning Outcomes Configure float with CSS Configure fixed positioning with CSS Configure relative positioning with CSS Configure absolute positioning with CSS Create two-column page layouts with CSS Configure navigation in unordered lists and style with CSS Add interactivity to hyperlinks with CSS pseudo-classes Configure CSS sprites

Normal Flow Browser display of elements in the order they are coded in the web page document Figure 7.2 Figure 7.1

float Property h1 { background-color: #A8C682; padding: 5px; Elements that seem to “float" on the right or left side of either the browser window or another element are often configured using the CSS float property float: right; float: left; h1 { background-color: #A8C682; padding: 5px; color: #000000; } p { font-family: Arial, sans-serif; } #yls { float: right; margin: 0 0 5px 5px; border: solid; }

The h2 text is displayed in normal flow. clear Property Useful to “clear” or terminate a float Values are left, right, and both clear: left; was applied to the h2. Now the h2 text displays AFTER the floated image.

The background does not extend as far as you’d expect. overflow Property Configures the display of elements on a web page Useful to “clear” or terminate a float before the end of a container element Values are auto, hidden, and scroll overflow: auto; was applied to the container div. Now the background extends and the h2 text displays AFTER the floated image.

Basic Two-Column Layout <body> <div id="wrapper"> <header> <header> <nav> </nav> <main> </main> <footer> </footer> </div> </body>

Basic Two-Column Layout #wrapper { width: 80%; margin-left: auto; margin-right: auto; background-color: #EAEAEA; } body{ background-color: #000066;} h1 { margin: 0; padding: 10px; } nav { float: left; width: 150px; padding: 10px; } main { margin-left: 160px; padding: 10px; background-color: #FFFFFF; } header { background-color: #CCCCFF; } footer { text-align: center; font-style: italic; background-color: #CCCCFF; clear: both; }

Vertical Navigation with an Unordered List <ul> <li><a href="index.html">Home</a></li> <li><a href="menu.html">Menu</a></li> <li><a href="directions.html">Directions</a></li> <li><a href="contact.html">Contact</a></li> </ul> </nav> CSS removes the list marker and underline: nav ul { list-style-type: none; } nav a { text-decoration: none; }

display Property Configures how and if an element is displayed display: none; The element will not be displayed display: inline; The element will be rendered as an inline element – even if it is actually a block element – such as a <li> display: block; The element is rendered as a block element – even if it is actually an inline element, such as a hyperlink

Horizontal Navigation with an Unordered List HTML: <nav> <ul> <li><a href="index.html">Home</a></li> <li><a href="menu.html">Menu</a></li> <li><a href="directions.html">Directions</a></li> <li><a href="contact.html">Contact</a></li> </ul> </nav> CSS removes the list marker, removes the underline, adds padding, and configures the list items for inline display. nav ul { list-style-type: none;} nav a { text-decoration: none; padding-right: 10px; } nav li { display: inline; }

CSS Pseudo-classes (state of an item) Pseudo-classes and the anchor element :link – default state for a hyperlink :visited –a hyperlink that has been visited :focus – triggered when the hyperlink has keyboard focus :hover – triggered when the mouse moves over the hyperlink :active – triggered when the hyperlink is being clicked a:link {color:#000066;} a:visited {color:#003366;} a:focus {color:#FF0000;} a:hover {color:#0099CC;} a:active {color:#FF0000;}

CSS Pseudo-classes a:link { color: #ff0000; } a:hover { text-decoration: none; color: #000066; }

Position Property

Fixed Positioning nav { position: fixed; }

Relative Positioning Changes the location of an element in relation to where it would otherwise appear in normal flow p { position: relative; left: 30px; font-family: Arial, sans-serif; }

Absolute Positioning p { position: absolute; left: 200px; top: 100px; font-family: Arial, sans-serif; width: 300px; } Precisely specifies the location of an element outside of normal flow in its relation to its first parent non-static element

CSS Sprites Sprite an image file that contains multiple small graphics advantage: saves download time http://csssprites.com http://www.spritecow.com

CSS Debugging Tips Manually check syntax errors Use W3C CSS Validator to check syntax errors http://jigsaw.w3.org/css-validator/ Configure temporary background colors Configure temporary borders Use CSS comments to find the unexpected /* the browser ignores this code */ Don’t expect your pages to look exactly the same in all browsers! Be patient!

Summary This chapter expanded your CSS skillset. You configured web pages with floating elements with CSS. You were introduced to fixed, relative, and absolute positioning. You configured web pages with two-column page layouts You used unordered lists to provide structure for navigation hyperlinks. You added interactivity to hyperlinks with CSS pseudo-classes. You configured a CSS sprite image.