ADVANCED CSS: (LAYERED) DISPLAY & PRESENTATION PA 70b – Giordon Stark.

Slides:



Advertisements
Similar presentations
Table, List, Blocks, Inline Style
Advertisements

CSS Cascading Style Sheets. Objectives Using Inline Styles Working with Selectors Using Embedded Styles Using an External Style Sheet Applying a Style.
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.
Cascading Style Sheets
Today CSS HTML A project.
HTML Overview - Cascading Style Sheets (CSS). Before We Begin Make a copy of one of your HTML file you have previously created Make a copy of one of your.
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.
INTRODUCTORY Tutorial 7 Creating Liquid Layouts. XP Objectives Discern the differences among various types of layouts Create a liquid layout Create a.
1 Dreamweaver CS5 intermediate class by Cookie Setton Build a CSS website WITHOUT TABLES Just when you thought you were starting to understand HTML coding,
Web Design with Cascading Style Sheet Lan Vu. Overview Introduction to CSS Designing CSS Using Visual Studio to create CSS Using template for web design.
Tutorial 6 Creating Fixed-Width Layouts
Using CSS for Page Layout. Types of HTML Elements Block-Level Element –Creates blocks of content e.g. div, h1..h6, p, ul, ol, li, table, form –They start.
XP 1 Working with Cascading Style Sheets Creating a Style for Online Scrapbooks Tutorial 7.
FOR NEXT WEEK’S CLASS BECAUSE I SAID SO. THAT IS MY FINAL ANSWER. NO IFS, ANDS, OR BUTS. (INSERT OTHER AFFIRMATIVES HERE) GET UGCS.
MORE Cascading Style Sheets (The Positioning Model)
4.01 Cascading Style Sheets
Working with Cascading Style Sheets. 2 Objectives Introducing Cascading Style Sheets Using Inline Styles Using Embedded Styles Using an External Style.
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.
Working with Cascading Style Sheets. Introducing Cascading Style Sheets Style sheets are files or forms that describe the layout and appearance of a document.
Cascading Style Sheet Basics Pepper. Looking at the HTML See the surrounding tags See head, body, paragraph, header See the ending tags See the list.
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.
Cascading style sheets (CSS)
The Characteristics of 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.
Chapter 2 HTML Basics Key Concepts Copyright © 2013 Terry Ann Morris, Ed.D 1.
IDs versus Classes Naming Your Tags for Maximum Functionality.
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.
CSS Netcentric. What is CSS O CSS stands for Cascading Style Sheets O Styles define how to display HTML elements O Styles were added to HTML 4.0 to solve.
 This presentation introduces the following: › 3 types of CSS › CSS syntax › CSS comments › CSS and color › The box model.
Neal Stublen Course Road Map  Create web page layouts using CSS  Manage CSS  Test website validity  Create navigation menus using.
CSS Basic (cascading style sheets)
Introduction to CSS. What is CSS?  Cascading Style Sheets  Used for styling HTML  Also important in javascript and jquery for selectors  External.
Introduction to Programming the WWW I CMSC Winter 2003 Lecture 7.
Essentials of HTML Class 4 Instructor: Jeanne Hart
Cascade Style Sheet Introduction. What is CSS?  CSS stands for Cascading Style Sheets  Styles define how to display HTML elements  Styles were added.
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 Programming Language CSS – Part 2 Dr. Ken Cosh (CSS II)
DIV, Span, CSS.
Course created by Sarah Phillips BBCD Melbourne BAPDCOM Version 1 – April 2013.
XP Review 2 New Perspectives on JavaScript, Comprehensive1 Introducing Cascading Style Sheets Formatting Web Pages with 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.
CNIT 132 – Week 4 Cascading Style Sheets. Introducing Cascading Style Sheets Style sheets are files or forms that describe the layout and appearance of.
Cascading Style Sheets (CSS) Part II IT210: Web-based IT.
CONTROLLING Page layout
IN THE DOCUMENT OBJECT MODEL, EACH LINE OF HTML IS AN ELEMENT (AN OBJECT), ABLE TO HAVE ATTRIBUTES, PROPERTIES AND VALUES. CSS TELLS THE BROWSER HOW TO.
CIS67 Foundations for Creating Web Pages Professor Al Fichera Rev. September 22, 2010—All HTML code brought to XHTML standards. Reference for CIS127 and.
- WE’LL LOOK AT THE POSITION PROPERTY AND HOW CSS RESOLVES CONFLICTS BETWEEN STYLING INSTRUCTIONS The position property; CSS specificity hierarchy.
BEGINNER WEB DESIGN. INTRODUCTION Vocabulary Design Tools of the Trade HTML CSS.
THE NORMAL DOCUMENT FLOW from Quick Tip: Utilizing Normal Document Flow by Alex Rodrigues on Web tuts.
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.
XP Tutorial 7New Perspectives on HTML and XHTML, Comprehensive 1 Working with Cascading Style Sheets Creating a Style for Online Scrapbooks Tutorial 7.
CASCADING STYLE SHEET CSS. CSS stands for Cascading Style Sheets Styles define how to display HTML elements Styles were added to HTML 4.0 to solve a problem.
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.
CSS.
Working with Cascading Style Sheets
Cascading Style Sheets Layout
CSS Layouts: Positioning and Navbars
Cao Yuewen SEEM4570 Tutorial 03: CSS Cao Yuewen
Cascading Style Sheets
IS333: MULTI-TIER APPLICATION DEVELOPMENT
Styles and the Box Model
Controlling Layout with Style Sheets
MORE Cascading Style Sheets (The Positioning Model)
DynamicHTML Cascading Style Sheet Internet Technology.
DynamicHTML Cascading Style Sheet Internet Technology.
Floating and Positioning
Presentation transcript:

ADVANCED CSS: (LAYERED) DISPLAY & PRESENTATION PA 70b – Giordon Stark

Table of Contents Review of Last Time Introduction to Layouts Elaboration on and More CSS Properties Let’s learn some CSS!  Display, Dimension, Position, Layering Practice Sessions  Recreation and Adaptation: Getting rid of tables

BECAUSE NOT EVERYONE HAS PERFECT MEMORY RECALL. A Review of Last Time

Terminology Rule  Contains the selector and one or more declarations Selector  A group of styles – creates the link between the element and rules to apply  3 types: HTML Tag Selector, Class Selector, ID Selector Declaration  A property and value pair, uses the format “property:value;”  W3C:

The CSS “Recipe” Internal CSS /* CSS here */ Inline CSS (use sparingly, if at all!) ” /> External CSS  File Type:.css  No necessary ‘wrappers’ 

Selectors Tag Selectors – Multiple Elements hr {color:sienna;} p {margin-left:20px;} body {background-image:url("images/back40.gif");} Class Selectors – Multiple Elements.headline {font-family:arial; font-size:14px; color:red}  HTML: stuff other stuff ID Selectors – Singular Element #layer1 {position:absolute; left:100;top:100; z-Index:0}  HTML: stuff

Multiple Style Sheets + Cascading Styles are specified  inside an HTML element  inside the head section of an HTML page  in an external CSS file When you have multiple style sheets for one page, including both internal, external, and inline; CSS cascades all the rules into one singular rule. The hierarchy is (from highest priority to lowest)  Inline Style  Internal Style Sheet  External Style Sheet  Browser Default An example:

Inline Elements versus Block Elements Block level elements include  Heading  Division  Paragraph  Blockquote  Ordered and Unordered Lists Inline elements include  Span  Anchor

Block Level and Inline Elements Block Level elements display text on its own line (line breaks before and after) – my definition of ‘layout’ elements Rules  Block Level elements can contain other block-level elements and inline elements  Inline elements cannot contain block-level elements Bad Example Heading Fixed Example Heading

Block Level and Inline Elements In CSS  Inline elements are used for changing  Colors (background and text)  Font styles (font weight, text decoration, font family, etc..)  Block level elements are used for changing  Positioning declarations (locational)  Dimensional declarations (width and height)  Padding and Margins Major Differences  Block elements take 100% of available width (of their parent element)  Takes whatever height it needs to fill its content

Some Tips and Tricks Let’s do a quick refresher and learn some extra tricks on our CSS coding:  shorthand-techniques-youll-use-everyday/ shorthand-techniques-youll-use-everyday/  stylesheets/ stylesheets/   principles-for-keeping-your-code-clean/ principles-for-keeping-your-code-clean/

GOOD LAYOUTS, GOOD CSS, GOOD TIMES… Introduction to Layouts

Good Layouts What should a good layout have?  Header  Footer  Content  Left and/or Right Columns  Navigation  Menu  Logo/Banner Where might these be on a page?

CSS and Layouts A major benefit is that you’re no longer forced to use tables to create layouts with complete control   p p We use block level elements (divs) and inline elements (span) to make these layouts Don’t forget about the box model, everything is made possible!

The Box Model (again)

WHY DO WE CARE ABOUT THESE TWO? HOW ARE THEY GOOD FOR LAYOUTS? WHY DO WE CALL THEM “CLEAN SLATES”? Division and Span

Div (short for division) divides the content into individual sections. Each section can then have its own formatting, as specified by the CSS. Div is a block-level container, meaning that there is a line feed after the tag.

Division and Span Span is similar to div in that they both divide the content into individual sections. The difference is that span goes into a finer level, so we can span to format a single character if needed. There is no line feed after the tag.

The Clean Slates Have you ever thought that it would make sense to have a ‘blank slate’ html tag that had absolutely zero styles? For Block Level elements: division tag.  For Inline elements: span tag.  Neither really have any HTML attributes applied by default which makes them perfect canvases for styling pages.

Division and Span So exactly how are they used in HTML?  

BECAUSE THE WORLD IS NOT ENOUGH… More CSS Properties!

CSS Properties Mainly, we’ll be talking about division and span. In fact, we’ll use website tutorials to make the point clearer… because nobody explains it better than these guys (other than me). Let’s learn about the following properties:  position: {absolute, relative, static, inherit};  top/left/right/bottom: {number};  float: {left, right, both, none};  clear: {left, right, both, none};

CSS Properties Websites    training/css/positioning/ training/css/positioning/ We’ll summarize key concepts on the next few slides

CSS Properties Float  Push it as far as possible to the right or to the left, and allow text to wrap around it  Required with variable height columns Clear  Used on a floated element to force it below adjacent floats These are very hard to master. If you ever get confused on how they work, Google “CSS Floats” for examples.  

CSS Properties Absolute & Fixed Positioning  Position is determined by its offset values (top, left, right, bottom) from its containing element  Removed from the normal flow  The containing block is the nearest element outside it that has a position of absolute, relative or fixed  If there is no such element, the browser window is used  If it is fixed positioning, the browser window is ALWAYS used Relative Positioning  Position is determined by its offset values  Not removed from normal flow  The containing block of their closest, block-level ancestor  For absolute elements the containing element can be an inline element (not for relatively positioned elements)

CSS Properties Stacking Order – use the z-index!  Two things determine the stacking order: the stacking context and the z-index value  An element with a higher z-index appears in front of an element with a lower z-index  When two elements have the same value (or if neither has been assigned a value) the source order is used  Stacking context also determines the stacking order  Finally, some elements just get overlapped regardless of z-index: “Overlapping plug-ins”

Summary For a quick reference to other properties and their values, just use w3schools website:  Categorized (in particular, look at pseudo-elements)  For a list of supported units  For a (short) list of colors  For a list of selectors  When in doubt, Google is your friend.

RECREATION AND ADAPTATION ( DESTROYING TABLES EVERYWHERE! ) Practice Session

Baby Steps – The Exercise floatingLayout.html We’re going to recreate this layout step-by-step.  The layout we need to re-create is:  s/floatingLayout.png s/floatingLayout.png

THE START OF YOUR PROJECT! Exercise/Homework

No image! This is the first week of creating your layout page (one page) for your student website. To get started… 1. Visualize your site layout, draw it. Where do you want your (vertical/horizontal) navigation? Where’s your content? What colors do you want to use? (find those colors). 2. Develop a skeleton using the simplest of html elements: div, span, paragraph, heading, anchor links, lists. 3. Develop the CSS, starting with dimensions and positions, then working down to the coloring. (It helps if you add borders to the elements you’re moving, so you can see where they are). 4. Add in colors, themes, styles, and filler content. Personalize it and make it unique.

Exercise/Homework You will be graded on the following criteria:  Creativity  of layout – how original is the layout?  of color scheme – how well do the colors blend together? Clash?  Efficiency  How well is your layout separated from your styles?  100% Efficiency:  Etiquette  Is your code presentable, easy-to-read, indented, and structured properly?  Does it conform to standards of XHTML strict coding?

Example (don’t mimic this)

Another Example (don’t mimic this)