title shown on page tab <meta attribute="value"... /> page metadata (h1 for largest to h6 for smallest) emphasis (italic) strong emphasis (bold)

Similar documents
CSE 154: Web Programming Midterm Exam Cheat Sheet HTML. Tags Used in the <head> Section. Tags Used in the <body> Section

title shown on page tab <meta attribute="value"... /> page metadata (h1 for largest to h6 for smallest) emphasis (italic) strong emphasis (bold)

CSE 154: Web Programming Final Exam Cheat Sheet HTML. Tags Used in the <head> Section. Tags Used in the <body> Section

CSE 154: Web Programming Exam Cheat Sheet HTML. Tags Used in the <head> Section. Tags Used in the <body> Section

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

Appendix D CSS Properties and Values

Adding CSS to your HTML

UNIVERSITI TEKNOLOGI MALAYSIA TEST 1 SEMESTER II 2012/2013

HTML & CSS. SWE 432, Fall 2017 Design and Implementation of Software for the Web

HTML TAG SUMMARY HTML REFERENCE 18 TAG/ATTRIBUTE DESCRIPTION PAGE REFERENCES TAG/ATTRIBUTE DESCRIPTION PAGE REFERENCES MOST TAGS

COSC 2206 Internet Tools. CSS Cascading Style Sheets

Introduction to Multimedia. MMP100 Spring 2016 thiserichagan.com/mmp100

HTML Summary. All of the following are containers. Structure. Italics Bold. Line Break. Horizontal Rule. Non-break (hard) space.

Cascading Style Sheet Quick Reference

As we design and build out our HTML pages, there are some basics that we may follow for each page, site, and application.

Web Engineering CSS. By Assistant Prof Malik M Ali

3.1 Introduction. 3.2 Levels of Style Sheets. - The CSS1 specification was developed in There are three levels of style sheets

- The CSS1 specification was developed in CSS2 was released in CSS2.1 reflects browser implementations


IMY 110 Theme 6 Cascading Style Sheets

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

Zen Garden. CSS Zen Garden

1 of 7 11/12/2009 9:29 AM

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

Programmazione Web a.a. 2017/2018 HTML5

Parashar Technologies HTML Lecture Notes-4

Client-Side Web Technologies. CSS Part II

COPYRIGHTED MATERIAL. Contents. Chapter 1: Creating Structured Documents 1

CMPT 165: More CSS Basics

CS105 Course Reader Appendix A: HTML Reference

BIM222 Internet Programming

CSS Cascading Style Sheets

Cascade Stylesheets (CSS)

Introduction to Web Design CSS Reference

Introduction to Web Design CSS Reference

Cascading Style Sheets

Study Guide 2 - HTML and CSS - Chap. 6,8,10,11,12 Name - Alexia Bernardo

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

INFS 2150 Introduction to Web Development

INFS 2150 Introduction to Web Development

Index. CSS directive, # (octothorpe), intrapage links, 26

1/6/ :28 AM Approved New Course (First Version) CS 50A Course Outline as of Fall 2014

ID1354 Internet Applications

- The CSS1 specification was developed in CSSs provide the means to control and change presentation of HTML documents

CMPT 165 INTRODUCTION TO THE INTERNET AND THE WORLD WIDE WEB

HTML and CSS COURSE SYLLABUS

Networks and Web for Health Informatics (HINF 6220) Tutorial 8 : CSS. 8 Oct 2015

of numbers, converting into strings, of objects creating, sorting, scrolling images using, sorting, elements of object

HTML/XML. HTML Continued Introduction to CSS

CSE 154 LECTURE 3: MORE CSS

CSS: The Basics CISC 282 September 20, 2014

CSS.

The building block of a CSS stylesheet. A rule consists of a selector and a declaration block (one or more declarations).

Chapter 1 Getting Started with HTML 5 1. Chapter 2 Introduction to New Elements in HTML 5 21

Text and Layout. Digital Multimedia, 2nd edition Nigel Chapman & Jenny Chapman Chapter 11. This presentation 2004, MacAvon Media Productions

Introduction to Web Tech and Programming

Index. alt, 38, 57 class, 86, 88, 101, 107 href, 24, 51, 57 id, 86 88, 98 overview, 37. src, 37, 57. backend, WordPress, 146, 148

CSS مفاهیم ساختار و اصول استفاده و به کارگیری

Website Development with HTML5, CSS and Bootstrap

escuela técnica superior de ingeniería informática

Table of Contents. MySource Matrix Content Types Manual

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

Deccansoft Software Services

CSS. Primer. Developer Guide [Part 4]

CASCADING STYLESHEETS

Chapter 4 CSS basics

8a. Cascading Style Sheet

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

Table Basics. The structure of an table

Assignments (4) Assessment as per Schedule (2)

Web Development & Design Foundations with HTML5 & CSS3 Instructor Materials Chapter 2 Test Bank

CSS. Lecture 16 COMPSCI 111/111G SS 2018

Basics of Web Design, 3 rd Edition Instructor Materials Chapter 2 Test Bank

Guidelines for doing the short exercises

CSS: Cascading Style Sheets

EECS1012. Net-centric Introduction to Computing. Lecture 3: CSS for Styling

A HTML document has two sections 1) HEAD section and 2) BODY section A HTML file is saved with.html or.htm extension

Javascript Hierarchy Objects Object Properties Methods Event Handlers. onload onunload onblur onfocus

Cascading Style Sheet

Reading 2.2 Cascading Style Sheets

CSS Lecture 16 COMPSCI 111/111G SS 2018

HTML-5.com itemscopehttp://data-vocabulary.org/breadcrumb<span itemprop="title">html 5</span> itemscopehttp://data-vocabulary.

Creating A Website - Part 1: Web Design principles, HTML & CSS. CSS Color Values. Hexadecimal Colors. RGB Color

CSS: Lists, Tables and the Box Model

3.1 Introduction. 3.2 Levels of Style Sheets. - HTML is primarily concerned with content, rather than style. - There are three levels of style sheets

CSC 121 Computers and Scientific Thinking

CSS CSS how to display to solve a problem External Style Sheets CSS files CSS Syntax

CSS. Text & Font Properties. Copyright DevelopIntelligence LLC

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

COPYRIGHTED MATERIAL. Contents. Introduction. Chapter 1: Structuring Documents for the Web 1

CS 350 COMPUTER/HUMAN INTERACTION. Lecture 6

The [HTML] Element p. 61 The [HEAD] Element p. 62 The [TITLE] Element p. 63 The [BODY] Element p. 66 HTML Elements p. 66 Core Attributes p.

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

Creating and Building Websites

CSS Styles Quick Reference Guide

CSc 337 LECTURE 3: CSS

recall: a Web page is a text document that contains additional formatting information in the HyperText Markup Language (HTML)

INTRODUCTION TO HTML5! HTML5 Page Structure!

HTML5. HTML5 Introduction. Form Input Types. Semantic Elements. Form Attributes. Form Elements. Month Number Range Search Tel Url Time Week

@namespace url( /* set default namespace to HTML */ /* bidi */

Transcription:

CSE 154: Web Programming Midterm Exam Cheat Sheet HTML Tags Used in the head Section Tag <title> text </title> title shown on page tab <meta attribute="value"... /> page metadata <link href="url" type="text/css" rel="stylesheet" /> <script src="url" type="text/javascript"/></script> <! comments > Tags Used in the body Section Tag <p> text </p> <h1> text </h1> <h2> text </h2>... <h6> text </h6> <hr /> <br /> paragraph (h1 for largest to h6 for smallest) horizontal rule (line) line break <a href="url"> text </a> anchor (link) <img src="url" alt="description" /> <em> text </em> <strong> text </strong> <ol> <li> text </li> <li> text </li> <li> </ol> <ul> </li> </ul> <li> nested item </li> <li> nested item </li> image emphasis (italic) strong emphasis (bold) links to a CSS style sheet link to JavaScript code comment (can appear in head or body) ordered (ol) and unordered (ul) list; list item (li) 1

Tags Used in the body Section (Continued) Tag <dl> </dl> <dt> term 1 </dt> <dd> description 1 </dd> <dt> term 2 </dt> <dd> description 2 </dd> <blockquote> <p> text </p>... </blockquote> <q> text </q> <code> text </code> <pre> text </pre> <table> <caption> text </caption> <tr> </tr> <tr> </tr>... </table> <th> heading 1 </th> <th> heading 2 </th> <td> cell 1 </td> <td> cell 2 </td> definition list (dl); term (dt), and its description (dd) block-level quotation inline-level quotation computer code (monospace) pre-formatted text (preserves whitespace) table of data (table) description of table (caption) table row (tr) table heading cell (hr) normal table cell (td) <div>... </div> block-level section of a page <span>... </span> inline-level section of a page Content-Grouping Tags Tag Display <header> Block Container for a header of a document <footer> Block Container for a footer of a document <article> Block A standalone piece of content (e.g., entire blog post including title, author, etc.) <section> Block A piece of content that is part of another (e.g., a chapter section of a reading) <aside> <main> Block Block Defines some content aside from the content it is placed in (e.g., a sidebar in an article) Specifies the main content of a document. The content inside should be unique to the document and not contain content that is repeated across pages (e.g., sidebars, nav links, search bars, etc.) 2

HTML Input Tags Tag <input type="type" name="name"> content </input> <textarea rows="num"> initial text </textarea> <label> text </label> <select> <option> text </option> <option> <optgroup label="text"> <option> text </option> <option> text </option> </optgroup>... </select> <fieldset> <legend> text </legend> content </fieldset> form input tag type can be text, submit, reset, checkbox, radio, file multi-line text input box clickable text label around a form control drop-down selection box (select); each option within the box (option); a labeled group of options (optgroup); a grouped set of form fields HTML Entities Reference Result Entity Name non-breaking space < less than < > greater than > & ampersand & copyright 3

CSS For the following property and value tables, anything emphasized represents values that should be replaced with specific units (e.g., length should be replaced with a px, pt, or em for many properties, and color should be replaced with a valid color value such as a hex or rgb code). A use of refers to separation of possible values (where you cannot provide two of these possible values for one property) and [value value value] refers to a grouping of possible values that can optionally be used together (e.g., [h-shadow v-shadow blur spread color] for box-shadow). Background Styles Property background-attachment background-color background-image background-origin Values scroll fixed color transparent url none border-box padding-box content-box background-position top left top center top right background-size background-repeat background-attachment center left center center center right bottom left bottom center bottom right [x-% y-% ] [x-pos y-pos ] length % auto cover contain repeat repeat-x repeat-y no-repeat scroll fixed Border Styles Note: Replace * with any side of the border (top, right, left, bottom) for the desired effect. Example style: border: 2px solid red applies a solid red border with a width of 2px to all four sides of the element, while border-left: 2px solid red only applies that border to the left border. Property Values border, border-* (shorthand) border-width, border-*-width border-style, border-*-style border-color, border-*-color border-width, border-*-width thin medium thick length border-style, border-*-style none hidden dotted dashed solid double groove rigid inset outset border-color, border-*-color color box-shadow none inset [h-shadow v-shadow blur spread color ] border-radius length 4

Box Model Property float Values left right none height, width auto length % min-height, max-height none length % min-width, max-width margin, margin-* auto length % padding, padding-* length % display none inline block inline-block flex list-item compact table inline-table overflow, overflow-x, overflow-y visible hidden scroll clear Flex Box auto no-display no-content left right both none Property Values Element Type display flex Flex Container Sets all children to become flex-items justify-content flex-end flex-start center space-around space-between flex-direction row row-reverse column column-reverse align-items flex-end flex-start center baseline stretch (default) Flex container Indicates how to position the flex-items when the parent container Flex container Indicates whether the container flows horizontally (row) or vertically (column) Flex container Indicates how to space the items inside the container along the cross axis flex-basis auto (default) length % Both Specifies the default size of an element before the extra space is distributed among the flex-items order number Flex item Specifies the order in which the element appears in the flex container (by default, flex items are laid out in the source order) align-self flex-end flex-start center baseline stretch (default) Flex item Indicates where to place this specific item along the cross axis 5

Font and Text Styles Property Values font-style normal italic oblique inherit font-family fontname font-size length % font-weight normal bold inherit text-align left right center justify text-decoration none [underline overline line-through blink] text-shadow none [color length ] letter-spacing, word-spacing normal length % text-indent length % text-transform none capitalize uppercase lowercase list-style-type none asterisks box check diamond disc hyphen square decimal lower-roman upper-roman lower-alpha upper-alpha lower-greek upper-greek lower-latin upper-latin footnotes list-style-image none url Color Values Value colorname rgb(redvalue, greenvalue, bluevalue) #RRGGBB standard name of color, such as red, blue, purple, etc. Example: red = rgb(255, 0, 0) or red = rgb(100%, 0, 0) Example: red = #FF0000 Selector Types Name Example Universal Any element * { font: 10px Arial; } Element Any element of a given type h1 { text-decoration: underline; } Grouping Multiple elements of different types h1, h2, h3 { color: purple; } Class Elements with the given class name.example { text-decoration: underline; } Id Single element with the given id #example { text-decoration: overline; } Descendant Child Attribute Elements that are children at any level of another specified element Elements that are direct children of another specified element Elements that have the specified attribute #example h1 { text-decoration: underline; } #example > p { font-weight: bold; } input[selected] - inputs that have the selected attribute input[name= test ] - inputs that have a name test 6

JavaScript DOM Methods and Properties Method/Property children parentnode classlist classname appendchild(child) addeventlistener(event, fn) getattribute(attr) innerhtml id removechild(child) queryselector(selector) queryselectorall(selector) getelementsbyclassname(name) getelementbyid(id) getelementsbytagname(tagname) createelement(eltype) createtextnode Returns a collection of an element s child elements Returns the parent node of an element Returns the class name(s) of an element Sets or returns the value of the class attribute of an element Adds a new child node, to an element as the last child node Attaches an event handler to the specified element Returns the specified attribute value attr of an element node Sets or returns the content of an element Sets or returns the value of the id attribute of an element Removes a child node from an element Returns the first child node that matches a specified CSS selector(s) of an element Returns all child nodes that match a specified CSS selector(s) of an element Returns a NodeList containing all elements with the specified class name Returns the element that has the ID attribute with the specified value Returns a NodeList containing all elements with the specified tag name Creates and returns an Element node Creates and returns a Text node Event Object Methods and Properties Method/Property target type offsetx offsety stoppropagation Returns the element that triggered the event Returns the name of the event Returns the horizontal coordinate of the mouse pointer, relative to the DOM element clicked Returns the vertical coordinate of the mouse pointer, relative to the DOM element clicked Prevents further propagation of an event during event flow Event Types click mousemove keydown change dblclick mouseout error focus mouseenter mouseover success submit mouseleave mouseup load select mousedown keyup unload resize 7

JavaScript JSON Methods Function parse(string) stringify(object) Returns the given string of JSON data as the equivalent JavaScript object Returns the given object as a string of JSON data JavaScript Array Methods and Properties Method/Property length push(el) pop() unshift(el) shift() sort() slice(start, end) join() concat(list2,...) tostring() indexof(el) Sets or returns the number of elements in an array Adds new elements to the end of an array and returns the new length Removes and returns the last element of an array Adds new elements to the beginning of an array and returns the new length Removes and returns the first element in an array Sorts the elements of an array Selects a part of an array and returns the new array Joins all elements of an array into a string Joins two or more arrays and returns a copy of the joined arrays Converts an array to a string and returns the result Returns the index of the element in the array, or -1 if not found JavaScript String Methods and Properties Method/Property length charat(index) indexof(string) split(delimiter) substring(start, end) trim() tolowercase() touppercase() concat(str2,...) Returns the length of a string Returns the character at the specified index Returns the position of the first found occurrence of a specified value in a string Splits a string into an array of substrings Extracts the characters from a string between two specified indices Removes whitespace from both ends of a string Returns a lowercase version of a string Returns an uppercase version of a string Joins two or more strings and returns a new joined string JavaScript Timer Functions Method settimeout(fn, ms) setinterval(fn, ms) cleartimeout(id) clearinterval(id) Executes a function after waiting a specified number of milliseconds Repeats a given function at every given time-interval Stops the execution of the function specified by id Stops the execution of the functions specified by id 8

JavaScript Math Functions Method Math.random() Math.abs(n) Math.min(a, b,...) Math.max(a, b,...) Math.round(n) Math.ceil(n) Math.floor(n) Math.pow(n, e) Math.sqrt(n) Returns a double between 0 (inclusive) and 1 (exclusive) Returns the absolute value of n Returns the smallest of 0 or more numbers Returns the largest of 0 or more numbers Returns the value of n rounded to the nearest integer Returns the smallest integer greater than or equal to n Returns the largest integer less than or equal to n Returns the base n to the exponent e power, that is, n e Returns the square root of n (NaN if n is negative) The Module Pattern Whenever writing JavaScript, you should use the module pattern, wrapping the content of the code (window.onload handler and other functions) in an anonymous function. Below is a template for reference: (function() { // any module-globals (limit the use of these when possible) window.onload = function() {... }; // other functions })(); JAvascript Ajax fetch skeleton //you can assume checkstatus is already included function checkstatus(response) { if (response.status >= 200 && response.status < 300) { return response.text(); } else { return Promise.reject(new Error(response.status+": "+response.statustext)); } } function callajax(){ let url =... // put url string here fetch(url) // don't worry about cloud9 credentials.then(checkstatus).then(json.parse) //optional line for processing json.then(function(responsejson) { //success: do something with the responsejson }).catch(function(error) { //error: do something with error }); } 9