Node Manual

User Manual:

Open the PDF directly: View PDF PDF.
Page Count: 44

DownloadNode Manual
Open PDF In BrowserView PDF
Web Technologies Manual (Frontend)
Dan Austin K. Higwit
dan@qwento.com
November 25, 2018

Contents
1 Basic Structure

2

1.1

HTML elements, tags, atttributes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

2

1.2

HTML document template

3

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

2 CSS Terms

3

2.1

Selectors . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

3

2.2

Properties . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

3

2.3

Values . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

4

2.4

Selectors . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

4

2.5

Referencing CSS

4

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

3 HTML in depth

4

3.1

Semantic Elements . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

4

3.2

HTML5 Structure

5

3.3

Relative and Absolute Paths

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

4 CSS in depth

7

7

4.1

The Cascade

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

7

4.2

Calculating Specicity . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

8

4.3

Combining Selectors

4.4

Layering Styles with Multiple Classes

4.5

Common CSS property values . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

8

4.6

HSL HSLa Colors

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

9

4.7

Lengths

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

9

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

5 Box Model

8
8

10

5.1

What is a box? . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

10

5.2

Margin Padding Declarations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

11

5.3

Borders

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

11

5.4

Box Sizing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

11

6 Positioning

12

6.1

Floats

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

6.2

Float Clearx . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

12

6.3

Inline-block

13

6.4

Relative Positioning

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

14

6.5

Absolute Positioning . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

15

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

7 Working With Typography

12

16

7.1

Typeface vs Font . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

16

7.2

Font Properties . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

16

7.3

Line Height . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

16

7.4

Use Web Safe Fonts

17

7.5

Embedding Web Fonts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

17

7.6

Including Citations Quotes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

17

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

8 Backgrounds Gradients

17

8.1

Gradient Backgrounds . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

18

8.2

Using Multiple Background Images . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

19

8.3

New Background Properties . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

19

9 Lists

20

9.1

Unordered Lists . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

9.2

Ordered Lists . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

20

9.3

Description Lists

21

9.4

Nesting Lists

9.5

List Item Styling

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

9.6

List Type Values

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

23

9.7

Image Marker . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

23

9.8

Shorthand List Style Property . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

24

9.9

Horizontal List

24

9.10 Floating List

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

20

21
22

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

24

9.11 Navigational List Example . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

24

9.12 Nav Element

25

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

10 Adding Media

26

10.1 Images . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

26

10.2 Audio

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

26

10.3 Video

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

27

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

27

10.5 Figure . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

27

10.4 Iframes

11 Building Forms

27

11.1 Initializing a Form

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

28

11.2 Text Fields Textareas . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

28

11.3 Text Area . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

29

11.4 Form Buttons . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

30

11.5 Other Inputs

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

30

11.6 Hidden Input

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

30

11.7 File Input . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

31

11.8 Form Elements

31

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

12 Tables
12.1 Creating a Table

34
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

34

12.2 Table Structure . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

36

Abstract
This is a compilation of notes and code snippets for html, css, sass and other related web technologies. html css sass Manual.

1

Basic Structure

HTML, HyperText Markup Language, gives content structure and meaning by dening that content as, for example, headings,
paragraphs, or images. CSS, or Cascading Style Sheets, is a presentation language created to style the appearance of contentusing,
for example, fonts or colors.

1.1 HTML elements, tags, atttributes
The parts of an html consists of the following parts:

1.2 HTML document template
All HTML documents have a required structure that includes the following declaration and elements: , ,
, and .
Subsequent paragraphs, however, are indented.

1
2
3
4
5
6
7
8
9
10
11


< html lang =" en ">
< head >
< meta charset =" utf -8 ">
< title > Hello World < / title >

< body >

Hello World

This is a web page.

Self-Closing Elements Some elements simply receive their content or behavior from attributes within a single tag. The element is one of these elements. The content of the previous element is assigned with the use of the charset attribute and value. Other common selfclosing elements include 1 2 2 < br >, < img >, < meta >, < wbr >, < embed >, < input >, < param > < hr >, < link >, < source > CSS Terms In addition to HTML terms, there are a few common CSS terms you will want to familiarize yourself with. These terms include selectors, properties, and values. As with the HTML terminology, the more you work with CSS, the more these terms will become second nature. 2.1 Selectors A selector designates exactly which element or elements within our HTML to target and apply styles (such as color, size, and position) to. Selectors generally target an attribute value, such as an id or class value, or target the type of element, such as

or

. 1 p { ... } 2.2 Properties So far we've selected an element with a selector and determined what style we'd like to apply with a property. Now we can determine the behavior of that property with a value. Values can be identied as the text between the colon, :, and semicolon, ;. Here we are selecting all

elements and setting the value of the color property to be orange and the value of the font-size property to be 16 pixels. p { color : ...; 3 font - size : ...; 4 } 1 2 2.3 Values Values can be identied as the text between the colon, :, and semicolon, ;. Here we are selecting all

elements and setting the value of the color property to be orange and the value of the font-size property to be 16 pixels. p { color : orange ; 3 font - size : 1 6 px ; 4 } 1 2 2.4 Selectors Values can be identied as the text between the colon, :, and semicolon, ;. Here we are selecting all

elements and setting the value of the color property to be orange and the value of the font-size property to be 16 pixels. Type Selectors target elements by their element type. For example, should we wish to target all division elements,

, we would use a type selector of div. 1 2 div { ... } < div >...< / div > Class Selectors allow us to select an element based on the element's class attribute value. .awesome { ... } < div class =" awesome ">...< / div > 3

...< /p> 1 2 ID Selectors 1 2 are even more precise than class selectors, as they target only one unique element at a time. # shayhowe { ... } < div id = " shayhowe ">...< / div > 2.5 Referencing CSS < head > < link rel =" stylesheet " href = " main.css "> 3 1 2 3 HTML in depth 3.1 Semantic Elements Semantic code describes the value of content on a page, regardless of the style or appearance of that content. There are several benets to using semantic elements, including enabling computers, screen readers, search engines, and other devices to adequately read and understand the content on a web page. Identifying Divisions Spans Divisions, or

s, and s are HTML elements that act as containers solely for styling purposes. As generic containers, they do not come with any overarching meaning or semantic value. Paragraphs are semantic in that content wrapped within a

element is known and understood as a paragraph.

s and s do not hold any such meaning and are simply containers. Block vs. Inline Elements Most elements are either block- or inline-level elements. What's the dierence? Block-level elements begin on a new line, stacking one on top of the other, and occupy any available width. Block-level elements may be nested inside one another and may wrap inline-level elements. We'll most commonly see block-level elements used for larger pieces of content, such as paragraphs. Inline-level elements do not begin on a new line. They fall into the normal ow of a document, lining up one after the other, and only maintain the width of their content. Inline-level elements may be nested inside one another; however, they cannot wrap block-level elements. We'll usually see inline-level elements with smaller pieces of content, such as a few words. Divs and Spans 1 2 < div > ... < / div > // are default block elements < span > ... // are default inline elements Headings 1 2 3 4 5 6 divs act as block elements spans act inline Headings are block-level elements, and they come in six dierent rankings,

through

.

Heading

Heading

Heading

Heading

Heading
Heading Paragraphs Level Level Level Level Level Level 1
2

3 4 5 6 Paragraphs are dened using the

block-level element. 1

Steve Jobs was a co - founder and longtime chief executive officer at Apple. On June 12 , 200 5, Steve gave the commencement address at Stanford University.

3

In his address Steve urged graduates to follow their dreams and , despite any setbacks , to never give up ndash ; advice which he sincerely took to heart.

Bold, Strong 1 2 4 5 Here are the two HTML options for creating bold text in action:

< strong > Caution :< / strong > Falling rocks.

This recipe calls for bacon .

Italics, Emphasis 1 2 4 5 Here are the two HTML options for creating bold text in action:

I < em > love Chicago !

The name Shay means a gift.

3.2 HTML5 Structure For the longest time the structure of a web page was built using divisions. The problem was that divisions provide no semantic value, and it was fairly dicult to determine the intention of these divisions. Fortunately HTML5 introduced new structurally based elements, including the
,