3. Getting started with html
- HTML is a
mark-up language
- Anatomy of a HTML element:
3. GETTING STARTED WITH HTML
- HTML is a
mark-up language
- Anatomy of an HTML element:
3. GETTING STARTED WITH HTML
- HTML is a
mark-up language
- Anatomy of an HTML element:
3. GETTING STARTED WITH HTML
- HTML is a
mark-up language
- Anatomy of a HTML element:
3. GETTING STARTED WITH HTML
- HTML is a
mark-up language
- Anatomy of a HTML element:
3. GETTING STARTED WITH HTML
- HTML document:
- Text file
- .html (convention)
- Anatomy of an HTML document (
outer structure):
3. GETTING STARTED WITH HTML
- HTML document:
- Text file
- .html (convention)
- Anatomy of an HTML document (
metadata):
3. GETTING STARTED WITH HTML
- HTML document:
- Text file
- .html (convention)
- Anatomy of an HTML document (
content):
3. GETTING STARTED WITH HTML
3. GETTING STARTED WITH HTML
- HTML entities:
- Allow using reserved characters in texts
- Formatting:
3. GETTING STARTED WITH HTML
- Global attributes:
-
accesskey
:
- Keyboard shortcut to select elements on the page
3. GETTING STARTED WITH HTML
- Global attributes:
-
class :
- Categorize elements
- Multiple classes
- Does nothing per se
3. GETTING STARTED WITH HTML
- Global attributes:
-
contenteditable :
- Let the visitor change the content of the page
- Values: "true" or "false"
- No value: inherits it from parent
3. GETTING STARTED WITH HTML
- Global attributes:
-
contextmenu :
- The menu pops up when the user triggers it
- Supported by Firefox
3. GETTING STARTED WITH HTML
3. GETTING STARTED WITH HTML
- Global attributes:
-
draggable
:
- Specifies if an element is draggable or not
3. GETTING STARTED WITH HTML
- Global attributes:
-
dropzone
:
- Specifies whether the dragged data is copied, moved or linked, when it is dropped on the element
- Not currently supported by any of the major browsers
3. GETTING STARTED WITH HTML
- Global attributes:
-
hidden
:
- The element is not yet, or is no longer, relevant
- The element should not be shown
- Space not reserved
3. GETTING STARTED WITH HTML
- Global attributes:
-
id
:
- Assigns a unique identifier to the element
- Must be unique within the HTML document
- Navigation to the element via
#id
3. GETTING STARTED WITH HTML
- Global attributes:
-
lang
:
- Specifies the language of the element's content
- Must be a valid ISO value
- Let the browser adjust the display of the content
3. GETTING STARTED WITH HTML
- Global attributes:
-
spellcheck
:
- Specifies if the browser should check the spelling of the element's content
3. GETTING STARTED WITH HTML
- Global attributes:
-
style
:
- Allows to define CSS styles directly on an element
3. GETTING STARTED WITH HTML
- Global attributes:
-
tabindex
:
- Order in which the Tab key moves the focus through the elements
3. GETTING STARTED WITH HTML
- Global attributes:
-
title
:
- Provides additional information about an element
- Commonly used to show tool tip information
4. getting started with css
- Cascading Style Sheets (CSS)
- Specifies the appearance and formatting of an HTML document
- No CSS specification but modules
- Browser-specific prefixes:
- Firefox: -moz-
- Internet Explorer: -ms-
- Opera: -o-
- Webkit (Chrome, Safari): -webkit-
4. getting started with css
4. getting started with css
- Applying a style (
style attribute):
4. getting started with css
- Applying a style (
style element):
4. getting started with css
- Applying a style (
external stylesheet):
- Style file loading order is important (the latest will be applied)
4. getting started with css
- Applying a style (
browser styles or
user agent styles):
- Default values applied by the browser
4. getting started with css
- Applying a style (
user styles):
- Proprietary mechanism by browser
- In Firefox:
- In Chrome: file in user's profile:
- \Default\User StyleSheets\Custom.css
- Will be applied to any site the user visits
- Overrides the default browser or user agent styles
4. getting started with css
- Importing style files:
- Not widely known
- Generally, worse performance in browsers than <link>
4. getting started with css
- Character encoding:
- Only information which can come before
@import
- If not specified, the one in the HTML document applies
- If not specified in the HTML document, UTF-8 by default
4. getting started with css
- Styles cascading:
- Inline styles (author styles)
- Embed styles (author styles)
- External styles (author styles)
- User styles
- Browser styles
4. getting started with css
- Adjusting the default styles cascading:
- Prioritize important styles no matter where they have been defined
- Important user styles applied over author styles
4. getting started with css
- Tie breaking:
- More than 1 style defined at the same level that can be applied to the same element
- Specificity breaks the tie break (a-b-c):
- Number of id values (a)
- Number of other attributes and pseudo-classes (b)
- Number of element names and pseudo-elements (c)
- If same specificity, then order of appearance (latest apply)
4. getting started with css
- Style inheritance:
- If no style for a property of an element, the parent element's property style applies
- This rule applies to appearance styles
- This rule does NOT apply to layout styles
- Can be forced with the
inheritvalue
4. getting started with css
4. getting started with css
4. getting started with css
- Lengths:
- number_of_units+unit (no spaces in between)
-
Absolute
:
in,
cm,
mm,
pt(1/72 of an inch),
pc(pica, 12 pt)
-
Relative
:
em(font size of element),
ex('x-height' of element's font),
rem(font size of root element),
px
(96dpi displays, 1/96 of an inch),
%(another concrete property), and others (
gd,
vw,
vh,
vm,
ch) not widely supported
4. getting started with css
- Unit calculations:
- Mixing other units and perform basic arithmetic
4. getting started with css
- Angles:
- Useful when using transforms
-
deg(0 - 360),
grad(0 - 400),
rad(0 - 6.28),
turn(1 = 360deg)
4. getting started with css
- Time:
- Useful for transitions and animations
-
s,
ms
4. getting started with Javascript
- Programming language of the Web
- Case sensitive
- Including scripts in an HTML document (
inline script):
4. getting started with Javascript
- Programming language of the Web
- Case sensitive
- Including scripts in an HTML document (
external script):
4. getting started with Javascript
- Variables and Types:
- Javascript is a loosely typed language:
- Assigning different types to the same variable
4. getting started with Javascript
- Types:
- Primitive types:
Boolean
,
Number
,
Null,
String
,
Undefined
4. getting started with Javascript
- Types:
- Primitive types:
Boolean,
Number,
Null
,
String,
Undefined
4. getting started with Javascript
- Objects:
- Object instantiation (
newkeyword)
- Adding properties
- Deleting properties
4. getting started with Javascript
4. getting started with Javascript
4. getting started with Javascript
4. getting started with Javascript
4. getting started with Javascript
- Numbers:
- Built-in properties and methods (most common)
4. getting started with Javascript
4. getting started with Javascript
4. getting started with Javascript
- Strings:
- Built-in properties and methods (most common)
4. getting started with Javascript
4. getting started with Javascript
4. getting started with Javascript
- Arrays:
- Built-in properties and methods (most common)
4. getting started with Javascript
- Functions:
- Declaration and invocation
4. getting started with Javascript
4. getting started with Javascript
4. getting started with Javascript
4. getting started with Javascript
- Operators (most useful):
- Comparison operators
- Primitives types are compared by value
- Objects are compared by reference
4. getting started with Javascript
- Operators (most useful):
- Concatenation operator (precedence over the arithmetic one)
4. getting started with Javascript
- Operators (most useful):
- Conditional operator (ternary)
4. getting started with Javascript
4. getting started with Javascript
4. getting started with Javascript
4. getting started with Javascript
4. getting started with Javascript
4. getting started with Javascript
5. HTML elements in-depth
- The most important change in HTML5 is a philosophical one:
- Semantics of elements vs. presentation
- Ex.:
<b>no longer states text in bold (backwards compatibility, preferably avoid them using CSS)
"The b element represents a span of text to which attention is being drawn for utilitarian purposes without conveying any extra importance and with no implication of an alternate voice or mood, such as key words in a document abstract, product names in a review, actionable words in interactive text-driven software, or an article lede."
5. HTML elements in-depth
- Some preliminary recommendations:
- Add only the needed markup to give semantic significance to your content
- Avoid using private semantics (use generic elements instead: <div>, <span>) and/or classes
- Be as specific as possible (don't abuse of generic elements)
- It's not all about presentation (programatic access to HTML content, adapted presentation, etc.)
5. HTML elements in-depth
5. HTML elements in-depth
- Document and metadata elements:
- Create the superstructure of the HTML document
- Provide information to the browser
5. HTML elements in-depth
5. HTML elements in-depth
5. HTML elements in-depth
5. HTML elements in-depth
5. HTML elements in-depth
5. HTML elements in-depth
5. HTML elements in-depth
5. HTML elements in-depth
5. HTML elements in-depth
5. HTML elements in-depth
5. HTML elements in-depth
5. HTML elements in-depth
5. HTML elements in-depth
5. HTML elements in-depth
5. HTML elements in-depth
5. HTML elements in-depth
5. HTML elements in-depth
5. HTML elements in-depth
5. HTML elements in-depth
5. HTML elements in-depth
5. HTML elements in-depth
5. HTML elements in-depth
- Text-level elements:
- Input and output elements
5. HTML elements in-depth
- Text-level elements:
- Abbreviations, citations, definitions and quotations
5. HTML elements in-depth
5. HTML elements in-depth
5. HTML elements in-depth
5. HTML elements in-depth
5. HTML elements in-depth
5. HTML elements in-depth
5. HTML elements in-depth
5. HTML elements in-depth
5. HTML elements in-depth
- Embedding content using plugins:
5. HTML elements in-depth
- Embedding content using plugins:
5. HTML elements in-depth
5. HTML elements in-depth
5. HTML elements in-depth
- Embedding numeric representations:
5. CSS styling in-depth
-
Media queries:
- Limits the style sheets' scope by using media features, such as width, height, and color
- Separated by commas
- Composed of:
- Logical operators
- Media types
- Media expressions: feature and value
6. JAVASCRIPT IN DEPTH
- Javascript is much more than ECMA-262 (not tied to browsers)
- Extensions:
6. Javascript in-depth
- document metadata properties:
6. Javascript in-depth
- document location properties:
6. Javascript in-depth
- Accessing HTML elements via document's properties:
6. Javascript in-depth
- Searching for HTML elements:
6. Javascript in-depth
- Getting information about the window:
6. Javascript in-depth
- Interacting with the window:
6. Javascript in-depth
- Cross-document messaging (sender):
6. Javascript in-depth
- Cross-document messaging (listener):
6. Javascript in-depth
- Working with DOM elements:
6. Javascript in-depth
- Working with DOM elements:
6. Javascript in-depth
- Working with DOM elements:
- Element attribute properties:
6. Javascript in-depth
- Working with Text elements:
6. Javascript in-depth
- Modifying the model:
- Basic functions and properties:
6. Javascript in-depth
- Styling DOM elements:
- Working with stylesheets:
6. Javascript in-depth
- Working with events:
- An event is a change in the state of something
- Element event flow:
- Capture:
- Checks if elements between the <body> and the target have event listeners which asked to be notified of events of their descendants. Disabled by default
- Target:
- Checks the target added events listeners
- Bubbling:
- Checks the ascendants added events listeners
6. Javascript in-depth
- Working with events:
- Using the DOM and the Event object:
6. Javascript in-depth
- Working with events:
- Document and Window events:
6. Javascript in-depth
- Using element specific objects:
- base element (HTMLBaseElement):
6. Javascript in-depth
- Using element specific objects:
- body element (HTMLBodyElement):
6. Javascript in-depth
- Using element specific objects:
- link element (HTMLLinkElement):
6. Javascript in-depth
- Using element specific objects:
- meta element (HTMLMetaElement):