School of Business Administration

Slides:



Advertisements
Similar presentations
Cascading Style Sheets
Advertisements

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.
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.
Web Development & Design Foundations with XHTML Chapter 7 Key Concepts.
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.
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
Chapter 8 More on Links, Layout, and Mobile Key Concepts Copyright © 2013 Terry Ann Morris, Ed.D 1.
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
Week 8 – Part 3 More on Links, Layout, and Mobile Key Concepts 1.
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.
Week 8 – Part 2 Page Layout Basics Key Concepts 1.
Copyright © Terry Felke-Morris WEB DEVELOPMENT & DESIGN FOUNDATIONS WITH HTML5 Chapter 6 Key Concepts 1 Copyright © Terry Felke-Morris.
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.
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.
WebD Introduction to CSS By Manik Rastogi.
CSS.
Web Development & Design Foundations with HTML5 7th Edition
Web Development & Design Foundations with XHTML
Semester - Review.
Unit 3 - Review.
Webpage layout using CSS
UNIT-II CSS.
Creating Page Layouts with CSS
Web Developer & Design Foundations with XHTML
Web Development & Design Foundations with HTML5 8th Edition
Cascading Style Sheets (Layout)
Web Systems & Technologies
Web Development & Design Foundations with HTML5 7th Edition
Chapter 7 Page Layout Basics Key Concepts
Web Development & Design Foundations with HTML5 8th Edition
Web Development & Design Foundations with HTML5
Cascading Style Sheets
IS333: MULTI-TIER APPLICATION DEVELOPMENT
Chapter 8 More on Links, Layout, and Mobile Key Concepts
Basics of Web Design Chapter 7 Page Layout Basics Key Concepts
6 Layout.
Creating Layouts Using CSS
CSS Borders and Margins.
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.
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
Basics of Web Design Chapter 8 More on Links, Layout, and Mobile Key Concepts Copyright © 2014 Terry Ann Morris, Ed.D.
Web Development & Design Foundations with HTML5
Nov. 1, 2018 Drop-down menu.
How to use the CSS box model for spacing, borders, and backgrounds
CMPE 280 Web UI Design and Development February 7 Class Meeting
Web Development & Design Foundations with XHTML
Web Development & Design Foundations with HTML5
Web Client Side Technologies Raneem Qaddoura
Session IV Chapter 15 - How Work with Fonts and Printing
CMPE 280 Web UI Design and Development September 5 Class Meeting
Presentation transcript:

School of Business Administration Web Development IT125 Spring Term 2017 Marymount University School of Business Administration Professor Suydam Week 6 Page Layout (Chapter 6)

Class Agenda Complete CSS Basics Instruction Review Mini-Project 2 Begin Final Project Process Chapter 6 Page Layout

MP2 Grades

Final Project – Start Thinking Discuss in class using WebEx (each student by end of class)

The Box Model Content - Text & web page elements in the container Padding - Area between the content and the border Border - Between the padding and the margin Margin - Determines the empty space between the element and adjacent elements

Configure with CSS Margin The margin property Related properties: margin-top, margin-right, margin-left, margin-bottom Configures empty space between the element and adjacent elements Syntax examples h1 { margin: 0; } h1 { margin: 20px 10px; } h1 { margin: 10px 30px 20px; } h1 { margin: 20px 30px 0 30px; } Padding The padding property Related properties: padding-top, padding-right, padding-left, padding-bottom Configures empty space between the content of the HTML element (such as text) and the border h1 { padding: 0; } h1 { padding : 20px 10px; } h1 { padding : 10px 30px 20px; } h1 { padding : 20px 30px 0 30px; }

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

Hands On Practice – Normal Flow and Nested Elements starter1.html <!DOCTYPE html> <html lang="en"> <head> <title>CSS</title> <meta charset="utf-8"> <style> </style> </head> <body> <p>Copyright © 2016 Your Name Here</p> </body> </html> <div class="div1"> This is the first box. </div> <div class="div2"> This is the second box. .div1 { width: 200px; height: 200px; background-color: #D1ECFF; border: 3px dashed #000000; padding: 5px; } .div2 { width: 100px; height: 100px; background-color: #ffffff; border: 3px ridge #000000; margin: 10px;

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 the float property. h1 { background-color:#cccccc; padding:5px; color: #000000; } p { font-family:Arial,sans-serif; #yls {float:right; margin: 0 0 5px 5px; border: 1px solid #000000;

Hands On Practice – CSS Float Property .float { float: left; margin-right: 10px; border: 3px ridge #000000; } <div> <img class="float" src="yls.jpg" alt="Yellow Lady Slipper" height="100" width="100"> <p>The Yellow Lady Slipper grows in wooded areas and blooms in June each year. The flower is a member of the orchid family.</p> </div> Copy/paste image at right to folder with webpage See next page for starter page code

Hands On Practice – CSS Float Property <!DOCTYPE html> <html lang="en"> <head> <title>CSS Float</title> <meta charset="utf-8"> <style> body {width: 500px; background-color: #FFFFFF; color: #000000; } div {background-color: #F3F1BF; h1 { background-color: #658B42; padding: 10px; color: #E1DB5F; p { font-family: Arial,sans-serif; </style> </head> <body> <h1>Yellow Lady Slipper</h1> <div> <img src="yls.jpg" alt="Yellow Lady Slipper" height="100" width="100"> <p>The Yellow Lady Slipper grows in wooded areas and blooms in June each year. The flower is a member of the orchid family.</p> </div> <h2>Be Green When Enjoying Wildflowers</h2> <p>Enjoy wild plants in their native surroundings. Protect their environment in all possible ways — support organizations dedicated to preserving their habitat. </p> </body> </html> starteryls.html .float { float: left; margin-right: 10px; border: 3px ridge #000000; } <div> <img class="float" src="yls.jpg" alt="Yellow Lady Slipper" height="100" width="100"> <p>The Yellow Lady Slipper grows in wooded areas and blooms in June each year. The flower is a member of the orchid family.</p> </div> Copy/paste image at right to folder with webpage

The h2 text is displayed in normal flow. clear Property The h2 text is displayed in normal flow. 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 The background does not extend as far as you’d expect. Intended to configure the display of elements on a Web page. However, it is 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 div that contains the image and paragraph. Now the background extends and the h2 text displays AFTER the floated image.

CSS display Property Configures how and if an element is displayed display: none; The element will not be displayed. display: block; The element is rendered as a block element – even if it is actually an inline element, such as a hyperlink. display: inline; The element will be rendered as an inline element – even if it is actually a block element – such as a <li>. display: inline-block; The element will display as an inline display element adjacent to other inline display elements but also can be configured with properties of block display elements including width and height.

Hands On Practice – Box Sizing <body> <div id="wrapper"> <header><h1>Layout Example</h1></header> <nav> <a href="index.html">Home</a><br> <a href="page1.html">Page 1</a><br> <a href="page2.html">Page 2</a> </nav> <main> <h2>Page Heading</h2> <p>This is a sentence. This s a sentence. This is a sentence. This is a sentence. This is a sentence. This s a sentence. This is a sentence. This is a sentence. This is a sentence. This is a sentence. This is a sentence. This is a sentence. This is a sentence. This is a sentence. This is a sentence. This is a sentence. This is a sentence. This is a sentence. This is a sentence. This is a sentence. This is a sentence. This is a sentence. This is a sentence. This is a sentence.</p> </main> <footer>Copyright © 2016</footer> </div> </body> <!DOCTYPE html > <html lang="en"> <head> <title>Layout Example</title> <meta charset="utf-8"> <style> </style> </head> </html> singlecol.html

Hands On Practice – Box Sizing

Page Layout: Single Column > Two Column Single Column Wireframe Two Column Wireframe

Basic Two-Column Layout #wrapper { width: 80%; margin-left: auto; margin-right: auto; background-color: #EAEAEA; } header { background-color: #CCCCFF; } h1 { margin: 0; padding: 10px; } nav { float: left; width: 90px; padding: 10px; } main { margin-left: 100px; padding: 10px; background-color: #FFFFFF; } footer { text-align: center; font-style: italic; background-color: #CCCCFF; } <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; } header { background-color: #CCCCFF; } h1 { margin: 0; padding: 10px; } nav { float: left; width: 90px; padding: 10px; } main { margin-left: 100px; padding: 10px; background-color: #FFFFFF; } footer { text-align: center; font-style: italic; background-color: #CCCCFF; }

CSS Page Layout : Two Columns (left nav)

Vertical Navigation <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 and underline: nav ul { list-style-type: none; } nav a { text-decoration: none; }

Horizontal Navigation 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 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 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; }

Header Text Image Replacement Useful when a non-web safe font must be used in the header logo banner area Display the banner image but also configure text in the h1 for use by search engines and assistive technologies. Configure styles for the header element set the header banner image as the background of the header or h1 element. Code the company or website name with the h1 element. Configure the placement of the h1 text to be beyond the browser viewport: h1 { text-indent: 100%; white-space: nowrap; overflow: hidden; } SOURCE: http://www.zeldman.com/2012/03/01/replacing-the-9999px-hack-new-image-replacement/

Hands On Practice – Pseudo-class Interactive Hyperlinks <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 ul { list-style-type: none; margin-left: 0; padding: 10px; } nav a { text-decoration: none; padding: 10px; font-weight: bold; } nav a:link { color: #ffffff; } nav a:visited { color: #eaeaea; } nav a:hover { color: #000066; }

Hands On Practice – CSS Button border-radius: 60px; padding: 1em; color: #FFFFFF; background-color: #E38690; font-family: Arial, Helvetica, sans-serif; font-size: 2em; font-weight: bold; text-align: center; text-decoration: none; } .button:link { color : #FFFFFF; } .button:visited { color : #CCCCCC; } .button:hover { color : #965251; background-color: #F7DEE1; }

Position Property

Positioning Fixed nav { position: fixed; } Relative - 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 - Precisely specifies the location of an element outside of normal flow in in relation to its first parent non-static element p { position: absolute; left: 200px; top: 100px; font-family: Arial, sans-serif; width: 300px; }

Hands On Practice – New Lighthouse Bistro Homepage

Hands On Practice – CSS Button

Hands On Practice – CSS Button: lighthouse.css * { box-sizing: border-box; } body { background-color: #00005D; font-family: Verdana, Arial, sans-serif; } #wrapper { margin: 0 auto; width: 80%; min-width: 960px; max-width: 1200px; background-color: #B3C7E6; color: #000066; } header { background-color: #869DC7; color: #00005D; font-size: 150%; padding: 10px 10px 10px 155px; background-repeat: no-repeat; background-image: url(lighthouselogo.jpg); } nav { float: right; width: 200px; font-weight: bold; letter-spacing: 0.1em; } main { background-color: #ffffff; color: #000000; padding: 10px 20px; display: block; overflow: auto; } footer { font-size: 70%; text-align: center; padding: 10px; background-color: #869DC7; clear: both;} h2 { color: #869DC7; font-family: Arial, sans-serif; } #floatright { float: right; margin: 10px; } nav ul { list-style-type: none; margin: 0; padding: 0; } nav a { text-decoration: none; padding: 20px; border-bottom: 1px solid #FFFFFF; } nav a:link { color: #FFFFFF; } nav a:visited { color: #EAEAEA; } nav a:hover { color: #869DC7; background-color: #EAEAEA; }

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!

HTML5 Structural Elements Review Header Element block display; contains the headings of either a web page document or an area in the document such as a section or article Nav Element block display; contains a section of navigation hyperlinks Main Element block display; contains main page content Footer Element block display; contains the footer content of a web page or specific area (such as a section or article) on a web page

More HTML5 Elements Aside Element block display; contains a sidebar, a note, or other tangential content Section Element contains a “section” of a document, such as a chapter or topic block display Article Element contains an independent entry, such as a blog posting, comment, or e-zine article that could stand on its own Time Element represents a date or a time ; could be useful to date articles or blog posts inline display

HTML5 Compatibility with Older Browsers CSS header, main, nav, footer, section, article, figure, figcaption, aside { display: block; } HTML5 Shim (aka HTML5 Shiv) <!--[if lt IE 9]> <script src=" http://html5shim.googlecode.com/svn/trunk/html5.js"> </script> <![endif]-->

Deciding to Configure a class or id If the style may apply to more than one element on a page Use the . (dot) notation in the style sheet. Use the class attribute in the HTML. Configure an id: If the style is specific to only one element on a page Use the # notation in the style sheet. Use the id attribute in the HTML.

Quiz 2 Study Guide