Author: Pam Van Londen
Site Hosting
Set Up Search Webmaster Tools
Set Up a Hosted Server Account
Website Security
Quote and Blockquote
Single-sentence quotations and multi-sentence quotations can be marked so that machines reading them (search engines) will differentiate the text from other text.
1. Quotes in sentences.
q tag is for single sentence quotes.- Markup for
q
is like this: - Style
q
like this:1
2
3q {display:inline; text-style:italic;}
q:before { content: open-quote;}
q:after {content: close-quote;}
2. Blockquotes below sentences
Blockquotes are for indented multiple-sentence quotations and include a citation.
- Markup
blockquote
like this:1
2
3
4<blockquote cite="http://...">
It is easy to make a dorky web page. It's also easy to make a very nice, clean, professional-looking web page even if you don't have much design experience.
<cite>Robin Williams, author/designer</cite>
</blockquote> - Style
blockquote
so that it stands out from regular text and the quotation marks are obvious. Place the citation below the quoted text, like this:1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35blockquote {
font-size: 150%;
font-style: italic;
width: 50%;
line-height: 1.5;
position: relative;
color: orange;
text-align:left;
padding:0 0 0 3%;
}
blockquote:before {
display: block;
content: "“";
font-size: 600%;
position: absolute;
left: -20px;
top: -30px;
color: black;
}
blockquote:after {
color: black;
content: "”";
display: block;
font-size: 600%;
position: absolute;
right: 0;
bottom: -20px;
}
blockquote cite {
color: black;
font-size: 14px;
display: block;
text-align: right;
margin-top:20px;
} - Style
cite
like this so that you don’t have to type — before the author’s name:1cite:before {content:"— ";}
Scoring Criteria
- Unique fonts and colors are incorporated so the blockquote elements do not match the lesson’s example.
- Position of the quotation marks matches the length of the quotation and author text.
What is JavaScript (JS)?
Purpose
JavaScript (JS) is a client-side scripting language that can be embedded into HTML files. Most modern browsers interpret this language to support object-oriented and procedural programming which controls web pages in the browser, on a web server, and inside mobile applications.
While Hypertext Markup Language (HTML) gives web pages basic structure and marks content, it is the Cascading Style Sheet (CSS) that defines how that page structure and content should look. In addition, scripts like JavaScript and HyperText Preprocessor (PHP) add functions to control windows, data structures, files and folders, media, forms, and microinteractions, etc.
Examples
JavaScript Syntax
Typing JavaScript requires basic syntax, which follow these rules:
- Most scripts are provided in external files but some are embedded in the
head
area, under thefooter
, or inline within HTML elements. - Each embedded script gets a beginning
<script>
and ending</script>
tag. - Function names are written in lowercase letters.
- Semicolons are placed at the end of each function.
- Functions must be nested, not overlapped.
- Some scripts work best in the
head
area of a web page. If that isn’t required by the script then it should be loaded at the bottom of the page to increase rendering speed. - External JavaScripts need a .js file extension.
In this course, you will be adding functions inside HTML elements/tags as well as linking to external JavaScript source files.
View the diagrams below in full screen mode to see the labels for each part of a JavaScript script.
Link to an external file:
<script src=”library.js“></script>
- Begin tag
- Source attribute
- File name or path value in quotations
- End function and statement
Inline function as an attribute and value inside an HTML element:
<a onload=”sound.play()”Play></a>
- Begin tag
- Function name
- Value in quotations
- End function and statement
A function in an external file:
var pets = pet(‘cat’, ‘dog’, ‘pig’);
- Define
- Variable name
- Function & values
- End function
Test
Simple online tools can test the syntax of JavaScripts, but exhaustive user-testing will ensure it works as intended and even more testing agains hacking scripts will ensure it is unhackable by bad actors.
- JavaScript and HTML DOM Reference
- W3 Schools
- JavaScript Validator
- CodeBeautify's JavaScript syntax validator
- jQuery Libraries
- Download the latest versions of jQuery.
- Smooth Scroll JavaScript
- By Robin Leve at Codepen
- Table Sort Javascript
- By Tristan. Includes scripts and styles.
- Table Sorting jQuery Library
- By Christian Bach. Minified version to include in the footer of your HTML file.
- Tether
- Tether is a JavaScript library for efficiently making an absolutely positioned element stay next to another element on the page.
What is HyperText Pre-Processor (PHP)?
Purpose
Hypertext Pre-Processor (PHP) is a server-side scripting language that can be embedded into HTML files. It can be used to display the last date a page was modified, to include snippets of other code, to interact with databases, to send form data, and define and use variables.
While HTML gives web pages basic structure and marks content, it is the Cascading Style Sheet (CSS) that defines how that page structure and content should look. In addition, scripts like JavaScript and HyperText Preprocessor (PHP) add functions to control windows, data structures, files and folders, media, forms, etc.
Examples
PHP Syntax
Typing PHP requires basic syntax, which follow these rules:
- Each script gets a beginning
<?php
and ending?>
tag. - Function names are written in lowercase letters.
- Semicolons are placed at the end of each function.
- Values for attributes are surrounded by single quote marks.
- Functions must be nested, not overlapped.
- Files which use PHP need a .php file extension.
View this page in full screen mode to see the each piece of PHP syntax labeled:
<?php echo ‘Hello world’; ?>
- Begin tag
- Function name
- Value in quotations
- End function and statement
Test
Tools for validating PHP accuracy and security:
- A PHP Code Checker
- Syntax Check for Common PHP Mistakes
- Cross Browser Testing
- Paid subscription for testing OS Browsers
- CSS, HTML, and Feed Validation (Unicorn)
- W3.org's CSS, HTML, and Feed Validation (Unicorn)
- Email Markup Tester
- Google Webmaster Tools
- Favicon checker
- Find out why your favicons aren't rendering
- JavaScript Validator
- CodeBeautify's JavaScript syntax validator
- JS Hint
- A Static Code Analysis Tool for JavaScript
- PageSpeed Insights
- Google's tool to test page load time, with recommendations.
Resources
- A PHP Code Checker
- Syntax Check for Common PHP Mistakes
- PHP 5 Reference
- W3 Schools function reference
- PHP Tips, Resources and Best Practices for 2015
- SitePoint's Bruno Skvorc
- PHP: Hypertext Preprocessor
- Open Source official web site
- PHP: Language Reference
- PHP.net's manual
- PHP7 Resource Recap
- SitePoint's Bruno Skvorc
- Simple Techniques to Lock Down your Website
- Secure PHP scripts by Dustin Blake
PHP
Congratulations - you have completed PHP.
You scored %%SCORE%% out of %%TOTAL%%.
Your performance has been rated as %%RATING%%
Chat with the instructor in Canvas
[quick-chat room=”php” guests_visible=”1″ send_button=”1″]What are Cascading Style Sheets (CSS)?
Purpose
‘
While HTML gives web pages basic structure and marks content, it is the Cascading Style Sheet (CSS) that defines how that page structure and content should look. In addition, scripts like JavaScript and HyperText Preprocessor (PHP) add functions to control windows, data structures, files and folders, media, forms, etc.
Style sheets save web authors a great deal of time. Instead of adding specific styles to each piece of text, they are generally applied globally with a style sheet (.css
file). A style can be defined in a style sheet file and applied automatically in other web pages. Style sheets control the look of text, the layout of the page, how graphics are displayed, and how layers interact with the mouse.
Styles can be applied in three ways:
- Inline: defined inside a tag using the
style
attribute.For this course, we will NOT be using inline styles.
-
Internal (embedded): defined in the
<head>
and applied with a<style>
tag.For this course, we will NOT be using embedded styles.
-
External (linked or imported) : Defined in a separate document with a
.css
file extension and attached in the<head>
section using a<link />
tag.1External files define the look and page layout for an entire website; not just one page or element/tag. They can be named anything you want and you can link to more than one. It is customary to define styles for all known elements/tags, then define your own classes and IDs for additional customization. Typically, the font family, background, text colors, and page layout are defined in the external file.
The<link />
tag references an external style sheet file, notes the relationship, and can optionally note the media type in separate attributes:1
2
3<link rel="stylesheet" href="screen.css" media="screen" />
<link rel="stylesheet" href="print.css" media="print" />
<link rel="stylesheet" href="mobile.css" media="handheld" />For this course, we will be using external stylesheet files and the main file will include media queries to keep the site responsive to device sizes.
The Cascade
Style definitions/declarations are applied using a cascading method. In its simplest terms, the cascade works like this:
Linked external style sheet is overruled by |
Imported external style sheet, which is overruled by |
Embedded/internal document level style sheet, which is overruled by |
Inline style definition. |
Dan Hitchcock of UCLA Extension explains the Cascade effect in CSS. More specific control belongs to the visitor via their browser. The next level of control belongs to the web developer when using !important
with a definition inline, then any inline style, then any embedded style in the <head>
section of a document, then styles at the bottom of a .css
file. Using !important
in the .css
file overrides the same declaration made earlier in the document.
Examples of CSS
CSS Syntax
Note that CSS uses element names, curly braces, colons, and semicolons. In some cases, a space or comma is also needed. View the diagram below in full screen mode to see the labels for each part of a style declaration.
h1 { color:white; font-size:200%; }
- Tag, selector, element
- Property
- Value
- Property
- Value
Testing
The following tools can test the validity of styles to help keep code ‘clean’ and easy to read by machines and humans. The Unicorn validation service by W3.org is the most commonly-used tool, which is required for each lesson in this course.
- A PHP Code Checker
- Syntax Check for Common PHP Mistakes
- Cross Browser Testing
- Paid subscription for testing OS Browsers
- CSS, HTML, and Feed Validation (Unicorn)
- W3.org's CSS, HTML, and Feed Validation (Unicorn)
- Email Markup Tester
- Google Webmaster Tools
- Favicon checker
- Find out why your favicons aren't rendering
- JavaScript Validator
- CodeBeautify's JavaScript syntax validator
- JS Hint
- A Static Code Analysis Tool for JavaScript
- PageSpeed Insights
- Google's tool to test page load time, with recommendations.
Resources
- :nth Tester
- Use :nth selectors to test parent child selections
- Autoprefixer CSS
- Add CSS3 vendor prefixes and remove unnecessary ones
- Can I use…
- Which HTML and CSS3 features work on which versions of which browsers?
- CSS Almanac
- Selectors and Properties comprehensive index
- CSS Custom Properties (CSS Variables) Sample
- Google's implementation occurred in Chrome 49 of 2016
- CSS Grid articles
- CSS-Tricks demonstrates and explains explicit and implicit, galleries, and page layout using grids
- CSS Specificity: Things You Should Know
- Smashing Magazine 2007
- CSS you can get excited about in 2015
- Rachel Andrew of Webdesigner Depot: Calculations, blends, level 4 selectors, grid columns and rows
- CSS, HTML, and Feed Validation (Unicorn)
- W3.org's CSS, HTML, and Feed Validation (Unicorn)
- Normalize.css
- Make browsers render all elements more consistently.
- Pleeease ·
- Node.js application that easily process your CSS. It simplifies the use of preprocessors and combines them with best postprocessors. It helps create clean stylesheets, support older browsers and offers better maintenability. This means no more Compass for prefixes, no more rem mixins, and so on.
- Specifics on CSS Specificity
- CSS-Tricks 2010
- The Future Generation of CSS Selectors: Level 4
- Louis Lazaris, SitePoint, 2015
- Using CSS gradients – CSS | MDN
- Why I'm Excited About Native CSS Variables
- Philip Walton, Dec, 2015
What is CSS?
Congratulations - you have completed What is CSS?.
You scored %%SCORE%% out of %%TOTAL%%.
Your performance has been rated as %%RATING%%
Chat with the instructor in Canvas
[quick-chat room=”css” guests_visible=”1″ send_button=”1″]What is HyperText Markup Language (HTML)
Purpose
Hypertext Markup Language (HTML) is a set of elements/tags applied to text and images in plain text files which tell browsers how to display text, position graphics and form items, and display links to other pages. HTML can be used in conjunction with other languages such as Cascading Style Sheets, JavaScript, PHP, ASP, Ruby, etc. to provide unlimited functionality and interactivity.
HTML5 is the most current version of this standard markup language. Older versions still in use include HTML 4 and XHTML 1.1. These older versions do not take advantage of HTML 5’s:
- Semantic language to improve accessibility (for humans and machines)
- Improved media embedding
- Simpler interactive form functions
- Consistent page layout
Typically, content is kept separate from styles and functions so that updating and upgrading can be seamless. Styles are controlled by Cascading Style Sheets (CSS) and Functions are controlled with JavaScript, AJAX, PHP, and other scripting languages.
Examples of HTML
HTML Syntax
Typing HTML requires basic syntax, which follow these rules:
- Each line of text gets an element/tag at the beginning and end (unless the tag is self-closing).
- Tag names are written in lowercase letters.
- Attributes within tags are written in lowercase letters.
- Values for attributes are surrounded by quotation marks (inch marks).
- Tags within tags must be nested, not overlapped.
View the diagrams below in full screen mode to see the labels for each part of an HTML element.
<h1>First headline</h1>
- Beginning tag, selector, element
- String of text
- Ending tag, selector, element
This element syntax is referred to as “self-closing”:
<img src=”pic.jpg” alt=”text” />
- Beginning tag, selector, element
- attribute
- value
- attribute
- value
- Self-closing tag, selector, element
Testing
The following tools can test the validity of styles to help keep code ‘clean’ and easy to read by machines and humans. The Unicorn validation service by W3.org is the most commonly-used tool, which is required for each lesson in this course.
- A PHP Code Checker
- Syntax Check for Common PHP Mistakes
- Cross Browser Testing
- Paid subscription for testing OS Browsers
- CSS, HTML, and Feed Validation (Unicorn)
- W3.org's CSS, HTML, and Feed Validation (Unicorn)
- Email Markup Tester
- Google Webmaster Tools
- Favicon checker
- Find out why your favicons aren't rendering
- JavaScript Validator
- CodeBeautify's JavaScript syntax validator
- JS Hint
- A Static Code Analysis Tool for JavaScript
- PageSpeed Insights
- Google's tool to test page load time, with recommendations.
Resources
- CSS, HTML, and Feed Validation (Unicorn)
- W3.org's CSS, HTML, and Feed Validation (Unicorn)
- HTML Reference
- W3 Schools: Simple descriptions of elements, attributes, and values.
- HTML Tutorial
- HTML5 from W3 Schools
- W3.org HTML5 Reference
- Official working reference
HTML5
Congratulations - you have completed HTML5.
You scored %%SCORE%% out of %%TOTAL%%.
Your performance has been rated as %%RATING%%