DOM, HTML, CSS UI Development Basics Confidential.

Slides:



Advertisements
Similar presentations
JavaScript Chapter 6 Note new scoring. spin.js (page 67) function spin() function spin() { var obj_style = document.getElementById("d1").style; var obj_style.
Advertisements

Web Pages Week 10 This week: CSS Next week: CSS – Part 2.
Layout using CSS. Using multiple classes In the head:.important{font-style:italic;}.title{color:red;} In the body: Here's a type of paragraph that is.
CSS Chained classes Julien BRAURE –
Chapter 7 Page Layout Basics Key Concepts Copyright © 2013 Terry Ann Morris, Ed.D 1.
Very quick intro HTML and CSS. Sample html A Web Title.
Pemrograman Teknologi Internet W09: DOM & DHTML. 2 Objectives DOM: DOM: DOM Nodes & Trees DOM Nodes & Trees Traversing & Modifying DOM Trees Traversing.
Session 4: CSS Positioning Fall 2006 LIS Web Team.
Advance CSS (Menu and Layout) Miftahul Huda. CSS Navigation MENU It's truly remarkable what can be achieved through CSS, especially with navigation menus.
Cascade Style Sheet Demo. Cascading Style Sheets Cascading Style Sheets (CSS) is a simple mechanism for adding style (e.g., fonts, colors, spacing) to.
Unit 20 - Client Side Customisation of Web Pages
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.
Using Cascading Style Sheets CSS Basics. Goals Understand basic syntax of Cascading Style Sheets (CSS) Understand basic syntax of Cascading Style Sheets.
4.01 Cascading Style Sheets
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.
ITP 104.  While you can do things like this:  Better to use styles instead:
Principles of Web Design 6 th Edition Chapter 10 – Data Tables.
Technologies for web publishing Ing. Václav Freylich Lecture 7.
 This presentation introduces the following: › 3 types of CSS › CSS syntax › CSS comments › CSS and color › The box model.
Embedded Software SKKU 28 1 WebKit/EFL. Embedded Software SKKU 28 2 WebKit Parsing Layout and Painting WebKit and EFL Contents.
CSS Table Properties.
Lecture 2 - HTML and CSS Review SFDV3011 – Advanced Web Development 1.
Page Layout Styles Exploring Computer Science – Lesson 3-8 Part or all of this lesson was adapted from the University of Washington’s “Web Design & Development.
WRA HTML & CSS – BUILDING WEBPAGES. TODAY’S AGENDA Review: external stylesheets Review: transforming a list Intro: the object Intro: the.
DOM Animation Changing the DOM objects over time.
CSS1 Dynamic HTML Objects, Collections & Events. CSS2 Introduction Dynamic HTML treats HTML elements as objects. Element’s parameters can be treated as.
Internet Technology Dr Jing LU Updated Dr Violet Snell / Dr Kalin Penev 1 Internet Technology (week 6)  Recap: Validating HTML  Page Layout.
CSS Layout Cascading Style Sheets. Lesson Overview  In this lesson, you will learn:  CSS Box Model  CSS properties for border  CSS properties for.
11/12/2015 Box Model Reed Crouch. 11/12/2015  HTML elements can be considered as boxes. In CSS, the term "box model" is used when referring to layout.
Copyright © Osmosys O S M O S Y SO S M O S Y S D e p l o y i n g E x p e r i e n c e & E x p e r t i s e™ CSS Training.
Lecture 2: Cascading Style Sheets (CSS) Instructor: Dr. M. Anwar Hossain.
CSS Positioning & Layout Creating layouts and controlling elements.
CONTROLLING Page layout
5 th ed: Chapter 4 4 th ed: Chapter 5 SY306 Web and Databases for Cyber Operations SlideSet #5: Advanced CSS.
HTML and Dreamweaver November 11th. Agenda Box Model Displaying and positioning elements – Padding – Margin – Float – Display – Position HTML Demo.
Today’s objectives  Announcements  Positioning  Measurement units.
Week 5.  Normal document flow  Affecting document flow with float and position properties using CSS  Using these properties to create layouts.
ACT102 INTRODUCTION TO WEB DESIGN. Content Padding Border Margin.
How to choose a template/background for a brochure using Microsoft publisher Uses: to make the brochure more catching and interesting.
Laying out Elements with CSS
The Box Model in CSS Web Design – Sec 4-8
Cascading Style Sheets Boxes
CSS Layouts CH 13.
4.01 Cascading Style Sheets
The Box Model in CSS Web Design – Sec 4-8
CSS Layouts: Grouping Elements
Webpage layout using CSS
Putting Things Where We Want Them
The Box Model in CSS Web Design – Sec 4-8
Table CSS Create a new CSS called tablestyle.CSS Green Background
Styles and the Box Model
CSS Borders and Margins.
Positioning.
HTML5 Level I Session III
HTML5 Level I Session III
Cascading Style Sheets
>> Dynamic CSS Selectors
The Internet 10/6/11 Cascading Style Sheets
<p>Sample <b>bold</b> display</p>
<p> Sample <b>bold</b> display</p>
Usually use background-color:
Principles of Web Design 5th Edition
Positioning.
Session 4: CSS Positioning
<p> Sample <b>bold</b> display</p>
4.01 Cascading Style Sheets
CSc 337 Lecture 5: Grid layout.
ITI 133: HTML5 Desktop and Mobile Level I
<p>Sample <b>bold</b> display</p>
Presentation transcript:

DOM, HTML, CSS UI Development Basics Confidential

Intro Confidential 2

–How it works (render process) –How to choose layout architecture –Performance optimization Expectation Confidential 3

Agenda Confidential 4 HTML Source/DOM tree/DOM Render Repaints and reflows Layout architecture Q & A

The rendering process HTML Source/DOM tree/DOM Render Confidential 5

HTML source The DOM tree The render tree HTML Source/DOM tree/DOM Render Confidential 6

Parts of the render tree (or the whole tree) will need to be revalidated and the node dimensions recalculated. This is called a reflow, or relayout, or relayouting. Note that there's at least one reflow - the initial layout of the page. Parts of the screen will need to be updated, either because of changes in geometric properties of a node or because of stylistic change, such as changing the background color. This screen update is called a repaint, or a redraw. Repaints and reflows Confidential 7

Task (repaint or reflow ?) Repaints and reflows Confidential 8 var bstyle = document.body.style; bstyle.padding = "20px"; bstyle.border = "10px solid red"; bstyle.color = "blue"; bstyle.backgroundColor = "#fad"; bstyle.fontSize = "2em"; document.body.appendChild(document.createTextNode('dude!')); Var left = el.offsetLeft;

Reflow ( offsetTop, offsetLeft, offsetWidth, offsetHeight scrollTop/Left/Width/Height clientTop/Left/Width/Height Repaints and reflows Confidential 9 // no-no! for(big; loop; here) { el.style.left = el.offsetLeft "px"; el.style.top = el.offsetTop "px"; } // better var left = el.offsetLeft, top = el.offsetTop, esty = el.style; for(big; loop; here) { left += 10; top += 10; esty.left = left + "px"; esty.top = top + "px"; } // bad var left = 10, top = 10; el.style.left = left + "px"; el.style.top = top + "px"; // better el.className += " theclassname"; // or when top and left are calculated dynamically... // better el.style.cssText += "; left: " + left + "px; top: " + top + "px;";

Layout architecture Confidential 10

-Why Table Layout is a bad practice? -Why “Float” Layout is a bad practice? -Absolute, “Percentage”, Flex, Inline-Block how to choose The Best. Layout architecture Confidential 11

Confidential 12 The End Thank you for your attention!