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.

Slides:



Advertisements
Similar presentations
Use Tables for Layout Control Day 7. You will learn to: Understand Tables Create a Simple Table Modify Your Tables Appearance Create Page Layouts with.
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.
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.
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.
SM5312 week 11: CSS Menus & Navigation Bars1 An Introduction to Cascading Style Sheets CSS Menus and Navigation Bars Nick Foxall.
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:
Web Design HTML Basic Robertus Setiawan Aji Nugroho References: w3schools.com.
XP 1 Working with Cascading Style Sheets Creating a Style for Online Scrapbooks Tutorial 7.
MORE Cascading Style Sheets (The Positioning Model)
ADVANCED CSS: (LAYERED) DISPLAY & PRESENTATION PA 70b – Giordon Stark.
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.
Svetlin Nakov Telerik Web Design Course html5course.telerik.com Manager Technical Training
IMAGES Controlling size of images in CSS Aligning images in CSS Adding background images.
HTML & CSS A brief introduction. OUTLINE 1.What is HTML? 2.What is CSS? 3.How are they used together? 4.Troubleshooting/Common problems 5.More resources.
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.
New Perspectives on XML, 2nd Edition Tutorial 5 1 TUTORIAL 5 WORKING WITH CASCADING STYLE SHEETS.
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.
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.
Copyright © Terry Felke-Morris WEB DEVELOPMENT & DESIGN FOUNDATIONS WITH HTML5 7 TH EDITION Chapter 6 Key Concepts 1 Copyright © Terry Felke-Morris.
Chapter 2 HTML Basics Key Concepts Copyright © 2013 Terry Ann Morris, Ed.D 1.
IDs versus Classes Naming Your Tags for Maximum Functionality.
Neal Stublen Course Road Map  Create web page layouts using CSS  Manage CSS  Test website validity  Create navigation menus using.
Chapter 2 Web Page Design Mr. Gironda. Elements of a Web Page These are things that most web pages use.
Web Programming Language CSS – Part 2 Dr. Ken Cosh (CSS II)
Svetlin Nakov Telerik Corporation
INT222 - Internet Fundamentals Shi, Yue (Sunny) Office: T2095 SENECA COLLEGE.
Course created by Sarah Phillips BBCD Melbourne BAPDCOM Version 1 – April 2013.
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.
Internet Technology Dr Jing LU Updated Dr Violet Snell / Dr Kalin Penev 1 Internet Technology (week 6)  Recap: Validating HTML  Page Layout.
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 Foundations MONDAY, OCTOBER 7, 2013 LECTURE 7: CSS LINK COLORS, INTERMEDIATE CSS.
Interface Design 2 Week 7. Interface Design 2 :: Week 7 :: Calendar.
CONTROLLING Page layout
Positioning Objects with CSS and Tables
CIS67 Foundations for Creating Web Pages Professor Al Fichera Rev. September 22, 2010—All HTML code brought to XHTML standards. Reference for CIS127 and.
Session: 8. © Aptech Ltd. 2Creating Navigational Aids and Division-Based Layout / Session 8  Explain HTML5 semantic tags  Explain HTML5 semantic tag.
CSS IS A LANGUAGE DESIGNED TO TARGET HTML ELEMENTS AND NODES BY TYPE, CLASS, ID AND VALUE, AND CHANGE THEIR VALUES CSS – change how your HTML looks 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.
Understanding CSS Cascading Style Sheets control the presentation of content in HTML pages Style Sheets separate formatting from the content –Styles defined.
EXTERNAL STYLESHEETS AND MORE HTML STYLING HTML and CSS part 2.
XP Tutorial 7New Perspectives on HTML and XHTML, Comprehensive 1 Working with Cascading Style Sheets Creating a Style for Online Scrapbooks Tutorial 7.
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.
Cascading Style Sheets for layout
Working with Cascading Style Sheets
CSS Layouts: Positioning and Navbars
Advanced CSS BIS1523 – Lecture 20.
Cascading Style Sheets for layout
Cascading Style Sheets (Layout)
Putting Things Where We Want Them
Chapter 7 Page Layout Basics Key Concepts
Web Development & Design Foundations with HTML5 8th Edition
The Internet 10/25/11 XHTML Tables
Styles and the Box Model
Controlling Layout with Style Sheets
MORE Cascading Style Sheets (The Positioning Model)
Web Development & Design Foundations with H T M L 5
Floating and Positioning
Positioning.
The Internet 10/20/11 CSS Layout
Presentation transcript:

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

FUN CSS TRICKS PA 70c – Giordon Stark

Table of Contents Review of Last Time Let’s learn some tricks!  More on Floats  Absolute Positioning inside Relative Positioning  Positioning in General  Vertical Alignment  Child and Sibling Selectors  CSS Transparency  Sprites, Efficiency, and Cool Date Display

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

The Box Model (again)

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.  Div, nav, section, aside, header, footer, etc… (HTML5) For Inline elements: span tag.  Neither really have any HTML attributes which makes them perfect canvases for styling pages.

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” Example:  (if time permits)

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.

TIME TO SPICE UP YOUR CODE Tips and Tricks

A brief word… I don’t intend to rewrite the world of CSS as it is. I’ll explain many of the CSS tricks and tips using website blogs as I feel they have the best explanation. I will try to summarize key points of each website as needed. Want a background image that stretched the whole page…? Here’s how to do it (note, not very simple!) 

More on Floats CSS Positioning Property “Floated elements remain a part of the flow of the web page.” - “Absolutely positioned page elements are removed from the flow of the webpage…” “…floats can be used to create entire web layouts.” “An element that has the clear property set on it will not move up adjacent to the float like the float desires, but will move itself down past the float.” “If this parent element contained nothing but floated elements, the height of it would literally collapse to nothing.” Three Methods of Clearing Floats:  Empty Div Method, Overflow Method, Easy Clearing Method Overflow Method is explained here: overflow-property/ overflow-property/

Absolute Positioning inside Relative Positioning relative-positioning/ relative-positioning/ “A page element with relative positioning gives you the control to absolutely position children elements inside of it.” Why do we want it?  Certain buttons, functionality, and simplicity Combining this with the :after, :before selectors and the content attribute – we can insert anything possible! 

Positioning in General they-differ/ they-differ/ To kind of drive the point home from last week… 4 values: Static (default), Relative, Absolute, Fixed Static  “the element will flow into the page as it normally would” Relative  “What it really means is “relative to itself”.” Absolute  Position anywhere you want; use top/left/right/bottom to position  “Remember that these values will be relative to the next parent element with relative (or absolute) positioning.”  Trade-Off: “these elements are removed from the flow of elements on the page” Fixed  “A fixed position element is positioned relative to the viewport, or the browser window itself.”

Vertical Alignment Really no summary, just look at the link and check out the images for examples of each value. Possible values are:  Top and Bottom  Text-Top and Text-Bottom  Baseline  Middle  Sub and Super *Note: it makes sense only for tables and images*

Child and Sibling Selectors Descendant Selector  “… select any list items that are anywhere underneath an unordered list in the markup structure…” Child Combinator Selector  “… select list items that are direct children of an unordered list...” Adjacent/General Sibling Combinator Selector  “… select an element that is directly after another specific element…”  “… element being selected doesn’t need immediately succeed the first element, but can appear anywhere after it…” For list of the specifications from W3C: 

CSS Transparency Use opacity or rgba! Opacity applies to the whole element while rgba allows you to create semi- transparent background or font colors. p, nav { background-color: rgba(0,0,0,0.5); } div { opacity: 0.75; }

Sprites and Efficiency A sprite is a HUGE image. Why have sprites?  Calling and loading one file of 10 KB size is faster than calling and loading 10 files of 1 KB size each. How to do it?  Use Paint or GIMP and a lot of elbow grease  Use What can’t they do?  Repeating graphics

Sprites and Date Display Somewhat self-explanatory. The text-indent method is used for hiding the text and replacing it with an image  It also applies the ability to have multiple classes inside one tag

Lists to Links Similar to ZenGarden, it applies many different stylesheets to the same list to create amazing displays We’ll use the links on my website as a basic example… and see how flexible it can be!

More CSS3 Stuff It’s pretty hard to go over EVERYTHING out there, but for a list of cool things: introduction/ introduction/ We’ll also look at the transform/transition examples that I’ve created so you get an idea of it.

MAKING MAGIC Practice Session (last week)

Exercise/Homework This is the second week of creating your layout page (one page) for your student website. You should have 1. Visualized your site layout 2. Developed a skeleton. 3. Developed the CSS. This week, you will improve upon your code  Use as many html5 features as you can  Instead of divs everywhere, try grouping them into nav or section or aside or header or footer (learn.caltech.edu example)  Use as many accessibility attributes (title, alt, etc…)  Make the site visually appealing using the latest features of CSS3  Transparency, gradients, transformations, hovers Make sure to put your website online (using ugcs for instance) with index.html and main.css as your files.