Advanced CSS. Slava Kim

Similar documents
Client-Side Web Technologies. CSS Part II

Introducing CSS Flexbox Layout

COMP519 Web Programming Lecture 8: Cascading Style Sheets: Part 4 Handouts

INFS 2150 Introduction to Web Development

INFS 2150 Introduction to Web Development

16A CSS LAYOUT WITH FLEXBOX

CHRIS SAUVE 2

CSC Website Design, Spring CSS Flexible Box

CSS Selectors. element selectors. .class selectors. #id selectors

Graduating to Grid. An Event Apart Orlando

CSS Layout Part I. Web Development

Zen Garden. CSS Zen Garden

Page Layout. 4.1 Styling Page Sections 4.2 Introduction to Layout 4.3 Floating Elements 4.4 Sizing and Positioning

subject to an additional IP rights grant found at polymer.github.io/patents.txt -->

Welcome Please sit on alternating rows. powered by lucid & no.dots.nl/student

FLOATING AND POSITIONING

8/19/2018. Web Development & Design Foundations with HTML5. Learning Objectives (1 of 2) More on Relative Linking. Learning Objectives (2 of 2)

Web Design and Implementation

CS193X: Web Programming Fundamentals

Parashar Technologies HTML Lecture Notes-4

CSS3 Basics. From & CSS Visual Dictionary Learning Curve Books, LLC

INFS 2150 Introduction to Web Development

INFS 2150 Introduction to Web Development

TAG STYLE SELECTORS. div Think of this as a box that contains things, such as text or images. It can also just be a

Cascading Style Sheets (CSS)

CSS for Page Layout Robert K. Moniot 1

Responsive Web Design (RWD)

Index LICENSED PRODUCT NOT FOR RESALE

Web Design & Dev. Combo. By Alabian Solutions Ltd , 2016

FLEXBOX FOR RESPONSIVES WEBDESIGN

CSS Futures. Web Development

Introduction to HTML & CSS. Instructor: Beck Johnson Week 5

Here is the design that I created in response to the user feedback.

The Importance of the CSS Box Model

In this tutorial, we are going to learn how to use the various features available in Flexbox.

Web Programming and Design. MPT Junior Cycle Tutor: Tamara Demonstrators: Aaron, Marion, Hugh

PUTTING FLEXBOX INTO PRACTICE. Blend Conference September Zoe Mickley

ORB Education Quality Teaching Resources

GIMP WEB 2.0 MENUS WEB 2.0 MENUS: HORIZONTAL NAVIGATION BAR CREATING AN HTML LIST

Frontend guide. Everything you need to know about HTML, CSS, JavaScript and DOM. Dejan V Čančarević

the missing manual0 O'REILLY Third Edition David Sawyer McFarland Beijing Cambridge The book that should have been in the box Farnham

Cascading Style Sheets for layout II CS7026

CSS. MPRI : Web Data Management. Antoine Amarilli Friday, December 7th 1/43

Website Development with HTML5, CSS and Bootstrap

The Scope of This Book... xxii A Quick Note About Browsers and Platforms... xxii The Appendices and Further Resources...xxiii

Styles, Style Sheets, the Box Model and Liquid Layout

CSS often uses hyphens in CSS property names but JavaScript uses camel case, e.g. color: blue; p { <!DOCTYPE html> <meta charset="utf-8" /> <head>

CSS. Shan-Hung Wu CS, NTHU

Fixed-width. Liquid. Web Development 1 CS1115/CS5002. Types of layout. relative, fixed), CSS Flexbox layout or CSS Grid Layout

Content Elements. Contents. Row

FRONT END DEVELOPER CAREER BLUEPRINT

Fish Eye Menu DMXzone.com Fish Eye Menu Manual

Website Design (Weekday) By Alabian Solutions Ltd , 2016

COMS 359: Interactive Media

This course is designed for web developers that want to learn HTML5, CSS3, JavaScript and jquery.

Make a Website. A complex guide to building a website through continuing the fundamentals of HTML & CSS. Created by Michael Parekh 1

A pixel is not a pixel. Peter-Paul Koch BlackBerry Jam, 6 February 2012

CSC309 Winter Lecture 2. Larry Zhang

Overview of the Adobe Dreamweaver CS5 workspace

What do we mean by layouts?

Positioning in CSS: There are 5 different ways we can set our position:

Class 3 Page 1. Using DW tools to learn CSS. Intro to Web Design using Dreamweaver (VBUS 010) Instructor: Robert Lee

C A S C A D I N G S T Y L E S H E E T S

How to lay out a web page with CSS

HTML and CSS a further introduction

CS7026 Media Queries II. Different Screen Size Different Design

Website Design (Weekend) By Alabian Solutions Ltd , 2016

NetObjects Fusion 10 Build Great Sites.

CSS.

IDM 221. Web Design I. IDM 221: Web Authoring I 1

Notes - CSS - Flexbox

How to set up a local root folder and site structure

Getting Started with CSS Sculptor 3

N/A. JSN PageBuilder 2 Configuration Manual Introduction. System Requirements. Product Usage. Joomla Requirements. Server Requirement

READSPEAKER ENTERPRISE HIGHLIGHTING 2.5

WEB DESIGNING CURRICULUM

If it s interactive, it needs a focus style. October 15, 2018

The Benefits of CSS. Less work: Change look of the whole site with one edit

Getting Started with Eric Meyer's CSS Sculptor 1.0

CSS THE M\SS1NG MANUAL. David Sawyer McFarland. POGUE PRESS" O'REILLr Beijing Cambridge Farnham Köln Paris Sebastopol Taipei Tokyo

Web Engineering CSS. By Assistant Prof Malik M Ali

<style type="text/css"> <!-- body {font-family: Verdana, Arial, sans-serif} ***set font family for entire Web page***

Chapter 7 BMIS335 Web Design & Development

Certified CSS Designer VS-1028

HTML Organizing Page Content

COMSC-031 Web Site Development- Part 2

Software. Full Stack Web Development Intensive, Fall Lecture Topics. Class Sessions. Grading

CSS: Layout, Floats, and More

HIERARCHICAL ORGANIZATION

Ministry of Higher Education and Scientific Research

HTML version of slides:

CSS: Layout Part 2. clear. CSS for layout and formatting: clear

Web Programming and Design. MPT Senior Cycle Tutor: Tamara Week 2

Introduction to Computer Science Web Development

Introduction to CSS. 2 Sep 13. Derek Peacock. An introduction to defining CSS style rules using tags, classes and ids.

CSS: Cascading Style Sheets

APPLIED COMPUTING 1P01 Fluency with Technology

Fundamentals of Web Technologies. Agenda: CSS Layout (Box Model) CSS Layout: Box Model. All HTML elements can be considered as a box or a container

Lecture : 3. Practical : 2. Course Credit. Tutorial : 0. Total : 5. Course Learning Outcomes

Using CSS for page layout

Transcription:

Advanced CSS Slava Kim

CSS is simple! But is it? You have some boxes on the screen Boxes have text Use CSS to change colors and move boxes slightly away from each other are we done yet?

Web in 1994 Most of you were not born yet I was in my mom s belly HTML was only used to decorate academic papers published online CSS is created to bring more richness to the web Sometimes gifs of dancing babies inserted, too (jk that s in 1996)

Web today

Web today - complicated layouts

Web today - pseudo 3D

Web today - animation https://tympanus.net/development/modalwindoweffects/

Web today - Mobile Responsive Design

Feelz

Today s topics Box model Layouts this one is big Animations Responsive Layouts

Box Model

Box model

Box model https://codepen.io/anon/pen/rpkjpk

Box model border padding margin https://codepen.io/anon/pen/rpkjpk https://developer.mozilla.org/en-us/docs/web/css/css_box_model/introduction_to_the_css_box_model

Box model 250px 284px https://codepen.io/anon/pen/rpkjpk, https://developer.mozilla.org/en-us/docs/web/css/css_box_model/introduction_to_the_css_box_mod

Who will win? 1st grade math 1 CSS boi

box-sizing https://codepen.io/anon/pen/gokmgw

Solution 1: remove padding https://codepen.io/anon/pen/aekjle

Solution 2: use box-sizing: border-box https://developer.mozilla.org/en-us/docs/web/css/box-sizing https://codepen.io/anon/pen/lerwev

Layouts

Layouts basics in CSS http://learnlayout.com/

Layouts basics in CSS http://learnlay out.com/

http://lea rnlayout.c Layouts basics in CSS

Display property

Display property Block - big block that stretches a lot, always has a new line Inline - an element that is part of text, size is always proportional to text Inline-block - stays within text, but can have its own size independent from text None - hidden from the page Flex - flexbox, special stuff Grid - grid, special stuff http://learnlayout.com/display.html

position: fixed Always at the certain place relative to screen Positioned with left, right, top, bottom https://codepen.io/anon/pen/xpzqvz

position: relative Position the element relative to where it would be normally. Positioned with left, right, top, bottom

position: absolute Position the element absolutely relative to another element s position. Finds first ancestor that s positioned non-statically. Positioned with left, right, top, bottom

floats You can mark an element to float to a side Usually is useful for images to be embedded into the text Not great for layouts, tends to break a lot of things, needs a clear, etc http://learnlayout.com/float.html

Common task: center DIV There is a trick that a lot of people use Make left/right margin equal to auto This will center the block element https://codepen.io/anon/pen/jykrwz

Flexbox A fairly new standard that is now available in most browsers Simplifies a lot of layout tasks Delegates a lot of layout computation to the browser as the DOM changes https://css-tricks.com/snippets/css/aguide-to-flexbox/ https://codepen.io/anon/pen/qaxppo

Flexbox You can let boxes grow more, or less, or not even grow at all. The size will be recalculated as the containing div changes its size. https://codepen.io/anon/pen/qaxppo

https://css-tricks.com/snippets/css/a-guide-to-flexbox/

https://philipwalton.github.io/solved-by-flexbox/

Animations in CSS

Libraries for CSS Animations Animate.CSS Cssanimation.io Hover.css etc

Simple Transition https://codepen.io/anon/pen/gybjzw

Simple Transition

Simple Transition Append a new element to DOM Trigger the reflow Add the transition class Without reflow, browser will batch operations together and animation will omitted.

CSS Animation - transition The basic idea: Define the start state Define the end state Define the transitions in between in keyframes Or let the browser automatically decide how to transition https://codepen.io/anon/pen/yyjpzn

CSS Animation - transition

CSS Animation - transition

CSS Animation - transition

CSS Animation - keyframes

More about CSS Animations https://developer.mozilla.org/en-us/docs/web/css/css_transitions/using_css_ transitions https://developer.mozilla.org/en-us/docs/web/css/@keyframes

Responsive Layouts

Media queries Media queries allow you to run certain CSS only if: - The device screen is at least certain size The device supports hovering (with a mouse) The device supports colors Speech input, aspect ratio, etc

Media queries in action https://codepen.io/anon/pen/wpxopy

Responsive layout example https://codepen.io/anon/pen/pebbeb

Responsive layout example On smaller screen sizes turn the columns into sections by changing the Flexbox direction from row to column. You can imagine hiding certain columns, reordering them, separating unimportant content, etc https://codepen.io/anon/pen/pebbeb

Live Example http://jadlimcaco.com/ http://zbt.mit.edu/

Debugger in Chrome Chrome has a special button to simulate different screen sizes, aspect ratios and presets of devices Open devtools Click on the small device icon

Recap

Recap border padding margin

Recap

Recap http://learnlayout.com/

Recap https://codepen.io/anon/pen/gybjzw

Media queries in action https://codepen.io/anon/pen/wpxopy