CIS67 Foundations for Creating Web Pages Professor Al Fichera Rev. September 22, 2010—All HTML code brought to XHTML standards. Reference for CIS127 and.

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
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.
CIS 1310 – HTML & CSS 6 Layout. CIS 1310 – HTML & CSS Learning Outcomes  Describe & Apply the CSS Box Model  Configure Float with CSS  Designate Positioning.
CGS 3175: Internet Applications (CSS – Page Layout) Page 1 © Mark Llewellyn CGS 3175: Internet Applications Fall 2008 Cascading Style Sheets – Page Layout.
Tutorial 6 Creating Fixed-Width Layouts
WEB DESIGN Multimedia and Web. Today’s Objectives  Quick review selector types  Layout and positioning.
Week 7 Web Typography. 2 Understanding Type Design Principles.
XP 1 Working with Cascading Style Sheets Creating a Style for Online Scrapbooks Tutorial 7.
MORE Cascading Style Sheets (The Positioning Model)
Working with Cascading Style Sheets. 2 Objectives Introducing Cascading Style Sheets Using Inline Styles Using Embedded Styles Using an External Style.
Web Development & Design Foundations with XHTML Chapter 6 Key Concepts.
Working with Cascading Style Sheets. Introducing Cascading Style Sheets Style sheets are files or forms that describe the layout and appearance of a document.
XP Tutorial 7New Perspectives on Creating Web Pages with HTML, XHTML, and XML 1 Working with Cascading Style Sheets Creating a Style for Online Scrapbooks.
Advanced CSS - Page Layout. Advanced CSS  Compound Selectors:  Is a Dreamweaver term, not a CSS term.  Describes more advanced types of selectors such.
LING 408/508: Programming for Linguists
Cascading style sheets (CSS)
Chapter 7 Web Typography Principles of Web Design, 4 th Edition.
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
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.
Tutorial 4 Creating Special Effects with CSS
Cascading Style Sheets. Defines the presentation of one or more web pages Similar to a template Can control the appearance of an entire web site giving.
CIS67 Foundations for Creating Web Pages Professor Al Fichera Reference for CIS127 and CIS 137.
1 What is CSS?  CSS stands for Cascading Style Sheets  Styles define how to display HTML elements  Styles are normally stored in Style Sheets  Styles.
 A style sheet is a single page of formatting instructions that can control the appearance of many HTML pages at once.  If style sheets accomplished.
CIS67 Foundations for Creating Web Pages Professor Al Fichera Rev. September 14, 2010—All HTML code brought to XHTML standards. Reference for CIS127 and.
Introduction to Programming the WWW I CMSC Winter 2003 Lecture 7.
XP Tutorial 7New Perspectives on HTML and XHTML, Comprehensive 1 Working with Cascading Style Sheets Tutorial 7.
Lecture 2 - HTML and CSS Review SFDV3011 – Advanced Web Development 1.
Web sites Design: Cascading Style Sheet (CSS) (Cont’d) Dimensions and Position of Elements –Width and Height Space –Table Cell Padding –Left and Top Position.
Web Programming Language CSS – Part 2 Dr. Ken Cosh (CSS II)
CIS234A Lecture 8 Instructor Greg D’Andrea. Review Text Table contains only text, evenly spaced on the Web page in rows and columns uses only standard.
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.
XHTML Formatting font with a style declaration. Formatting Font HTML uses the font tag to change size and family of font But… the font tag is being deprecated.
INTRODUCTORY Tutorial 5 Using CSS for Layout and Printing.
CNIT 132 – Week 4 Cascading Style Sheets. Introducing Cascading Style Sheets Style sheets are files or forms that describe the layout and appearance of.
Web Design (12) CSS Introduction. Cascading Style Sheets - Defined CSS is the W3C standard for defining the presentation of documents written in HTML.
Web Foundations MONDAY, OCTOBER 7, 2013 LECTURE 7: CSS LINK COLORS, INTERMEDIATE CSS.
Cascading Style Sheets (CSS) Part II IT210: Web-based IT.
Web Technologies Beginning Cascading Style Sheets (CSS) 1Copyright © Texas Education Agency, All rights reserved.
Web Development & Design Foundations with XHTML Chapter 6 Key Concepts.
CONTROLLING Page layout
Relative, absolute, and Floating Positioning, Cascading Style Sheet, and Inheritance.
5 th ed: Chapter 4 4 th ed: Chapter 5 SY306 Web and Databases for Cyber Operations SlideSet #5: Advanced CSS.
CSS: Cascading Style Sheets Part II. Style Syntax.
Introduction to Programming the WWW I CMSC Summer 2003 Lecture 6.
- WE’LL LOOK AT THE POSITION PROPERTY AND HOW CSS RESOLVES CONFLICTS BETWEEN STYLING INSTRUCTIONS The position property; CSS specificity hierarchy.
Today’s objectives  Announcements  Positioning  Measurement units.
CIS67 Foundations for Creating Web Pages Professor Al Fichera Rev. August 25, 2010—All HTML code brought to XHTML standards. Reference for CIS127 and CIS.
NASRULLAHIBA.  It is time to take your web designing skills to the next level with Cascading Style Sheets (CSS). They are a way to control the look and.
Understanding CSS Cascading Style Sheets control the presentation of content in HTML pages Style Sheets separate formatting from the content –Styles defined.
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.
Chapter 4 and 5. Objectives Introduce markup: elements and attributes How browsers interpret HTML documents Basic structure of HTML document What do style.
XP Tutorial 7New Perspectives on HTML and XHTML, Comprehensive 1 Working with Cascading Style Sheets Creating a Style for Online Scrapbooks Tutorial 7.
Cascading Styles Sheets Positioning HTML elements.
CHAPTER 15 Floating and Positioning. FLOAT VS. POSITION  Floating an element moves it to the left or right, allowing the following text to wrap around.
CSS Introductions. Objectives To take control of the appearance of a Web site by creating style sheets. To use a style sheet to give all the pages of.
Cascading Style Sheets Layout
Webpage layout using CSS
Cascading Style Sheets (Layout)
The Internet 10/25/11 XHTML Tables
Styles and the Box Model
MORE Cascading Style Sheets (The Positioning Model)
Web Programming Language
Floating and Positioning
HTML / CSS Mai Moustafa Senior Web Designer eSpace eSpace.
Web Programming Language
CGS 3066: Web Programming and Design Fall 2019 CSS Part 2
Presentation transcript:

CIS67 Foundations for Creating Web Pages Professor Al Fichera Rev. September 22, 2010—All HTML code brought to XHTML standards. Reference for CIS127 and CIS 137

Introduction CSS Positioning (CSS-P) is more accurate than either graphics or tables. The results are displayed much faster. September 22, CSS-P Styles Positioning by Professor Al Fichera

Overview CSS-P allows us to position elements on the screen either: Exactly where we want them or In relation to other elements on the screen. September 22, CSS-P Styles Positioning by Professor Al Fichera

Left & Top Properties The left and top properties are very straightforward: h3 {position: absolute; left:100px; top:20px} September 22, CSS-P Styles Positioning by Professor Al Fichera

Left & Top Properties L eft defines the amount of space between the element and the left edge of the browser window. Top defines the space between the element and the top of the window. September 22, CSS-P Styles Positioning by Professor Al Fichera

Height Property The height attribute works just like width, only in the vertical direction: div {position: absolute; left:200px; top:80px; height:150px } September 22, CSS-P Styles Positioning by Professor Al Fichera

Width Property You can control how far the text flows but only on absolute positions. How wide the box that contains the element should be. September 22, CSS-P Styles Positioning by Professor Al Fichera

Layering Text and Images The best way to overlap elements on a Web page. It's not a negative margin or small line-height. It's a combination of position and... z-index September 22, CSS-P Styles Positioning by Professor Al Fichera

Using Z-Index When you position multiple elements and they overlap, use z-index to specify which one should appear on top. h2 { position: relative; left:10px; top:0px; z-index:10} h1 { position: relative; left:33px; top:-45px; z-index:1} September 22, CSS-P Styles Positioning by Professor Al Fichera

Z-Index Layering Watch these CSS rules play out (I've colored the text green so you can see the difference): LAYERING BY z-index September 22, CSS-P Styles Positioning by Professor Al Fichera

Why Does It Work? Since the text has the higher z-index value, it appears on top of the text. Use plain integers for the values. The z-index property works for elements that are positioned absolutely or relatively. September 22, CSS-P Styles Positioning by Professor Al Fichera

Z-Indexed Images You can also give images a Z-Index. Consider wrapping the tag in a or tag, and then apply the property to the or if you give them a z-index value. Remember, div tags once closed sets you on the next line. Span tags do not. September 22, CSS-P Styles Positioning by Professor Al Fichera

Z-Indexed Images These images were placed without z-indexes. They will wrap to any window configuration. September 22, CSS-P Styles Positioning by Professor Al Fichera

Z-Indexed Images Z-index as 1, 2, 3 Z-index as 3, 2, 1 Z-index as 2, 3, 1 September 22, CSS-P Styles Positioning by Professor Al Fichera

Positioning Properties CSS-P is best associated with a CLASS or ID, that way they can be applied as needed instead of associated permanently with a particular tag. September 22, CSS-P Styles Positioning by Professor Al Fichera

Positioning Type An element can have one of three (3) different position values. Relative Static Absolute (everyone's favorite) September 22, CSS-P Styles Positioning by Professor Al Fichera

Relative Positioning Relative positioning flows the element Inline, but allows you to move the element around within the element's natural position on the screen. Relative elements get placed on the screen in the order written, so items can be placed before it or after it. September 22, CSS-P Styles Positioning by Professor Al Fichera

#pos1 ID Selector in Use You may wish to add an inline style to the div on the page. #pos1 {position: relative; left:80px; top:50px;} Place any RELATIVE text you want here. September 22, CSS-P Styles Positioning by Professor Al Fichera

Relative Style Block Style Block code used in the HEAD for the Boxes example shown. #pos1 {position: relative; left:80px; top:50px;} #pos2 {position: relative; left:160px; top:100px;} #pos3 {position: relative; left:240px; top:150px;} September 22, CSS-P Styles Positioning by Professor Al Fichera

Inline DIV ID tag Inline code used in the body. Place any STATIC text you want here... September 22, CSS-P Styles Positioning by Professor Al Fichera

Relative Positioning September 22, CSS-P Styles Positioning by Professor Al Fichera

Static Positioning Static positioning flows your content Inline, but the position of element can't be touched. (Example, Pink Boxes.) This is the normal default style. September 22, CSS-P Styles Positioning by Professor Al Fichera

Static Style Block Style Block code used in the HEAD for the Boxes example shown. #pos4 {position: static; left:80px; top:50px;} #pos5 {position: static; left:160px; top:100px;} #pos6 {position: static; left:240px; top:150px ;} September 22, CSS-P Styles Positioning by Professor Al Fichera

Inline DIV ID tag Inline code used in the BODY. Place any STATIC text you want here... September 22, CSS-P Styles Positioning by Professor Al Fichera

Static Positioning September 22, CSS-P Styles Positioning by Professor Al Fichera

Absolute Positioning An Absolute element is placed independently of other elements on the screen in a specific position in the window. September 22, CSS-P Styles Positioning by Professor Al Fichera

Absolute Style Block Style Block code used in the HEAD for the Boxes example shown. #pos7 {position: absolute; left:80px; top:50px;} #pos8 {position: absolute; left:160px; top:100px;} #pos9 {position: absolute; left:240px; top:150px;} September 22, CSS-P Styles Positioning by Professor Al Fichera

Inline DIV ID Inline code used in the BODY. Place any ABSOLUTE text you want here. September 22, CSS-P Styles Positioning by Professor Al Fichera

All Styles Together September 22, CSS-P Styles Positioning by Professor Al Fichera

Newsletter A special Newsletter format used these Absolute positions in the Style Block. #pos1 {position: absolute; left:1em; top:360px;} #pos2 {position: absolute; left:1em; top:450px;} #pos3 {position: absolute; left:23em; top:10px;} September 22, CSS-P Styles Positioning by Professor Al Fichera

Newsletter The SPAN tag houses the ID tag and is used for paragraph placement, it adds more information including width and padding, etc. September 22, CSS-P Styles Positioning by Professor Al Fichera

Example Newsletter Created with the Absolute Positioning. September 22, CSS-P Styles Positioning by Professor Al Fichera

Floating Elements Floating behavior around positioned elements can change dependent upon if they have been fixed absolute. If position: absolute; is set and the top and left margins or the width has been set, the text in the floating element will not wrap around it. If position: absolute; is set but the margins and width are not set, other elements will wrap around it. September 22, CSS-P Styles Positioning by Professor Al Fichera

Floating Elements Margins are not set in this example. p.flt {float: right; font-weight: bold; font-size: 12pt; font-family: arial; color: navy; text-align: justify; width:600px; } Lorem ipsum … September 22, CSS-P Styles Positioning by Professor Al Fichera