Neal Stublen New Element Styling  html5shiv.js provided support in older IE browsers for new sectioning elements aside, header,

Slides:



Advertisements
Similar presentations
Chapter 6 More CSS Basics Key Concepts Copyright © 2013 Terry Ann Morris, Ed.D 1.
Advertisements

FORMATTING IN CONTEXT. FOLLOW UPS ANCHOR POINTS MUST BE UNIQUE  If you have more than one, how does it know where to go?  They can be repeated across.
Cascading Style Sheets Basics. Why use Cascading Style Sheets? Allows you to set up a series of rules for all pages in a site. The series may be changed.
CSS level 3. History of CSS CSS level 1 – original CSS CSS level 2 CSS level 2 Revision 1 (CSS2.1) – up to CSS2.1 monolithic structure CSS level 3 – specification.
Using CSS (Cascading Style Sheets) Effie Nadiv Edited by permission from author by Amir Kirsh.
1 Pengantar Teknologi Internet W03: CSS Cascading Style Sheets.
Recognizing the Benefits of Using CSS 1. The Evolution of CSS CSS was developed to standardize display information CSS was slow to be supported by browsers.
Web Pages and Style Sheets Bert Wachsmuth. HTML versus XHTML XHTML is a stricter version of HTML: HTML + stricter rules = XHTML. XHTML Rule violations:
Basics of Web Design Chapter 6 More CSS Basics Key Concepts.
Basics of Web Design Chapter 6 More CSS Basics Key Concepts 1.
HTML5 AND CSS3 William Neely CEO, Piecewise.com Matt Brendzel GA Boston Programs Producer.
Principles of Web Design 6 th Edition Chapter 4 – Cascading Style Sheets.
Smashing ~ Chapter 2.  Why are they so important? ◦ Without them we would have no way of assigning styles to elements. ◦ By using selectors we can accomplish.
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.
Week 4.  Three ways to apply CSS: Inline CSS Internal style sheets ( header style information) External style sheets.
Copyright © Terry Felke-Morris WEB DEVELOPMENT & DESIGN FOUNDATIONS WITH HTML5 7 TH EDITION Chapter 4 Key Concepts 1 Copyright © Terry Felke-Morris.
MORE Cascading Style Sheets (The Positioning Model)
Neal Stublen Improvements  New form elements  Assist with validation  Consistency across sites  Changes reduce the need for common.
CSS Positioning Creating Special Effects with CSS CS202 Working with Cascading Style Sheets (Chapter 4) CS202 1.
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.
Ins & Outs of. CSS3 is Modular Can we use it now?
Today’s objectives  Review  CSS | Rules | Declarations  HTML Structure document  Class asignment.
CIS 1315 – Web Development for Educators CIS 1315 HTML Tutorials 3 & 4: Working With CSS.
Mark J Collins October 6 th, Selectors Element selectors Class selectors ID Selectors Attribute selectors Pseudo-class selectors Combining selectors.
Today’s objectives  Review  CSS | Rules | Declarations  HTML Structure document  Class asignment.
CS134 Web Design & Development Cascading Style Sheets (CSS) Mehmud Abliz.
COMP213 – Web Interface Design
Tutorial #6 – Creating Fixed Width Layouts. Tutorial #5 Review – Box Model Every html element is surround by a box Content, Padding, Border, Margin Can.
Neal Stublen Course Road Map  Create web page layouts using CSS  Manage CSS  Test website validity  Create navigation menus using.
Chapter 6 Introducing Cascading Style Sheets Principles of Web Design, 4 th Edition.
Unit I Applying Advanced Styling CSS. CSS3 can style many aspects that in the past required integration of images New features are not supported by all.
LEARN THE QUICK AND EASY WAY! VISUAL QUICKSTART GUIDE HTML and CSS 8th Edition Chapter 14: Enhancements and Effects with CSS3.
>> More on CSS Selectors. Pre-requisite Open the file called sample.txt Copy the all the text from the file Open your browser and go to codepen.io Paste.
Cascading Style Sheets Level 2. Course Objectives, Session 1 Level 1 Quick Review Chapter 8: Adding Graphics to Web Pages Chapter 9: Sprucing Up Your.
Internet Technology Dr Jing LU Updated Dr Violet Snell / Dr Kalin Penev 1 Internet Technology (week 6)  Recap: Validating HTML  Page Layout.
LEARN THE QUICK AND EASY WAY! VISUAL QUICKSTART GUIDE HTML and CSS 8th Edition Chapter 7: CSS Building Blocks.
Developing Web Applications with HTML and CSS “Selectors and Properties”
INTRODUCING CSS What CSS does How CSS works Rules, properties, and values.
BEGINNER WEB DESIGN. INTRODUCTION Vocabulary Design Tools of the Trade HTML CSS.
CIS 228 The Internet 10/18/11 Grouping XHTML. CSS Selectors Rule: selector-group { property-declaration* } Selector-group: selector *, Selector: simple-selector.
Understanding CSS Cascading Style Sheets control the presentation of content in HTML pages Style Sheets separate formatting from the content –Styles defined.
CH 12 CSS Style Sheets 1. Objective What is CSS? Selecting elements Different rules for different media Importing style sheets 2.
Tutorial 3 Designing a Web Page 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.
HTML 5 AND CSS Dr Mohd Soperi Mohd Zahid Semester /16.
Web Design (17) CSS Box Element (2). ‘Box’ Web Site (1) Insert a navigation bar into the index.html file and create links to ‘index.html’, ‘pageone.html’
HTML CS 4640 Programming Languages for Web Applications
Formatting Text with CSS
CSS Layouts: Grouping Elements
Tutorial 4 Topic: CSS 3.0 Li Xu
Advanced CSS BIS1523 – Lecture 20.
CSS3 Cascading Style Sheet
Web Systems & Technologies
Web Development & Design Foundations with HTML5 8th Edition
Chapter 6 More CSS Basics Key Concepts
Cascading Style Sheets
Basics of Web Design Chapter 6 More CSS Basics Key Concepts
CSS Borders and Margins.
Basics of Web Design Chapter 6 More CSS Basics Key Concepts
CSS Style Sheets: Intro
Basics of Web Design Chapter 6 More CSS Basics Key Concepts
SEEM4570 Tutorial 3: CSS + CSS3.0
CS3220 Web and Internet Programming More CSS
CS3220 Web and Internet Programming More CSS
Web Programming and Design
HTML CS 4640 Programming Languages for Web Applications
CS3220 Web and Internet Programming More CSS
Presentation transcript:

Neal Stublen

New Element Styling  html5shiv.js provided support in older IE browsers for new sectioning elements aside, header, footer, article, etc.  We still need to make these render as block elements instead of inline elements (which is the default) article, aside, figure, … { display:block; }

Relational Selectors  article time Descendant – time element within article element  article > time Child – time element is an immediate child of an article element  article + time Adjacent sibling – time element and article element share the same parent and the time element immediately follows the article element

Relational Selectors  article ~ time General sibling – time element and article element share the same parent and time element appears anywhere after the article element

What Does It Select?  li + li Every element in a list except the first one .clock time time elements within an element using class=“clock”  #main > article article elements that are direct children of an element with the id=“main”

Attribute Selectors  video[src] Matches any video element with a src attribute (regardless of its value)  audio[preload=“auto”] Matches any audio element with a preload attribute set to “auto”  p[lang|=“en”] Matches any p element with a lang attribute equal to “en” or starting with “en-”

Attribute Selectors  div[class~=“fancy”] Matches any div element with a class attribute including the whole word “fancy”  article[id^=“news”] Matches any article element containing an id that starts with “news”  article[id$=“news”] Matches any article element containing an id that ends with “news”

Attribute Selectors  article[id*=“news”] Matches any article element with the text “news” appearing within its id attribute

What Does It Select?  time[data-autofill] Any time element with the custom attribute data-autofill  article[class|=“playlist-entry”] Any article element with a class that equals “playlist-entry” or starts “playlist-entry-”  [class~=“banner-ad”] Any element with the “banner-ad” class

Pseudo-class Selectors  :enabled  :disabled  :checked  :indeterminate  :target (# anchor target in url)  :default (among a set of elements)  :valid (based on type/pattern attributes)  :invalid (empty or invalid form elements)

Pseudo-class Selectors  :in-range (elements w/ min/max values)  :out-of-range  :required (form controls)  :optional (non-required form controls)  :read-only (not user alterable)  :read-write (user alterable)

What Does It Select?  time[data-autofill] Any time element with the custom attribute data-autofill  article[class|=“playlist-entry”] Any article element with a class that equals “playlist-entry” or starts “playlist-entry-”  [class~=“banner-ad”] Any element with the “banner-ad” class

Structural Pseudo-classes  :root (the html element)  ul li:nth-child(3) Matches every li element that is the third child of a ul parent  ul li:nth-last-child(2) Matches the next to last li element that is a child of a ul parent  article:nth-of-type(5) Matches the fifth article element within any parent element

Structural Pseudo-classes  article:nth-last-of-type(2) Matches the next to last article element within any parent element  :first-child  :last-child  :first-of-type  :last-of-type  :only-child

Structural Pseudo-classes  div:empty Matches any div element that has no child elements  p:lang(fr) Matches any p element in a language denoted by the “fr” abbreviation  :not(:disabled) Matches all elements that are not disabled

What is “n”?  ul > li:nth-child(2n) Matches every other li element that is an immediate child of a ul element  ul > li:nth-child(2n+1) Matches every other li element that is an immediate child of a ul element, but offset by one

Pseudo-elements  Pseudo-classes target element attributes and states  Pseudo-elements target text that part of the document but not accessible as part of the document tree  Pseudo-elements are targeted with a double colon (::) instead of a single colon (:)

Text Nodes  All text nodes have a first letter and first line ::first-letter ::first-line  Make the first line of the paragraph red.  Double the size of the first letter.

Selected Text  The page can have selected elements ::selection ::-moz-selection (Firefox)  Make selected text white.

Generating Content  Pseudo-elements can be used to insert content into a document ::before ::after  Add a PDF icon after a link.  Insert “(PDF)” text after the anchor content.

Pre-CSS3 Colors  The color red could be expressed as: #f00 #ff0000 rgb(255, 0, 0) rgb(100%, 0%, 0%) red

CSS3 Color Additions  More color keywords blanchedalmond, cornflowerblue, mediumseagreen  RGBA support adds alpha value to specify the color’s opacity rgba(255, 0, 0, 0.4) – red, 40% opaque  Make standard text at 40%, but selected text at 100%

CSS3 Color Additions  HSL, HSLA Hue, saturation, lightness (and alpha) Hue is an integer value Saturation and lightness are percentages 

CSS3 Color Additions  opacity can also be set as a CSS property to adjust the transparency of elements on the page div.halfopaque { color: black; background-color: rgb(255, 0, 0); opacity: 0.5; } div.halfalpha { color: black; background-color: rgba(255, 0, 0, 0.5); }

Border Radius  Rounded corners can be specified on one or more corners of an element border-radius: 25px; border-radius: 10px 10px 5px 5px; border-top-left-radius: 10px; border-radius: 20px / 10px;

Drop Shadows  Drop shadows can be added to any element box-shadow: [inset] horz vert blur spread color;  IE6-IE8 uses a plug-in filter (see text)  Multiple shadows can be separated by commas  Shadows follow element edges

Text Shadows  Shadows can also be added to text content text-shadow: top left blur color;

Ad Styling  Let’s try to add the CSS necessary to style the “Wanted” ad  border-radius  box-shadow  text-shadow