Tutorial 4: Creating page layout with css

Slides:



Advertisements
Similar presentations
CSS Layout Crash Course An Advance CSS Tutorial. Inline vs. Block Many HTML elements have a default display setting of Block. Block elements take up the.
Advertisements

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.
Chapter 7 Page Layout Basics Key Concepts Copyright © 2013 Terry Ann Morris, Ed.D 1.
SM5312 week 11: CSS Menus & Navigation Bars1 An Introduction to Cascading Style Sheets CSS Menus and Navigation Bars Nick Foxall.
INTRODUCTORY Tutorial 7 Creating Liquid Layouts. XP Objectives Discern the differences among various types of layouts Create a liquid layout Create a.
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.
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
Week 9 Using the Box Properties. 9-2 The CSS Visual Formatting Model Describes how the element content boxes should be displayed by the browser –Based.
Tutorial 6 Creating Fixed-Width Layouts
CS4370/6370 Web Development Cascading Style Sheets (CSS)
Web Design & Development Cascading Style Sheets (CSS)
TUTORIAL 4: CREATING PAGE LAYOUT WITH CSS Session 4.3.
MORE Cascading Style Sheets (The Positioning Model)
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.
TUTORIAL 8: Enhancing a Web Site with Advanced CSS
Page Layout & Mobile Web Using columns, grid systems, etc… to layout sites for desktops and mobile.
Chapter 7 Web Typography Principles of Web Design, 4 th Edition.
Cascading Style Sheets CSS. CSS Positioning Normal Flow Top -> bottom | left -> right Arranged in the order they appear in the code make room for one.
Cascading Style Sheets CSS. div … Used like a container to group content Gives context to the elements in the grouping Give it a descriptive name with.
Copyright © Terry Felke-Morris WEB DEVELOPMENT & DESIGN FOUNDATIONS WITH HTML5 7 TH EDITION Chapter 6 Key Concepts 1 Copyright © Terry Felke-Morris.
INTRODUCTION TO HTML5 Styling Text. Change the Font Size  You can use the font-size property to change the font size for a document’s text.  Instead.
Chapter 12 Cascading Style Sheets: Part II The Web Warrior Guide to Web Design Technologies.
MCS 270 Cascading Style Sheets (CSS) Gustavus Adolphus College.
CO1552 – Web Application Development Cascading Style Sheets.
 Word doc for you to download › Link at the beginning of class › 10 Questions › Answers to be added inline  Post to Sakai when completed › No resubmits.
Copyright © Terry Felke-Morris WEB DEVELOPMENT & DESIGN FOUNDATIONS WITH HTML5 7 TH EDITION Chapter 6 Key Concepts 1 Copyright © Terry Felke-Morris.
CSS = Cascading Style Sheet CSS consists of rules to display, style and decorate HTML elements Why CSS ? – Separate decoration from HTML markup (Ex :,,…)
Tutorial #6 – Creating Fixed Width Layouts. Tutorial #5 Review – Box Model Every html element is surround by a box Content, Padding, Border, Margin Can.
Basics of Web Design Chapter 6 More CSS Basics Key Concepts.
CSS WORKSHOP Design Principles for Web Standards.
Week 8 – Part 2 Page Layout Basics Key Concepts 1.
WEB DEVELOPMENT IMMERSIVE BUILDING PAGE LAYOUTS. 2 Box Model Scaling Positioning Boxes Box Aesthetics HTML 5 Semantic Tags CSS Resets TOPICS GENERAL ASSEMBLYWEB.
Internet Technology Dr Jing LU Updated Dr Violet Snell / Dr Kalin Penev 1 Internet Technology (week 6)  Recap: Validating HTML  Page Layout.
CSS Layout Cascading Style Sheets. Lesson Overview  In this lesson, you will learn:  float & clear  display & visibility.
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.
Introduction to CSS Layout
Today’s objectives Layouts | floats Measurement units Type properties
CSS Positioning & Layout Creating layouts and controlling elements.
CONTROLLING Page layout
Tutorial 4 Creating Page Layouts with CSS
1 Preparation for site Create a folder in MyDocuments: beavercheese. Create a subfolder, images Classes, career, DW beginner Download.
BEGINNER WEB DESIGN. INTRODUCTION Vocabulary Design Tools of the Trade HTML CSS.
PERSPECTIVES: TUTORIAL 4 CREATING PAGE LAYOUTS WITH CSS.
Chapter 7.  Change body and link styles  Create a drop-down menu  Change color and font styles in the menu  Create a pop-up effect using CSS  Utilize.
CS 120: Introduction to Web Programming Lecture 10: Extra Features and Website Design Part 1 Tarik Booker CS 120 California State University, Los Angeles.
HTML 5 AND CSS Dr Mohd Soperi Mohd Zahid Semester /16.
1 CS428 Web Engineering Lecture 07 Font, Text & Background (CSS - II)
Cascading Style Sheets for layout
Laying out Elements with CSS
Web Development & Design Foundations with HTML5 7th Edition
Creating Page Layouts with CSS
Cascading Style Sheets for layout
Web Development & Design Foundations with HTML5 7th Edition
Chapter 7 Page Layout Basics Key Concepts
Web Development & Design Foundations with HTML5 8th Edition
Laying out a website using CSS and HTML
Fixed Positioning.
MORE Cascading Style Sheets (The Positioning Model)
HTML – Organizing Page Content
Web Development & Design Foundations with HTML5 8th Edition
Web Development & Design Foundations with H T M L 5
Floating and Positioning
Laying out Elements with CSS
Session IV Chapter 15 - How Work with Fonts and Printing
Presentation transcript:

Tutorial 4: Creating page layout with css Session 4.2

Objectives Set display properties Create a reset style sheet Explore fixed, fluid, and elastic layouts Set the width and height Float elements in a Web page

The display style Most page elements are displayed in one of two ways Blocks occupy a defined rectangular area within a page Inline elements flow within a block

The CSS Box Model

Creating a Reset Style Sheet /* Display HTML5 structural elements as blocks */ article, aside, figure, figcaption, footer, hgroup, header, section, nav { display: block; } /* Set the default page element styles */ * { font-family: Arial, Helvetica, sans-serif; font-size: 100%; line-height: 1.2em; list-style: none;

Creating a Reset Style Sheet Many designers create a reset style sheet to define their own default styles Two steps: Step #1: Display HTML5 structural elements as blocks Step #2: Set the default page element styles

Practice – Reset Style Sheet Download cyclepathology.zip from my website. Open race.css in Notepad++ Add a style rule to display the header, article, aside, figure, figcaption, hgroup, section, and nav elements as blocks. Create a style rule to set the default style for every element so that every element: Is displayed in Verdana, Geneva, sans-serif Has a font size of 100%

Fixed and Fluid Layout

Elastic Layouts Some designers propose the use of elastic layouts, in which all measurements are expressed relative to the default font size using the em unit If a user or the designer increases the font size, the width, height, and location of all of the other page elements, including images, change to match

Setting the width and height Page width and height For fixed layout: width: value; height: value; For fluid layout: min-width: value; min-height: value; max-width: value; max-height: value;

Setting width and height Example: body { width: 95%; min-width: 900px; max-width: 1400px; } Width and height can also be used to define the width and height of other elements.

Setting width and height In the style rule for the page body, set the page width to 98% of the width of the browser window in a range from 1000 pixels up to 1400 pixels. Create a style rule for the header element that: Sets the width to 20% of the page body Changes the background color to black For inline images within the header element, set the width to 100% of the width of the header. For the hgroup within the article element, set the height to 60 pixels and indent the text 20 pixels. For the figure box, create a style rule to set the width of the figure box to 79%.

Floating Elements Floating an element takes that element out of the normal flow of the document and positions it along the left or right edge of its containing element. With CSS float, an element can be pushed to the left or right, allowing other elements to wrap around it. float: position; Where position is left, right, none, or inherit. Example: float: right;

Floating Elements – The Rules You can't float every element on a Web page. Any element that follows the floated element will flow around the floated element on the other side. If the floated element does not have a pre-defined width, it will take up as much horizontal space as required and available regardless of the float => you should always define a width on floated elements. For example, if I float an image to the left, any text or other elements following it will flow around it to the right. And if I float an image to the right, any text or other elements following it will flow around it to the left. An image that is placed in a block of text without any float style applied to it will display as the browser is set to display images. This is usually with the first line of following text displayed at the bottom of the image.

Floating Elements - Images Example of a floating image: Open float_image_layout folder Image with no float property Image with float to the left Image with float to the right Example of multi-column layout: Open multicolumn_layout folder Layout with no float Layout with section floating to the left Layout with section and article floating to the left Layout with section, article, and aside floating to the left

Floating Elements Turning Off the Float clear: position; Where position is left, right, both, none, or inherit.

Floating Elements For list items within the horizontal navigation list, add styles to: Display each list item as a block floated on the left Add the following styles to the main section of the page: Float the main section on the left margin once the left margin has been clear of previously floated objects Set the width to 49% of the page body For the article element, create a style rule to: Float the element on the left with a width of 29% Set background color to the value (215, 181, 151) For the figure box, float the figure box on the left once the margin is clear.