TUTORIAL 4: CREATING PAGE LAYOUT WITH CSS Session 4.3.

Slides:



Advertisements
Similar presentations
Week 10 Creating Positioned Layouts
Advertisements

1 Cascading Style Sheets Continued Different kinds of selectors in a style sheet –Simple- Pseudo-Class –Contextual- Pseudo-Element –Class Image Styles.
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.
Chapter 7 Page Layout Basics Key Concepts Copyright © 2013 Terry Ann Morris, Ed.D 1.
Part 5 Introduction to CSS. CSS Display - Block and Inline Elements A block element is an element that takes up the full width available, and has a line.
With CSS, a color is most often specified by: a HEX value - like "#ff0000" an RGB value - like "rgb(255,0,0)" a color name - like "red“ Example h1.
CIS 1310 – HTML & CSS 6 Layout. CIS 1310 – HTML & CSS Learning Outcomes  Describe & Apply the CSS Box Model  Configure Float with CSS  Designate Positioning.
Cascading Style Sheets Color and Background Controls Border and Margin Controls (Boxes)
Tutorial 4: Creating page layout with css
CSS: Class 1 Background Images, Controlling Position of Background Images, Add Padding to Page Elements, Add Borders to Elements on a Page.
Tutorial 6 Creating Fixed-Width Layouts
Tutorial 4 Creating Special Effects with CSS
MORE Cascading Style Sheets (The Positioning Model)
CSS to Know And this is just the beginning. What to What?  Tags = regular HTML  Ids = #id, only one hashtag per page  Class =.class, many as you want.
TUTORIAL 8: Enhancing a Web Site with Advanced CSS
Cascading Style Sheets 1 Color and Backgrounds. Cascading Style Sheets 2 Color and Backgrounds Computer color basics Expression of color values using.
IMAGES Controlling size of images in CSS Aligning images in CSS Adding background images.
Tutorial 4 Creating Special Effects with CSS. XP Objectives Work with CSS selectors Create styles for lists Create and apply class styles Create a rollover.
WRT235: Writing in Electronic Environments CSS Backgrounds, colors, fonts.
Tutorial 4 Creating Special Effects with CSS
CSS Positioning Creating Special Effects with CSS CS202 Working with Cascading Style Sheets (Chapter 4) CS202 1.
IS1825 Developing Multimedia Applications for Business Lecture 4: CSS Positioning and Flow Rob Gleasure
11/6/13 MORE CSS!. TODAY’S AGENDA Review: float for positioning objects Review: CSS and color Introductions to: o CSS and images o CSS backgrounds o CSS.
Adding Graphics to Web Pages. CSS does not have any properties specifically aimed at formatting images Use properties you have already learned, i.e.,
 Remember that HTML is just text  Need to point to pictures  Use the img tag  alt: › screen reader › REQUIRED for this class and to validate.
Tutorial #6 – Creating Fixed Width Layouts. Tutorial #5 Review – Box Model Every html element is surround by a box Content, Padding, Border, Margin Can.
INTRODUCTORY Tutorial 4 Exploring Graphic Elements and Images.
 Cascading Style Sheets (CSS) ◦ Used to specify the presentation of elements separately from the structure of the document.  Inline style ◦ declare.
Colors and backgrounds The following CSS properties will be explained: 1.color 2.background-color 3.background-image 4.background-repeat 5.background-attachment.
DIV, Span, CSS.
Layout with Styles Castro Chapter 11. Tables vs. CSS You can produce “liquid layouts” (layouts that stretch as the browser is resized) using tables or.
Cascading Style Sheets Positioning Controls Visibility.
WEB DEVELOPMENT IMMERSIVE BUILDING PAGE LAYOUTS. 2 Box Model Scaling Positioning Boxes Box Aesthetics HTML 5 Semantic Tags CSS Resets TOPICS GENERAL ASSEMBLYWEB.
INT222 - Internet Fundamentals Shi, Yue (Sunny) Office: T2095 SENECA COLLEGE.
INTRODUCTORY Tutorial 5 Using CSS for Layout and Printing.
CIS234A Lecture 5 Instructor Greg D’Andrea. Font Styles Review Font-Family: generic family, font family Font-Size: em, pt, px, %, mm, cm, in Font-Style:
Colors and backgrounds The following CSS properties will be explained: 1.color 2.background-color 3.background-image 4.background-repeat 5.background-position.
Positioning and Printing Creating Special Effects with CSS.
3.2 Cascading Style Sheets. 2 Positioning Elements Normally, elements are laid out on the page in the order that they are defined in the XHTML document.
Cascading Style Sheets Positioning Controls Visibility.
Tutorial 4 Creating Special Effects with CSS. New Perspectives on HTML, XHTML, and XML, Comprehensive, 3rd Edition 2 Objectives Work with CSS selectors.
Tutorial 4 Creating Special Effects with CSS. New Perspectives on HTML, XHTML, and XML, Comprehensive, 3rd Edition 2 Objectives Work with CSS selectors.
Tutorial 4 Creating Special Effects with CSS. XP Objectives Work with CSS selectors Create styles for lists Create and apply class styles Create a rollover.
Web Technologies Beginning Cascading Style Sheets (CSS) 1Copyright © Texas Education Agency, All rights reserved.
CONTROLLING Page layout
Tutorial 4 Creating Page Layouts with CSS
CIS234A Lecture 6 Instructor Greg D’Andrea. Span and Div The span and div elements are a generic means by which we can add structure to documents. The.
Tutorial #5 Working with the Box Model. Tutorial #4 Review - CSS Create a homework page Final Project Discussion Exam on Blackboard Styling Lists (List-style-type,
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.
Internet & World Wide Web How to Program, 5/e Copyright © Pearson, Inc All Rights Reserved.
1 CS428 Web Engineering Lecture 07 Font, Text & Background (CSS - II)
HTML & CSS Contents: the different ways we can use to apply CSS to The HTML documents CSS Colors and Background CSS Fonts CSS Text CSS box model: padding,
Mimi Opkins.  One of the major benefits of using CSS is that you’re not forced to lay your sites out in tables.  The layout possibilities of CSS give.
Laying out Elements with CSS
Cascading Style Sheets Layout
CSS Layouts: Grouping Elements
Cascading Style Sheets
Objectives Create a reset style sheet Explore page layout designs
6 Layout.
Positioning.
MORE Cascading Style Sheets (The Positioning Model)
Cascading Style Sheets
Cascading Style Sheets™ (CSS)
Tutorial 4 Creating Special Effects with CSS
Positioning.
Laying out Elements with CSS
CSc 337 Lecture 5: Grid layout.
Positioning Boxes Using CSS
Presentation transcript:

TUTORIAL 4: CREATING PAGE LAYOUT WITH CSS Session 4.3

Objectives  Designing the Background  Positioning Objects  Working with Overflow  Clipping an Element  Stacking Elements

Practice: margins, float, and width  For the horizontal navigation list items:  Display each list item as a block  Set the width to 19.8%  Make the items float to the left  Set the background color to (49, 38, 31)  For the main section:  Set the margin of the paragraphs to 15px  Set the margin of the unordered list to 25px

Practice: margins, float, and width  For the aside element  Set the margin to 10px  Set the width to 50%  Make the aside float to the right

Designing the Background  CSS also supports background images using background-image: url(url);  Example: body { background-image: url(marble.png); }

Background Image Properties PropertiesMeaningsValues background-repeat Set how a background image would be repeated repeat, repeat-x, repeat-y, no- repeat, inherit background-position Set the starting position of a background image left top, left center, left bottom, right top, right center, right bottom, center top, center center, center bottom background-size Specify the size of the background image. length, percentage, cover, contain background-attachment Set whether a background image is fixed or scrolls with the rest of the page scroll (default), fixed, or inherit

Designing the Background  You can combine the various background properties into the shorthand property background: color url(url) attachment position repeat;  Example: background: black url(backdrop.png) fixed center center no-repeat;

Practice - Designing the Background 1. For the header group within the article element, create a style rule to: a. Display a background color with value (189, 131, 82) with the background image alisha.png displayed in the bottom-right corner with no tiling. b. Set the text color to the value (215, 181, 151)

Positioning Objects  To position an object at a specific coordinate, use the style properties position: type; top: value; right: value; bottom: value; left: value; where type indicates the type of positioning applied to the object (absolute, relative, static, fixed, or inherit), and the top, right, bottom, and left properties indicate the coordinates of the object

Positioning Objects  Static positioning renders an element in order, as they appear in the document flow. This is default.  Example  Absolute positioning places an element at specific coordinates either in the page or within a container element.  Examples

Positioning Objects  Relative positioning is used to move an element relative to where the browser would have placed it if no positioning had been applied  Example

Positioning Objects 1. For the page body, position the page using relative positioning. 2. For the header element, place the header at the coordinates (0, 0) using absolute positioning.

Working with Overflow  When you force an element into a specified height and width, you can define how browsers should handle content that overflows allotted space using the style overflow: type;

Working with Overflow  To specify how browsers should handle content that overflows in the horizontal direction, use the following style: overflow-x: type;  To specify how browsers should handle content that overflows in the vertical direction, use the following style: overflow-y: type;

Working with Overflow 1. For the div element within the slideshow figure box, set the browser to display scroll bars automatically if the content overflows the assigned space, and use the white-space property to prevent the content from wrapping to a new line.  For the figure box, add a 21% left margin and set the background color to the value (149, 91, 42).

Clipping an Element  To clip an element’s content, use the style clip: rect(top, right, bottom, left); where top, right, bottom, and left define the boundaries of the clipping rectangle

Clipping an Element

Stacking Elements  Positioning elements can sometimes lead to objects that overlap each other  By default, elements that are loaded later by the browser are displayed on top of elements that are loaded earlier  To specify a different stacking order, use the style property z-index: value;

Stacking Elements

1. For the three images involved in the collage division, create a collage where the three images are overlapping each other in a pleasant display.