Category Archives: Classes

Week 3 – HTML Structure – Intro to CSS

Creating an internal Link on your Webpage:

internal link

HTML: INSERTING IMAGES

IMAGE FILE FORMATS: Review

There are three primary image file formats used for graphics viewed on the web. Each of these file types were designed for the purpose of compressing memory usage. Each file type does this a different way. NOTE: .PSD, .AI and .INDD files will NOT show up on your website.

Jpeg 

Jpegs work well on photographs, naturalistic artwork, and similar material; not so well on lettering, simple cartoons, or line drawings. JPEG is “lossy,” meaning that the decompressed image isn’t quite the same as the one you started with. (There are lossless image compression algorithms, but JPEG achieves much greater compression than is possible with lossless methods.) JPEG is designed to exploit known limitations of the human eye, notably the fact that small color changes are perceived less accurately than small changes in brightness.

Gif
Graphics Interchange Format. A format used for displaying bitmap images on World Wide Web pages, usually called a “gif” because .gif is the filename extension. These files use “lossless” compression and can have up to 256 colors.

Png-8 and Png-24
PNG is a compression scheme that has two main benefits: it is a lossless compression image format and it holds alpha channel information. Originally, the Portable Network Graphics (PNG) format was designed as a royalty-free format, which would replace GIF and JPEG. Png-24 allows for smooth blending between alpha and opaque.

Image Size
When speaking about image size on the web, there are three possible interpretations of this that you must take into account.

File Size refers to the amount of disk space an image occupies (in KB or MB)
Image Dimensions refers to the physical size of the image, expressed in height and width.
Resolution refers the pixel density of an image. This is expressed in pixels per inch (ppi). Images are displayed on the web at 72 dpi. Printed images are generally of higher resolution.

Resize your images in Photoshop PRIOR to uploading them on the web.

Compression

Compression shrinks down the file size of the photo so that it loads on the user’s computer quickly, but maintains a certain level of quality.


Saving Images Out of Photoshop or Illustrator  
Both Photoshop and Illustrator have excellent options for optimizing images for the Web, via the “Save for Web” menu. It is better to use this option rather than “Save As” or “Export” options, as you will have more control over the output settings and the final file size will be smaller because no preview image is saved with the file.

Save and Export

There are two ways of saving a photo in Photoshop. The first is to use the Save As… dialogue, the other is called Save for Web & Devices… which is used to save your photos in preparation for publication to the Web.

1) Save as: FIRST, save the file type as a Photoshop or .PSD file. This will save extra Photoshop-specific information about your photo and allows you to go back to the file at a later date and manipulate all layers. You will not lose any quality when you re-save it multiple times. THEN, save as a .jpg, .png or .gif which compresses the photo allowing you to use it on the web.

2) Save for Web: Use this when you are ready to export your photo for publication to the Web.  The Save for Web allows you to see how your photo will appear once it’s published to a Web site. Optimized will show you how your photo will appear once it’s published on a Web site, and 2-up/4-up will show you comparisons so you can see how the different levels of compression will affect your photo when saving. These are automated ways to save your image for the Web.

***Here’s a great reference for “save for web”.

 


 3 Ways you can Retrieve Images to Place onto your Website

Use a third party image hosting site like Flickr.

Flickr:

Upload your image to your Flickr account and copy the image URL. To get the direct URL of an image on Flickr do the following:

Upload your own image or search and find an image already on Flickr. One you’ve got the image you want to use, right click on the image and then click on “view all sizes”. Choose your size and click on it. You’ll see the image with various image sizes listed above it. Choose your size and click on it. Right click on the image and choose “copy image URL”. NOTE: you need the direct url to image with a files extension of .jpg, .gif or .png.

 <img src=”http://farm5.staticflickr.com/4081/4883281674_8428f07e53_z.jpg”>

Use a direct URL to a website.

Find your image anywhere on the web. Click on the image and then click on “full-size image”. Copy the URL and place the full URL into your HTML file.

 <img src=”http://discovermagazine.com/2012/jul-aug/06-what-is-your-dog-thinking/dog1.jpg”>

Upload your own image via FTP to your own web hosting space.

Log into your web hosting space via FTP and upload your images. It’s good practice to place them inside a folder called: images.

 <img src=”images/dog.jpg”>

Here’s a great resource for finding images released under Creative Commons.


ADDING IMAGES TO YOUR PAGES

Image tag
Images are displayed on the web using the image tag:

<img>

This is the basic syntax for using the image tag:

<img src=”dog.jpg”>

You MUST upload the image to your ftp site for the web browser to find it. Use JPGs for photographs, and GIFs or PNGs for line art or most screenshots.

Create a subfolder on you FTP site called “images.” Whatever images you want to show on your web pages, upload them to this “images” folder.

The “alt” attribute is used for the text that will display if an image does not load in the browser, and in some browsers is visible when you hover over the image with the mouse:

<img src=”images/dog.jpg” alt=”Spot the Beagle” />

The image tag also allows you to input a numeric value for the height and width of an image. It is a good idea to specify the height and width, as this allows the browser to render the page faster.

<img src=”images/dog.jpg” alt=”Spot the Beagle” height=”400px” width=”200px”>

You can try it out on W3Schools.


Pulling an Image from the Web

If you’re pulling in an image from the web, view its properties to grab the absolute URL. If you are pulling in an image from a folder on your a server, call to it correctly:

Examples:

  • <img src="http://www.url.com/nameofimage.jpg" alt="Name of Image">This image is located somewhere else on the web.
  • <img src="images/dog.jpg" alt="Spot the Beagle">This image is located within a folder called images on my server.

Images as Links

You can use an image to link to another document by simply wrapping an image tag in a link tag:
<a href="filename.html”><img src=”image/dog.jpg“ alt="Spot the Beagle"></a>

You can see an example on W3Schools here.


Background Images

You can set an image as a background in any page element. The properties of background images are detailed here:

****Here’s a great link several sites that generate backgrounds for you. You can create gradients, stripes, tartans, tiles and patterns.

Putting it All Together: Images and CSS

<!DOCTYPE html>
<html>
<head>
<title>HTML Images Tutorial</title>
<link rel=”stylesheet” type=”text/css” href=”style.css”>
</head>
<body>

<h1>
HTML Images Tutorial
</h1>

<h3>
There are three way to place <i>images</i> onto your HTML page.
</h3>

<ol>
<li>Use a third party web hosting space.</li>
<li>Link to an image already on the web.</li>
<li>Upload an image to your web hosting space using FTP.</li>
</ol>

<p>
Use a direct link to pull this image from <b>Flickr</b>or another image hosting site.
</p>

<div align=”left”>
<img src=”http://farm5.staticflickr.com/4081/4883281674_8428f07e53_z.jpg”>
</div>

<p>
Upload an image to your site by <b>linking</b> to an image anywhere on the web.
</p>

<div align=”left”><img src=”http://discovermagazine.com/2012/jul-aug/06-what-is-your-dog-thinking/dog1.jpg”>
</div>

<p>Or, you can <b>upload</b> an image to your web hosting space using<strong>FTP.</strong>
<div align=”left”>
<img src=”images/dog.jpeg”>
</div>
</p>

<p>
You can even use an image as a link to a <b>URL</b> anywhere on the web.
</p>

<p>Create a link of an image:
<a href=”http://www.blogcdn.com/www.urlesque.com/media/2008/11/23-pooch11.jpg”>
<img src=”images/Blinky_Dog.gif” alt=”dog gif”></a>
</p>

</body>
</html>
If you use the HTML above, you can see what the site looks like in the screenshot below.

You can see the FULL HTML page here. The HTML was upload to web space using FTP.


Image Spacing and Alignment

Let’s see how it looks when you add text. Type in “This is one crazy dog!” directly after the close of the img tag. The text will bump up against the edge of the image and wraps around the bottom of the image (depending on how much text you’ve written). To make the text wrap correctly, add an “align” attribute to the image. It’s your choice whether you want to align it to the right or left by using align=”left/right”.

In the image below I’ve added the attribute align=”left” – see the full code here: <img src=”images/dog.jpeg” align=”left” />


A Simple Thumbnail Gallery

This method creates a flexible grid of thumbnail images and captions that dynamically fills rows based on the browser width. This is what it looks like in action:

Each thumbnail and caption is part of an unordered list (ul) with the id “thumbnails”. The list items (li) are set to display:inline and float:left and have background, margin and padding set to create the white boxes around them.


Rounded Corners

It seems like the trend nowadays are images that have rounded corners. If you don’t want to manually do it in photoshop or illustrator, use this online service called RoundPic.

View the links below to learn more about rounded corners and background images.


More CSS Image Techniques

Thinking through your images:

Foreground vs. Background Images. The best way to think about this is as a picture and a frame. Background images are the frame, foreground images are the picture. Background images should be restricted to interface elements, foreground images to content.

Live Text vs. Graphic Text. In order to keep your pages as semantic and machine readable as possible, not to mention keeping download time to a minimum, it is important to use as much “live” text as possible. However, there are times when you don’t want to be limited to the web safe fonts. Today we’re going to explore a few ways that you can get the best of both worlds.

You can see a great example of image rollover on the Apple website.

See a great example of image replacement rollover.

<div id=”nav”>
<ul id="navlinks">
   <li id="home"><a href="#">Home</a></li>
   <li id="navprojects"><a href="#">Projects</a></li>
   <li id="navclients"><a href="#">Clients</a></li>
   <li id="navevents"><a href="#">Events</a></li>
   <li id="navabout"><a href="#">About</a></li>
   <li id="navcontact"><a href="#">Contact</a></li>
 </ul>
</div>
  • Image replacement CSS The key to this technique is to use a single image, containing all the navigation menu items and all of their states.

Then, set up a unordered list of links in your html page. This is a nice semantic way to represent navigation:

Make sure that you give the ul and each li unique ids.

Then, in your CSS, you can use link states (a, a:hover, a:active, a:visited) and background position to reveal the appropriate section of the background image.

CSS Positioning. A great resource to check out.

There are three techniques displayed in this example:

  • Image with background color rollover
  • Head tag replacement
  • Single Image Navigation Rollover

 Embedding Multimedia

Playing Quicktime and Flash Movies
The QuickTime format is developed by Apple. Videos stored in the QuickTime format have the extension .mov.

QuickTime is a common format on the Internet, but QuickTime movies cannot be played on a Windows computer without an extra (free) component installed.

With the object element, code that will play a QuickTime movie can easily be added to a web page. The object can be set to automatically install a QuickTime player if it is not already installed on the users computer.

This is the code required to play a QuickTime movie:

quicktime html code

You can also display a flash animation as an object:

If you use a third-party service like YoutubeVimeoGoogle, or blip.tv, you can just copy their embed code and paste it into your .html file.

YouTube

Youtube (Third-Party Video Service)

embed_code

EMBEDDING AUDIO:
There are several different types of music formats that are used…so which one do we use for the web?

The WAVE format is one of the most popular sound format on the Internet, and it is supported by all popular browsers. If you want recorded sound (music or speech) to be available to all your visitors, you should use the WAVE format.

The MP3 format is the new and upcoming format for recorded music. If your website is about recorded music, the MP3 format is the choice of the future.

ADDING INLINE SOUND
When sound is included in a web page, or as part of a web page, it is called inline sound.

If you plan to use inline sounds in your web applications, be aware that many people find inline sound annoying. Also note that some users might have turned off the inline sound option in their browser.

Our best advice is to include inline sound only in web pages where the user expects to hear the sound. An example of this is a page which opens after the user has clicked on a link to hear a recording.

So if you insist…you just need to use the tag.

<embed src="beatles.mid" />

HYPERLINKING SOUND
If a web page includes a hyperlink to a media file, most browsers will use a “helper application” to play the file.

The following code fragment displays a link to a music file. If a user clicks on the link, the browser will launch a helper application and play the music file.

<a href="nameofyoursong.wav">Play this tune</a>

Play this tune


WHAT IS CSS?

Introduction to CSS

CSS adds styles to your web pages: it’s the skin over the bones of HTML. This tutorial will teach you how to style our webpages.

  • Cascading Style Sheets (CSS) are a standard developed to allow designers control over presentational elements of a Web page and effectively separate content from presentation.
  • A style is a group of attributes that are called by a single name.
  • A style sheet is a group of styles.
  • The cascade part of CSS means that more than one stylesheet can be attached to a document, and all of them can influence the presentation. It also means that different applications of CSS can be applied to a page in order of precedence: inline, embedded, external and default.


CODE ACADEMY LESSON IV

1. What’s CSS?

The basics: what CSS is, how it works, and why we separate form from function.

CSS SYNTAX

csssyntax

The CSS syntax is a little different from the tag and attribute format of HTML. A CSS style is made up of a selector, which is the HTML element or class name you wish to define rules for, and a set of properties and values. A property and its value are separated by a colon (:). You can define multiple properties for a style, separating them with a semi-colon(;). Property/value sets are enclosed in brackets{}.

For example, if you wanted to redefine all HTML in your <p> tags to look like this, then your style would look like this:

p {
color: #00CC00;
font-size: 13px;
font-family: "Courier New", Courier, monospace;
font-weight: bold; text-decoration:none;
}

The order of properties doesn’t matter, as long as you separate them with a semi-colon. Property values that have multiple words are surrounded by double quotes: “Courier New”.

You can apply the same style to multiple selectors by grouping them:

h1, h2, h3, h4 {

color: #00CC00
}

There is a full CSS reference and extensive code examples at:

W3 Schools CSS Tutorial

also at: http://www.barelyfitz.com/screencast/html-training/css/positioning/

CODE ACADEMY LESSON IV

2. CSS Syntax

Now that you know what CSS is, it’s time to learn how to use it.


Sizing in CSS

There are a number of different measurement schemas within xHTML / CSS. Which one to use depends on context, and you can mix and match them.

  • px – number of pixels, relative to the screen size. This is the most consistent across machines, browsers, monitors
  • % – percentage of the total width or height
  • em – size relative to the em size of the base font

We will go into when it is appropriate to use the various schemes in later weeks. For now, use the px units in your stylesheets.


CODE ACADEMY LESSON IV

3. Details, Details

You’ve got basic CSS under your belt—now we’ll cover some of the finer aspects.


 

The three types of HTML elements to apply styles to:

An important concept to understand is that there are basically three types of HTML tags: block-level elements, inline elements, and replaced tags.

  1. Think of block-level elements as boxes that have a line break before and after. Block-level elements are the ones you will spend most of your time applying style rules to, or manipulating with scripting. They include h1-h6, p, div, ul, ol, blockquote.
  2. Inline elements on the other hand, don’t have line breaks before and after. Inline elements are used in the middle of another element, and include a, b, strong, italic, em, span
  3. The third kind of HTML tag is called a replaced tag. What it means is simply that these elements have a set width and height. The most-used replaced tag is the <img> tag, which you must specify a height and width for.

If an element is not explicitly defined, it is known as an anonymous element.You will not be able to style this element directly.

CLASSES AND IDS

Classes and Ids are a way to designate specific elements in your HTML. You can apply either a class or id or both to any element:

<div id="navigation">

<p>

There is one key difference between a classes and ids:

  • IDs can only be applied to one element per page
  • Classes can be applied to multiple elements per page

When naming classes and ids, it is good practice to name them logically and semantically. The names should not describe the physical attributes of the style you plan to apply to them, but the type of thing that they are in the structure of your page. For example, if you have a unordered list of links that will serve as your navigation, this:

<ul id = "navigation">

is better than this:

<ul id = "top">

The reason for this once again we want to separate the structure from the presentation. Naming your classes and ids logically means that if you radically change the color scheme or layout defined by your style sheet, the structure will still make sense.


3 WAYS TO USE STYLE SHEETS

***NOTE: IN ORDER FOR YOU HTML PAGES TO ACCEPT THE STYLE.CSS FILE, YOU MUST INCLUDE THE FOLLOWING CODE IN THE HEAD OF YOUR HTML PAGE:
<link rel=”stylesheet” type=”text/css” href=”style.css” />

There are three methods of accessing style sheets from your HTML:

  1. Inline as part of an HTML tag.
  2. Embedded in the <head> section of your page between <style></style> tags
  3. In an external document that is linked to the page

Here is an example of a page that uses inline and embedded styles:

We are going to focus primarily on using external style sheets. The are a couple of advantages to this. First, you can apply the same styles to some or all pages of your site. Second, you can make a change on the external style sheet and all the pages it is linked to will change. And last, with a simple change to your code, you can switch style sheets and completely alter the look of your page.

Style sheets work in 4.x or later browsers (but still not consistently) such as Navigator 4.5 or 6 and IE 4 or 5. Most earlier browsers ignore them.

A good place to see style sheets in action, and to really understand how powerful they are, is the CSS Zen Garden.


CREATING AND LINKING TO YOUR OWN EXTERNAL STYLE SHEET

An external style sheet is a plain text document containing all the style declarations you wish to apply to the linked pages. It does not have the structural tags (html, head, body) that your HTML documents have.
Once you have created your style sheet, you can associate it with your page using the link tag in your HTML, placed between the <head> tags:

<link href="styke.css" rel="stylesheet" type="text/css"/>

Code Academy Review


MANIPULATING BASIC CSS PROPERTIES

 

CSS Classes and IDs

This tutorial covers how to group CSS selectors into classes or identify a single selector by ID.

CSS Selectors: 23 exercises

 

WEB DEVELOPER ADD-ONS

There is an excellent suite of Firefox and Google Chrome add-ons that will help you in your site development. We’re going to install them now, and I highly recommend that you install them on your home machine:

If you’re using Google Chrome, download this Web Developer Add-On.

As the course goes on, we are going to learn to use the various tools included in the suite.


VALIDATING YOUR CODE

It is essential to make sure that you are writing valid xHTML code. Improperly formatted code can cause your pages to render in unpredictable ways or not at all in various browsers.

The W3C offers a free validator that you can run any html page through:

You can also access the validator through the “Tools” menu in the Web developer toolbar.


HOMEWORK | WEEK 3

  1. If you have any outstanding validation errors in your bio and resume HTML, resolve them. Also, if you receive any comments from me today in class, or via email in the following week, incorporate them into your pages.
  2. Using all the properties we have covered today, create a single, external stylesheet and apply it to both your bio and your resume pages.
  3. Post the new work and link it to your homework page.
  4. Go back into your index.html, artist.html, resume.html and contact.html pages and add div’s.
  5. Create a style.css page in Text Wrangler and link it to your index.html, artist.html, resume.html and contact.html pages. Add the div names in your css page and STYLE them including font, color, size and any other attributes you want to use.
  6. Take any 12 images. They can be photos, illustrations, your artwork, anything you have. If you do not have anything you can pull images from Google images or create different colored boxes and use those as images. Create two different sizes of these images, one thumbnail image and one full size image. The full size image should not exceed 800×600 pixels. Use the “Save for Web” process to optimize the images, saving them in the file format most appropriate for each image. Save these images to the “images” folder you created in week two.
  7. Create HTML / CSS using the thumbnail size of the images that duplicates the functionality of the thumbnail gallery that we went over in class today. Take the thumbnail gallery one step further – link each thumbnail to its full sized image. Post the files and images to your server and put the link to the gallery on your blog.
  1. Embed a video on one of your pages.
  2. Add a background image.
  3. Make one of your images link to another website.
  4. Add at least one image that has rounded corners.
  5. Add ALT, HEIGHT & WIDTH properties to all  your images.
  6. Add a border to one of your pages.
  7. Complete 1-5 on CSS in Code Academy

 


Week 2 – HTML Pt. 2

 

Week 2 – HTML Pt. 2

For this week we will cover: Naming Conventions and index.html

Manage your Site: Remote vs. Local File Systems
Uploading your files using FTP/SFTP
Using Web Standards and Semantic Markup
Basic text formatting tags
Linking files
Special Characters
Web Developer Add-ons
Validating your Code

  • The Web is Powerful – Embrace it!
  • Commenting and Formatting Your Code
  • Color in HTML
  • Web Safe Fonts
  • Meta Data
  • Intro to Cascading Style Sheets
    • What is CSS?
    • The Box Model
    • CSS Syntax
    • Classes and IDs
    • Three ways to use style sheets
    • Manipulating Basic CSS Properties

  •  

    CODE ACADEMY LESSON I

    To review what we learned last week, go to Code Academy and create an account. Complete the following exercises:

    Introduction to HTML
    This unit will introduce you to the basics of HTML, the language used to create websites.
    HTML Basics: 13 exercises

    HTML Structure: Using Lists
    This unit covers more advanced HTML structure and teaches you how to customize your pages.
    HTML Basics II – 16 exercises


    NESTED ELEMENTS RULES

    Important Note! With the exception of div, you cannot nest one block-level element inside of another. For example, this is wrong:

    <p><h1>You can't put a heading inside a paragraph!</p>

    But this is ok:

    <div><p>You CAN put a paragraph inside a div!</p>

    You can nest inline elements inside each other:

    <strong><em>I can make this text bold and italic!</em></strong>

    And you can nest inline elements inside block-level elements:

    <p><em>I can make this paragraph italic!</em></p>

    But you can never nest a block-level element inside an inline element:

    <em><p>This is wrong!</p></em>

    AND you can never nest a block-level element inside a list element:

    <li><p>This is wrong!</p></li>

    SPECIAL CHARACTERS AND NON-BREAKING SPACES

    Text characters that are outside the normal ASCII character set must be represented in html via special character codes. This includes things like em dashes, curly quotes, ampersands, etc. These special character codes always begin with an ampersand (&) and end with a semi-colon(;). For example, an em dash (—), would be represented in your code like this:

    &mdash;

    or

    One especially useful special character is the non-breaking space:

     &nbsp;

    Put this character in your code when you want to have more than one white space in a row. However, do not use it to create indented or tabbed formatting, we’ll learn how to do that later!

    For a full list of character codes, visit W3School’s Special Characters Reference.


    LINKING FILES

    File linking is done through the use of the <a> or anchor tag.

    Use the following syntax for linking to another document:

    <a href="URL_of_target_document">link_text</a>

    For example, if you were to link to Google, you would use the following code:

    <a href="http://www.google.com/">Google</a>

    To link to an email address, which will spawn the user’s designated email client, you simply need to add the “mailto” parameter:

    <a href="mailto:emailaddress@server.com">email_text</a>

    You may also link to “anchors” in the same file.

    To do this, you must create both the link:

    <a href="filename.html#anchor_name">anchor_text</a>

    and the anchor to link to:

    <a name="anchor_name">anchor_text</a>

    Absolute vs. relative linksWhen citing the URL of the target document, you may use an “absolute” or “relative” path.

    An “absolute” path is the full web address of the document, with protocol. This path will not change depending on the document that is linking to it. This type of link is primarily used when you are linking to an address that is external to the site you are linking from.

    For example, the absolute path of this site is:

    http://www.do1thing.org

    A “relative” path is one where the information is given relative to the document on which the link appears. This type of linking will only work within a given site directory, it can not be used for external URLs.

    With relative links, you must be aware of where the document is located in the file directory in relation to the file being linked to.

    In the same directory:

    filename.html

    In a lower (sub) directory:

    subdir_name/filename.html

    In a higher (parent) directory:

    ../filename.html

    Relative to the site root:

    /filename.html

    (note: it is unusual to use paths relative to the site root)


    LINK TARGETS

    Unless instructed otherwise, a Web browser will open a target document in the same window as the linking document. The user of the “target” attribute allows you to direct the target document to an alternate window. Some of the attributes below only apply to framesets, which we will cover briefly later in the course.

    TARGET ATTRIBUTE VALUES

    _blank Opens the linked document in a new window
    _self Opens the linked document in the same frame as the link
    _parent Opens the linked document in the parent frameset
    _top Opens the linked document in the main browser window, replacing all frames

    name Opens the linked document in the window with the specified name


     

    Common Link Types

    Link to launch a New Window
    <a href=”newpage.html” target=”_blank”>
    Link to launch email application
    <a href=”mailto:myname@email.com”>
    Anchor Links to a specific place on the same page
    <a name=”top”></a>= an anchor must be indicated in a single, specific spot on the page
    <a href=”#top “>Return to Top</a> = a link with “#” before the name that was applied to theanchor link specified in another part of the page


    CODE ACADEMY LESSON II

    Complete HTML Structure: Using Lists in Code Academy
    This unit covers more advanced HTML structure and teaches you how to customize your pages.
    HTML Basics II: 16 exercises


    COMMENTING YOUR CODE

    You can place a comment tag in your HTML to put a note into the code that will not be rendered by the browser. This is especially handy in a long and complex page. A comment is formatted as follows:

    <!-- This is a comment -->

    Everything between the <!– and –> tags will be hidden from the browser, but visible when you view the source.


    COLOR

    All color in Web pages, whether it is in text, background color, or other interface elements, is expressed in the HTML via hexidecimal codes. These codes consist of a # followed by 6 letters and numbers. For example, the code for white is #FFFFFF.

    Below are two excellent references for the hex codes for the Web-safe palette.The Web-safe palette is a collection of colors that have been determined to be consistently rendered across boundaries.

    Webmonkey Color Code Chart
    Visibone Webmaster’s Palette


    FONTS

    Because a Web browser can only utilize those fonts installed on the end-user’s machine, there are a limited number of fonts reliably available across platforms. Here’s an up-to-date list of them:

    Web Safe Fonts for Mac & PC

    You should only use these fonts, or generic font designations, in your style sheets.

    Here is a great resource for viewing how Web fonts will look in a browswer:

    Typetester


    META DATA

    Meta data is located within the <head> of a web page. Your meta data is basically information that you insert that explains what this page/site is all about. Copy and past the code text below into your head:

    1. Keywords:
      Information inside a meta element describes the document’s keywords.
      The Code Looks Like this:
      <meta name="keywords" content="HTML, DHTML, CSS, XML, XHTML, JavaScript, VBScript">
    2. Description:
      Information inside a meta element describes the document.
      The Code Looks Like this:
      <meta name="description" content="Free Web tutorials on HTML, CSS, XML, and XHTML"/>

    CODE ACADEMY LESSON III


    HOMEWORK | WEEK 2

    1. Tag THREE websites on del.icio.us that are relevant to web design and specifically to what you learned in class today. It can be a tutorial, an article, a design blog or anything else that you think would be useful as a reference. Write a note in the comment section about why you think each one is a useful resource. Tag each post with the following tag:

    yorkweb12013

    AND add additional tags that will help you to find the link when you go back to Delicious and search for it.

    Create a new html page with the content of your resume called “resume.html”. Use all of the new tags we learned today to format your resume. Before you begin, decide which tags map semantically to which parts of the resume.

    2. Add an a href link to your resume.html page creating a link to an external website. Add the code for target = blank.

    3. Add the code for the email link to your resume.html page.

    4. Add the space character to anywhere on your resume.html page.

    5. Add the comment code:

    <!-- This is a comment -->
    somewhere on your page and make a comment.

    5. Create a new html page called “index.html”. Remember, index.html is the HOME PAGE (landing page) on your website. Create hyperlinks to your artist and resume pages on this page.

    Add both lines  of METADATA code into your head.

    6. Create a new html page called “artist.html” and insert the text you wrote for your artist statement and mark up the text.

    7. Create a new page called: homework.html and upload it to your server. Add hyperlinks on that page that will take me to your index.html, artist.html, homework.html and contact.html pages.

    8. Create a new html page called “contact.html”. Create hyperlinks to your homework, resume and artist pages on this page.

    Add links between each of the pages.

    You can do this by create a LIST and adding that list to each of your pages. Below is an example:

    <ul>    <li><a href=”http://www.katmakes.com”>Home</a></li>    <li><a href=”http://www.katmakes.com/resume.html”>Resume</a></li>    <li><a href=”http://www.katmakes.com/artist.html”>Artist</a></li>    <li><a href=”http://www.katmakes.com/contact.html”>Contact</a></li>    <li><a href=”http://www.katmakes.com/hw.html”>Homework</a></li>     </ul>

    You will need to incorporate the following in your resume.html page:

    • page anchor links within the longest page to take the user back up to the top of the page
    • external links to at least two (2) web pages that you will use as online reference related to the topics you wrote about on your pages
    • an email link to your contact email address

Upload all new pages to your server.  ***Please let me know if you DO NOT have a web space

9. IF YOU DID NOT finish the Code Academy classes one through three, finish them for homework.

  • Introduction to HTML
  • HTML Structure: Using Lists
  • HTML Structure: Tables, Divs, and Spans

REFERENCE: The following three (3) reference articles are great resources…

Webmonkey – HTML Cheatsheet http://www.webmonkey.com/webmonkey/reference/html_cheatsheet/

Webmonkey – Stylesheets Guide http://www.webmonkey.com/webmonkey/reference/stylesheet_guide/

Brett Merkey – Most Useful CSS Properties with Examples http://home.tampabay.rr.com/bmerkey/cheatsheet.htm

Week 1

“In the Future Everyone will be famous for 15 minutes”
-Andy Warhol 1968

“On the Web, everyone will be famous to fifteen people”
-David Weinberger* 2002

The Class Blog

This is the class blog. All lessons, homework, readings, and resources for the class will be posted through this blog. All of you will be required to register on the blog, and I will use the email address that you sign up with to communicate with you outside of the class. I will also place comments to your work on this blog. Please take note of the address now!

You will be required to log into the class blog each class. Open up PHOTOBOOTH on your Mac and take a close up photo of yourself. Please create a gravatar account and upload your image so that your image will be posted with each of your comments. Use you YORK email address to create the account. For the account name, use your full first and last name.


Your Personal Blog

You will post all homework on your personal blog. This is a blog you create specifically for this class. Go to WordPress and create your blog. For your blog address as well as your username, use your full name. Example, johnbrown.wordpress.com. It’s as easy as that! Please take note of the address now!

You will be required to post all your homeword on your personal blog before the start of each class. When you log into the CLASS BLOG for each class, write the url of your homework that you created on your PERSONAL BLOG.


Del.icio.us

Del.icio.us is a social bookmarking service that everyone is required to sign up for an account for an maintain tags on it. Through del.icio.us you are going to “tag” pages related to our work in the class so that you can reference them later and share them with the class. It is a way to keep all your tagged pages in an orderly manner making it very easy for you to find your tagged pages.

Sign up for an account here: http://del.icio.us/


W3 SCHOOLS

This is a great resource site, I’m going to be referring to it a lot this class and in the future. If you are ever stuck for how to do something, start here:
http://w3schools.com


FILE NAMING CONVENTIONS AND INDEX.HTML

There are a few rules that govern the naming of web files and directories:

All Web page files must end with .html or .htm. These extensions are interchangable, but generally we use .html
Names are case sensitive. This means that Bio.html and bio.html will be considered by the server as two different files.
Spaces and non-alphanumeric characters are not allowed, with the exception of underscore (_) and hyphen (-)
The “home” page of a Web site is always called index.html or index.htm. If this file does not exist, you will either get an error or see a directory listing of the root directory, depending on how the Web server is configured.

My suggestion to all of you is that you come up with a naming convention for yourself now, and stick to it. This will avoid a lot of problems later on! For example, my naming convention is to use all lowercase letters, and to use underscores instead of spaces:

my_name.html


CHOOSING A WEB HOST PROVIDER AND DOMAIN NAME

To take your website live you’ll need a web host provider and a domain name. There are hundreds of web host providers that offer a variety of services. CNET lists best practices for choosing a website host provider and it’s worth a few minutes to read it. Bluehost, GoDaddy and Hostmonster are just a few. I highly recommend BLUEHOST. Their control panel is very easy to use and understand. Their $5.95/month price is extremely reasonable, they give you a free domain registration and have a money back guarantee.

You are required  to sign up for a website host provider.


MANAGE YOUR SITE: REMOTE VS. LOCAL FILE SYSTEMS

When we build a Web site, we develop them on our local (or “desktop”) machine, and publish them to a remote “Web server”. A Web server is a computer that is essentially the same as your desktop machine, but has server software installed that allows it to take http requests from an internet user’s computer (or “client”), and deliver the requested html document to the user’s browser. This client / server relationship is the basis of all Web activity.

What we call a “site” is really just a collection of html documents that we associate via internal references (links) between them. In order to keep your site organized, and to ensure that it functions exactly the same online as on your desktop, you must keep the file and directory structure exactly the same on the local and remote machines.

The first step in doing this is to organize your local file structure. First, create a “root” folder on your local machine or flash drive from which you are going to work. This folder could be named for the course (web design 1) or your username (najlahhicks). It doesn’t matter what the name is at the top level.

For the beginning of this class, I’m going to dictate a file structure that I want you all to use.

Within your root directory, create two directories:

working_files
public_html

From now on, the “working_files” directory will hold documents and images that you use as resource files for building your site, but not any files that will uploaded to the site itself. Put the resume text file that you brought today into this directory.

The public_html directory will contain all files that will actually become part of your site. Put the bio html file that you created as homework in that directory now.

Within the html directory, also create a subdirectory called:
images

We will use this directory later in the course to store any images that will appear in your web site.


UPLOADING YOUR FILES USING FTP/SFTP

Your html files are uploaded to the Web server using FTP, or File Transfer Protocol. You will need an FTP client to do this. If you are using the A server, you will need a program that supports SFTP, or Secure File Transfer Protocol. Here are likes to some popular programs:

Fugu (MAC) – This program is free.
Fetch (MAC)
CyberDuck (MAC) – This program is free.
FileZilla (PC) – This program is free.

All these programs function essentially the same. To connect to your remote server, you enter the address of the FTP server, your username and password.


Intro to HTML

HTML is the language of Web browsers. HTML stands for HyperText Markup Language. HTML is a simple scripting language originally designed to allow nonlinear navigation of large text documents. It is constantly undergoing revision and evolution to meet the demands and requirements of the growing Internet audience under the direction of theW3Schools, the organization charged with designing and maintaining the language.
HyperText is the method by which you move around on the web. Clicking on specially coded text called hyperlinks navigates you to other pages. The term hyper indicates that the hierarchy of the pages is not linear — i.e. you can go to any place on the Internet whenever you want by clicking on links — there is no set order to do things in. Markup refers to HTML “does”.

HTML Syntax

All HTML syntax is composed of discreet pieces of code called elementsElements are made up of paired opening and closing tags.


 

FILE NAMING CONVENTIONS AND INDEX.HTML

There are a few rules that govern the naming of web files and directories:

All Web page files must end with .html or .htm. These extensions are interchangable, but generally we use .html
Names are case sensitive. This means that Bio.html and bio.html will be considered by the server as two different files.
Spaces and non-alphanumeric characters are not allowed, with the exception of underscore (_) and hyphen (-)
The “home” page of a Web site is always called index.html or index.htm. If this file does not exist, you will either get an error or see a directory listing of the root directory, depending on how the Web server is configured.

My suggestion to all of you is that you come up with a naming convention for yourself now, and stick to it. This will avoid a lot of problems later on! For example, my naming convention is to use all lowercase letters, and to use underscores instead of spaces:

my_name.html

HTML Syntax

All HTML syntax is composed of discreet pieces of code called elementsElements are made up of paired opening and closing tags.

Tags

Each tag has a specific meaning that communicates to the browse what it should do with the content between the opening and closing tag. For example, the <b></b> tag tells the browser to make bold all text contained between its opening and closing tags.

Tags are the cornerstone of HTML. Tags are instructions to the Web browser that dictate the display of text, images and other elements on the page and are not visible when the page is displayed to the user. You can recognize an HTML tag because it appears in between greater than and less than signs:
<tagname>

There is a large set of pre-designated tags within HTML. Today we are going to cover the basic tags needed for building a basic HTML page and formatting text.

There are two types of tags, container tags and non-container tags.

Container tags appear in pairs, as an opening tag and as a closing tag, like so:
<tagname> </tagname>

Everything contained between the opening <> and closing </> tags is subject to the tag properties.

Non-container tags appear singly, and are what is called “self-closing.” This means that they do not appear in sets, but only as a single tag. In this case, the page content affect by the tag is all contained within the single tag, like so:
<tagname tagcontent />

Note: Previous versions of HTML did not require the closing “/” character at the end of the non-container tag, and it will generally function correctly in most browsers without it, but for the specification we will be using as the standard for this class, you will need to include this.

Attributes

In the language of HTML, attributes serve to modify tags, much like an adjective modifies a noun. As the name implies, attributes are properties of the tag. Each tag has properties that can be changed via the use of the attributes that are associated with it. Attributes follow the tag name within a tags opening component, in between the greater than and less than signs, like so:
<tagname attributename=”value”>

The order of attributes is not important. You can place as many attributes inside a tag as is needed:
<tag attribute1=”value1″ attribute2=”value2″ attribute=”value3″>


Page Structure

In order for a Web browser to recognize a file as an HTML document, it must contain the proper structure. At the minimum, it must contain five basic tags. These tags must appear in the correct order. The page structure tags are as follows:

DOCTYPE tells the Web browser which HTML or XHTML standard your document is written to. For this class, you should useXHTML5 transitional. This is the first thing that should appear in any HTML document that you write.

<!DOCTYPE html>

Always use the code exactly as it appears above. If you would like to read more about DOCTYPE and its use, check out this article on DevGuru.

The <html> tag comes next. It encloses all other tags and content on the page, and further serves to instruct the browser that what is being rendered on the rest of the page. You should use this format for the html tag:



Third is the <head> tag which contains information that is not displayed in the browser window. For instance, a head tag may include information that search engines may use to find the page.

The <title> tag contains the text that appears in the title bar of the browser window. It is nested within the head tag.

The <body> tag contains all of the information to be displayed by the browser.

Using these tags, you can build a basic page structure:

<!DOCTYPE html>
<html>
<head>
<title>My First HTML Page</title>
</head>
<body>

Anything inside the body tags will appear on your Web page.

</body>

</html>

Use this template as the basis for all of your HTML pages!


Creating your own HTML pages with Text Editors

To make your own Web pages, start with the code above. HTML pages can be created in any Plain Text Editing application. DO NOT use Microsoft Word, as it will add extra formatting that will break your code. Here are links to several text editors that you can download and use to create your pages:

DOCUMENTS MUST HAVE LOGICAL STRUCTURE

All XHTML elements must be nested within the <html> root element. It is the element from which grows the document tree. All other elements can have sub (children) elements. Sub elements must be in pairs and correctly nested within their parent element. Within the html element there are two necessary “child” elements: the head element and the body element.

Logical Markup Example (Using semantic markup to describe content.)

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN"
"http://www.w3.org/TR/REC-html40/strict.dtd">
<html>
<head>

<title>Working with Structure</title>

</head>

<body>

<h1>Welcome</h1>

<p>Welcome to the site where structure matters!</p>

<h2>Getting Into Structure</h2>

<p>In order to begin working with structure, you need to be aware

of:</p>

<ul>

<li>DOCTYPE declarations</li>

<li>Properly structured head and body components</li>
<li>Logical structures for content markup</li>

</ul>

</body>
</html>

VIEWING THE DOCUMENT TREE

When you have a more semantic document, you can easily visualize it via the document tree, which is a map that reflects where elements go within the structural hierarchy of the document. This tree becomes critically important when using CSS because of the concept of inheritance.

Document root: html

  • head & body are children to the root
  • title is child to the parent head
  • h1 , h2pul all children of body
  • Each li is a child to ul
  •  ELEMENTS MUST BE PROPERLY NESTED

    In HTML some elements can be improperly nested within each other like this:

    <strong><em>This text is bold and italic</strong></em>

    In XHTML all elements must be properly nested within each other like this:

    <strong><em>This text is bold and italic</em></strong>

TAG NAMES MUST BE IN LOWER CASE

This is because XHTML documents are XML applications. XML is case-sensitive. Tags like <p> and <P> are interpreted as different tags.

This is wrong:

<BODY>
<P>This is a paragraph</P>

</BODY>

This is correct:

<body>
<p>This is a paragraph</p>
</body>

ALL XHTML ELEMENTS MUST BE CLOSED

Non-empty elements must have an end tag.

This is wrong:

<p>This is a paragraph

This is correct:

<p>This is a paragraph</p>

Empty Elements Must also Be Closed

Empty elements must either have an end tag or the start tag must end with />.

This is wrong:

This is a break<br>

This is correct:
This is a break<br />

IMPORTANT Compatibility Note:

To make your XHTML compatible with today’s browsers, you should add an extra
space before the “/” symbol like this: <br />.

THE <!DOCTYPE> IS MANDATORY

An XHTML document consists of three main parts:

  • the DOCTYPE
  • the Head
  • the Body

The XHTML standard defines three Document Type Definitions.

You must select a DOCTYPE and follow the guidelines of that DOCTYPE. The browser will attempt to render your page in standards-compiant mode, following the XHTML and CSS recommendations. If you don’t follow the DOCTYPE guidelines or don’t define a DOCTYPE at all or incorrectly the browser will enter “quirks mode” and render your pages as they might appear in an older browser.

The most common DOCTYPE is the XHTML Transitional.

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

Another DOCTYPE we will use is XHTML 1.0 Strict:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "
http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">


BASIC TAGS CONTINUED

Last week we introduced the basic page tags and the <p> tags. Today we are going to learn the rest of the most commonly used tags.

There are two types of HTML formatting tags: inline and block level tags. These two types have slightly different behaviors.

Inline tags

These tags are designed to enclose content that is part of another element. Generally they are used when you want to affect just part of the text in a paragraph. There are just two inline tags we are going to talk about today.

Bold text:

<strong></strong> or <b></b>

Italic text:

<em></em> or <i></i>

Line breaks:

This is a self-closing (non-container) tag. This will create a single line break wherever it is placed in the code:

<br />

Block level tags

These tags are used to control blocks of content. The main characteristic that differentiates block from inline is that block level elements appear by default with a line break before and after them. Here are the most common block level tags you will work with:

The six heading levels:

<h1>Heading 1</h1>

<h2>Heading 2</h2>

<Hh3>HEADING 3</h3>

<h4>Heading 4</h4>

<h5>Heading 5</h5>
<h6>Heading 6</h6>

Again, the paragraph tag:

<p></p>


LISTS

There are several tags that you can use to create a “list” of items which is a very important way of organizing content. When used in combination with CSS,  lists are a great way to create navigation menus. The tags below are a little different than the tags above in that you must use two distinct tags to create the list, one that contains the entire list, and one that contains each item in the list. Let’s look at

There are three types of lists: unordered, ordered, and definition.


Unordered ListThis tag, enclosing all list content, creates a bulleted list.

The code:

<ul>

<li>apples

<li> oranges</li>

<li>pears</li>

</ul>

This is how the list would look:

Screen Shot 2013-01-30 at 1.45.06 PM

This is a LIST with an a href which makes your list a LINK.

Unordered List

List Item

NOTE: Inside the <ul> or <ol> tages, you use a set of tags, enclosing each line, or “list item” item:

<li></li>


Unordered List

This is how it would look on the web.

This is how it would look written in Text Wrangler.

This is the code you would use:

<p>This is an example of an unordered list.</p>

<ul>
<li>Unordered information</li>
<li>Ordered information</li>
<li>Definition lists</li>
</ul>


Ordered List

This tag, enclosing all list content, creates a numbered list:

<ol></ol>

To make an ordered list, like this:

  1. Monday
  2. Tuesday
  3. Wednesday
  4. Thursday
  5. Friday

Use this code:

<ol>
 <li>Monday</li>
 <li>Tuesday</li>
 <li>Wednesday</li>

 <li>Thursday</li>
 <li>Friday</li>
</ol>

Definition ListThis tag involves a main phrase, and then a definition for that phrase that appears indented and appearing on a separate line.

The
<dl></<dl>
tag defines the definition list.
The
<dt></dt>
tag is used for the main phrase in the list.
The
<dd></dd>
tag is for the definition itself.
This is how it would show up on the web.
This is how it would look written in Text Wrangler.

Use this code:

<dl>
<dt>This names an item</dt>
<dd>This defines the item names</dd>

<dt>This names another item</dt>
<dd>This defines the other item named</dd>
</dl>

To create an unordered list, like this:Use this code:

<ul>

<li>Unordered information</li>
<li>Ordered information</li>
<li>Definition lists</li>
</ul>

Common Link Types Link to launch a new window <a href=”newpage.html” target=”_blank”> Link to launch email application<a href=”mailto:myname@email.com”>

<a href=”mailto:myname@email.com”>email me now</a>

OR

<a href="mailto:someone@example.com?Subject=Hello%20again">
Send Mail</a>

When someone clicks on the the “Send Mail”, the email field will pop up.

Anchor Links to a specific place on the same page

<a name=”top”></a>

= an anchor must be indicated in a single, specific spot on the page
<a href=”#top “>Return to Top</a> = a link with “#” before the name that was applied to the anchor link specified in another part of the page.

All the basic tags in one document


Homework | Week 1

  1. Register as a user of this blog. Post a comment to this blog post to let me know that you are registered and include the address for your  ”wordpress blog”. Each week following this you will post a link to your homework on your own WordPress blog in the comments section of this blog.
  2. Go to WordPress and create a blog that you will use to house your homework for this class. Under appearances, select themes and choose a new theme. Add widgets, fill out the personal info on the blog and create a blog that shows some personality.
  3. Create a del.icio.us account for yourself. Tag three Web Sites that you like or visit on a regular basis, and write a note about why you think each one is a well designed and effective site.
  4. Using the basic page template that you saved in class today, create an HTML page that contains a short bio of yourself. Bring this file to class with you next week, also, please post it on YOUR blog. Here is an example of a resume.
  5. Create an artist statement and resume for yourself as a text file (not HTML) and bring it to class next week – also, please post it on YOUR wordpress blog. Here is an example of an artist statement.
  6. Create a Gravatar account. Take a photo of yourself, upload it to Gravatar and link it to your WordPress blog using the email you used to create the blog.
  7. Add at least two LISTS to your resume markup.