Tutorial 4 Creating Page Layouts with CSS

Slides:



Advertisements
Similar presentations
LIS650 lecture 4 Thomas Krichel today CSS Properties –Box properties-- List properties –Table properties-- Classification properties –(Audio.
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.
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
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.
CSS provides a way to stray away from the traditional methods of using tables to lay out pages. Success with this technique depends on understanding of.
Tutorial 4: Creating page layout with css
Tutorial 5 Working with the Box Model. XP Objectives Understand the box model Create padding, margins, and borders Wrap text around an image Float a block-level.
CSS: Class 1 Background Images, Controlling Position of Background Images, Add Padding to Page Elements, Add Borders to Elements on a Page.
 2003 Prentice Hall, Inc. All rights reserved. Chapter 6 - Cascading Style Sheets™ (CSS) Outline 6.1 Introduction 6.2 Inline Styles 6.3 Embedded Style.
Basics of Web Design Chapter 6 More CSS Basics Key Concepts.
Tutorial 6 Creating Fixed-Width Layouts
TUTORIAL 4: CREATING PAGE LAYOUT WITH CSS Session 4.3.
An Introduction to Cascading Style Sheets CSS Layout, and the CSS Box Model Nick Foxall SM5312 week 9: CSS Layout.
Tutorial 4 Creating Special Effects with CSS
MORE Cascading Style Sheets (The Positioning Model)
14-Jul-15 CSS Applications to XML. 2 A different emphasis CSS is the same for XML as it is for HTML, but-- HTML already does a pretty good job of layout.
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.
Dreamweaver -- CSS. Dreamweaver -- MX New icons are added in MX Most of the features commonly used in web design, and are same as FrontPage. New feature.
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.
New Perspectives on XML, 2nd Edition Tutorial 5 1 TUTORIAL 5 WORKING WITH CASCADING STYLE SHEETS.
XP New Perspectives on XML Tutorial 5 1 TUTORIAL 5 CSS Tutorial – Carey ISBN
CSS Positioning Creating Special Effects with CSS CS202 Working with Cascading Style Sheets (Chapter 4) CS202 1.
The Missing Manual MARGINS, PADDING, & BORDERS—CHAPTER 7.
CSS The Definitive Guide Chapter 8.  Allows one to define borders for  paragraphs  headings  divs  anchors  images  and more.
CIS 1315 – Web Development for Educators CIS 1315 HTML Tutorials 3 & 4: Working With CSS.
CSS Border.
LITTLE BOXES Controlling size of boxes Box model for borders, margin and padding Displaying and hiding boxes.
Tutorial #6 – Creating Fixed Width Layouts. Tutorial #5 Review – Box Model Every html element is surround by a box Content, Padding, Border, Margin Can.
 2008 Pearson Education, Inc. All rights reserved Cascading Style Sheets™ (CSS)
Chcslonline.org Text –wrapping around Images. chcslonline.org To wrap text around an image, lets set up a style in our style sheet. open a new notepad.
INTRODUCTORY Tutorial 4 Exploring Graphic Elements and Images.
Cascading Style Sheets Chapters 5-6 Color and Background Controls Border and Margin Controls.
>> The “Box” Model. Pre-requisite Create a new project in Netbeans called Week5 Create a new html file and name it box.html Create a new css file and.
 2004 Prentice Hall, Inc. All rights reserved. Chapter 6 - Cascading Style Sheets™ (CSS) Outline 6.1 Introduction 6.2 Inline Styles 6.3 Embedded Style.
 Cascading Style Sheets (CSS) ◦ Used to specify the presentation of elements separately from the structure of the document.  Inline style ◦ declare.
XP Review 2 New Perspectives on JavaScript, Comprehensive1 Introducing Cascading Style Sheets Formatting Web Pages with CSS.
1 CS428 Web Engineering Lecture 08 Border, Margin, Padding … (CSS - III)
Cascading Style Sheets Positioning Controls Visibility.
INTRODUCTORY Tutorial 5 Using CSS for Layout and Printing.
CSS Layout Cascading Style Sheets. Lesson Overview  In this lesson, you will learn:  CSS Box Model  CSS properties for border  CSS properties for.
Positioning and Printing Creating Special Effects with CSS.
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.
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.
CONTROLLING Page layout
Department of Computer Science, Florida State University CGS 3066: Web Programming and Design Spring 2016 CSS Positioning 1.
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.
Laying out Elements with CSS
Chapter 6 - Cascading Style Sheets™ (CSS)
Cascading Style Sheets Boxes
CSS Layouts: Grouping Elements
>> The “Box” Model
Objectives Create a reset style sheet Explore page layout designs
Cascading Style Sheets
CSS Borders and Margins.
MORE Cascading Style Sheets (The Positioning Model)
How to use the CSS box model for spacing, borders, and backgrounds
CSS Boxes CS 1150 Fall 2016.
Cascading Style Sheets™ (CSS)
Positioning Boxes Using CSS
CGS 3066: Web Programming and Design Fall 2019 CSS Part 2
Presentation transcript:

Tutorial 4 Creating Page Layouts with CSS

Objectives Set display properties Create a reset style sheet Define a background image Set background image properties Use browser extension styles Explore fixed, fluid, and elastic layouts Float elements in a Web page New Perspectives on HTML and CSS, 6th Edition

Objectives Set margin and padding spaces Format an element border Create rounded corners Display an element outline Explore absolute and relative positioning Work with overflow content Explore clipped objects Stack objects in a page New Perspectives on HTML and CSS, 6th Edition

Backgrounds and Floating Objects New Perspectives on HTML and CSS, 6th Edition

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 New Perspectives on HTML and CSS, 6th Edition

The Box Model Elements also are laid out in a Web page following the structure of the box model the content of the element itself the padding extending between the element’s content and the border the border of the box surrounding the padding space the margin containing the space between the border and the next page element New Perspectives on HTML and CSS, 6th Edition

Creating a Reset Style Sheet Many designers create a reset style sheet to define their own default styles New Perspectives on HTML and CSS, 6th Edition

Designing the Background CSS also supports background images using background-image: url(url); Background Image Options: background-repeat background-position background-attachment background-size background-clip New Perspectives on HTML and CSS, 6th Edition

Designing the Background You can combine the various background properties into the shorthand property background: color url(url) attachment position repeat; CSS allows you to specify multiple images and their properties in a comma-separated list background-property: value1, value2, … ; New Perspectives on HTML and CSS, 6th Edition

Adding a Page Background New Perspectives on HTML and CSS, 6th Edition

Exploring Browser Extensions Browser extensions that are not part of the official CSS specifications can be identified through the use of a vendor prefix that indicates the browser vendor that created and supports the property New Perspectives on HTML and CSS, 6th Edition

Fixed and Fluid Layouts New Perspectives on HTML and CSS, 6th Edition

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 New Perspectives on HTML and CSS, 6th Edition

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 float: position; New Perspectives on HTML and CSS, 6th Edition

Floating Elements Clearing a float clear: position; New Perspectives on HTML and CSS, 6th Edition

Margins, Padding, and Borders New Perspectives on HTML and CSS, 6th Edition

Setting Margin and Padding Space in the Box Model To set the margin space around an element, use margin: length; where length is the size of the margin using one of the CSS units of measure To set the padding space within an element, use the following: padding: length; To set a margin or padding for one side of the box model only, specify the direction (top, right, bottom, or left). For example, use margin-right: length; to set the length of the right margin. New Perspectives on HTML and CSS, 6th Edition

Setting Margin and Padding Space in the Box Model To set multiple margin or padding spaces, specify the values in a space-separated list starting from the top and moving clockwise around the element. For example, the style margin: top right bottom left; sets margins for the top, right, bottom, and left sides of the element, respectively To set matching top and bottom values and matching right and left values for margins and padding, enter only two values. For example, the style margin: vertical horizontal; sets margins for the top and bottom sides of the element to the value specified by vertical, and sets margins for the right and left sides of the element to the value specified by horizontal New Perspectives on HTML and CSS, 6th Edition

Working with Borders To set the border width, use the property border-width: width; where width is the thickness of the border using one of the CSS units of measure. To set the border color, use border-color: color; where color is a color name or value. New Perspectives on HTML and CSS, 6th Edition

Working with Borders To set the border design, use border-style: style; where style is none, solid, dashed, dotted, double, outset, inset, groove, or ridge To set all of the border options in one style, use the following: border: width color style; New Perspectives on HTML and CSS, 6th Edition

Creating Rounded Corners Rounded corners can be applied to any of the four corners of a block element using the styles border-top-left-radius: radius; border-top-right-radius: radius; border-bottom-right-radius: radius; border-bottom-left-radius: radius; border-radius: top-left top-right bottom-right bottom-left; New Perspectives on HTML and CSS, 6th Edition

Creating Rounded Corners New Perspectives on HTML and CSS, 6th Edition

Creating Rounded Corners New Perspectives on HTML and CSS, 6th Edition

Managing Your Layout To add an outline around an element, use the style property outline: width color style; where width, color, and style are the outline width, outline color, and outline style, respectively New Perspectives on HTML and CSS, 6th Edition

Managing Your Layout New Perspectives on HTML and CSS, 6th Edition

Positioning Elements New Perspectives on HTML and CSS, 6th Edition

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 New Perspectives on HTML and CSS, 6th Edition

Positioning Objects Absolute positioning places an element at specific coordinates either in the page or within a container element Relative positioning is used to move an element relative to where the browser would have placed it if no positioning had been applied New Perspectives on HTML and CSS, 6th Edition

Working with Overflow and Clipping 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; New Perspectives on HTML and CSS, 6th Edition

Working with Overflow and Clipping To specify how browsers should handle content that overflows an element’s boundary, use the style overflow: type; where type is visible (to expand the element height to match the content), hidden (to hide the excess content), scroll (to always display horizontal and vertical scroll bars), or auto (to display scroll bars if needed) To specify how browsers should handle content that overflows in the horizontal direction, use the following style: overflow-x: type; New Perspectives on HTML and CSS, 6th Edition

Working with Overflow and Clipping To specify how browsers should handle content that overflows in the vertical direction, use the following style: overflow-y: type; 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 New Perspectives on HTML and CSS, 6th Edition

Clipping an Element New Perspectives on HTML and CSS, 6th Edition

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; New Perspectives on HTML and CSS, 6th Edition

Stacking Elements New Perspectives on HTML and CSS, 6th Edition