Jan's Illustrated Computer Literacy 101 Logo:Jegsworks Jan's Illustrated Computer Literacy 101


Home > Jan's CompLit 101 > Working with the Web > HTML & CSS Basics > Summary
Icon: Arrow - Previous pagePrevious    NextIcon: Arrow - Next page

Jan's Working with the Web

   HTML & CSS Basics: Summary

Web pages are written in HTML (HyperText Markup Language), which is a coding system that uses tags to identify the parts of a document's logical structure. Browsers have their own rules about how to display the various document parts on the screen. An HTML author cannot totally control the final appearance of an HTML document. Several factors affect what the viewer sees, including the operating system, browser, color depth, resolution, and window size.

You can use a plain text editor, like Notepad, to create and edit HTML documents. A WYSIWYG [What You See Is What You Get] editor, like Dreamweaver, has many helpful features, but cannot really show you what the page looks like on all other computers.

HTML code marks the various parts of the document, like paragraphs, lists, and headings, images, and tables. Most HTML elements are made up of an opening tag, a closing tag and whatever text is between them. An opening tag is formed by surrounding a keyword with the angled brackets  < and  > , like <h1> and <title>. An opening tag tells where a document part begins. A closing tag looks just like the opening tag except that it puts the slash symbol  /  before the tag name. This tag tells where the part ends. Some elements, like IMG for an image, do not have a closing tag. The XHTML standard requires these elements to have a closing slash before the right angle bracket, but HTML itself does not require this. All HTML documents must include the HTML and BODY tags.

The key features in HTML are the hyperlink and the wrapping of text to the window. Hyperlinks are created by surrounding text or an image with an anchor tag, <a> , which includes a HREF attribute that has an absolute or relative path as its value. Clicking the hyperlink opens a new document or image.

A tag may have one or more attributes, which can have different values. The HTML and CSS standards include elements, attributes, and values that your browser may not support yet.

Cascading Style Sheets can control the display of the page, like font-family, font-size, alignment, border, color, and the position of the element on the page or in the window. An inline style (STYLE attribute of an element) overrides an internal style sheet (in the HEAD of the page) which overrides an external style sheet (linked to the page). A style in an internal or external style sheet for an HTML element, like H1 or P, will be used every time that element is used on the page. But a style class must applied with the CLASS attribute in the element you want to use that style.

You can create a separate set of styles in an @media print section of an internal or external style sheet to control formatting for printing. An @page section can set the printed page margin, size, and orientation.

Converting an existing document to HTML can be useful. But you must carefully check the new document for missing parts and formatting changes. 


HTML Tags and CSS you have used:

HTML tags: HTML Attributes: CSS properties:

!DOCTYPE

HEAD

TITLE

LINK

STYLE

BODY

P

A

a:link

a:visited

a:hover

a:active

EM

I

STRONG

B

Heading:
      H1, H2, H3, H4

List:
      OL, UL, LI
      DL, DT, DD

Table:
      TABLE, CAPTION, TH, TD

IMG

HR

BR

DIV

SPAN

Comment: <!--  -->

class

id

style

[A] href

[IMG]  alt, height, src, title, width

[TABLE]  border, colspan

HTML Special Characters

&amp;    &

&gt;       >

&lt;        <

&nbsp;   space

&quot;   "

 

background-color

background-image

border

border-collapse

border-color

border-width

caption-side

clear

color

float

font-family

font-size

font-style

font-weight

height

left

margin

margin-bottom

margin-left

margin-right

margin-top

padding

page-break-before

position

overflow

padding

position

text-align

top

transform: rotate

transform: scale

vertical-align

width

z-index


What you printed for Web Project 2:

Lesson page: What printed: With program: # of pages:

HTML Code Example

List of tags

By hand

1

Create a Page

simple-Lastname-Firstname.htm

browser

1

Create a Page

simple2-Lastname-Firstname.htm

browser

1

List

hector1-Lastname-Firstname.htm

Notepad

1

List

hector1-Lastname-Firstname.htm

browser- bulleted list

1

List

hector2-Lastname-Firstname.htm

browser- numbered list

1

List

hector3-Lastname-Firstname.htm

browser- hobbies added

1

Readable Code

hector4-Lastname-Firstname.htm

text editor - headings formatted

1 or 2

Edit

hector5-Lastname-Firstname.htm

text editor -after styles

2

@media print

hector25-Lastname-Firstname.htm

browser - finished web page

2

Doc to HTML

NZinfo.htm

Word - after save as web page

3

WYSIWYG

WYSIWYG view

simple HTML editor on page. Your name in first line of text.

1

WYSIWYG

source code view

simple HTML editor on page
Your name in first line of text.

1


Skills Covered - by Lesson

Code Example

  • View source code
  • Identify HTML tags in use
    Find attributes and values
  • Find special characters
  • How to code special characters
  • Use Character Map

Create a Page

  • Create a simple HTML document
  • View HTML document in a browser
  • Print from browser
  • View source code from the browser
  • Open source code in Notepad
  • Edit the source code
  • Inspect source code of live web page

Create and Modify a List

  • Configure Notepad
  • Create HTML document in Notepad
  • Create a bulleted list
  • Print source code and HTML page
  • Create a numbered list
  • Create a terms and definitions list

Readable Code

  • Add blank lines to code
  • Add indentions to code
  • Add comments to code

Edit Code

  • Add Heading 3 
  • Add paragraph text
  • Open and change Page Setup
  • Print source code from Notepad

Text Links

  • Use Save As for safety
  • Create a text link with complet URL
  • Create a text link with relative path
  • Create an email link 
  • Verify a link

Insert Image

  • Copy image files
  • Insert an image with relative path
  • Find out the dimensions of the image
  • Resize an image with the IMG tag (not a good plan!)

More Images

  • Add spaces
  • Insert multiple images with space between

Inline Images

  • Add inline images

Replace Image

  • Check download time
  • Edit image SRC
  • Add ALT text in code
  • Add TITLE text in code

Image Link

  • Create an image link
  • Create a link to an image
  • Verify link

Align and Space Images

  • Add image to page
  • Float and space image
  • Stop text wrapping
  • Center image 

Save to a New Location

  • Save a web page to a different folder, which breaks images
  • Fix broken images by coping images to new location
  • Save a web page to subfolder, which breaks images
  • Fix broken images by changin path in SRC
  • Fix broken link by editing path in SRC

Edit Image

  • Add WMF image to page
  • Use Paint to save as PNG
  • Use new PNG image

Page Colors

  • Use an internal style sheet to set page colors using color numbers for:
    • background color
    • text color
    • link colors - unvisited, visited, hover, active
    • background color for a:hover
  • Set color with color names
  • Use Paint to pick a custom color
  • Use the #rrggbb value of the custom color

Edit Image Background (with Paint)

  • Pick existing color from a picture
  • Create a custom color
  • Change color in picture
  • Save in different formats and test in browser

Image Background

  • Set a background image
  • Experiment with various kinds of background images

Format Text

  • Center an image on the page
  • Create an external style sheet 
  • Style H2 - font-family, color, text-align
  • Style H3 - font-family, color
  • Style H4, P, and create a class
  • Make text bold and italic with HTML tags
  • Use a downloadable font

Horizontal Rule

  • Insert a horizontal rule 
  • Format a horizontal rule in external style sheet
  • Format IMG and class in external style sheet 

Data Table

  • Create a data table
  • Add data to cells
  • Float the table with inline style
  • Format the table with inline style
  • Format cell contents with internal style sheet
  • Add a row and merge cells
  • Add a caption to table

Position Table

  • Create a table for positioning
  • Move content into table cells
  • Align content with inline styles

Center DIV

  • Create and apply an #ID selector to center DIV in window
  • Format the centered DIV

Side by Side with DIVs

  • Add DIV for container and two DIVs
  • Add ID to each DIv
  • Create internal style for each #ID
  • Add HEIGHT to each #ID style
  • Handle overflow when contents won't fit in the space

Position Overlapping

  • Add set of images
  • Position and stack images to overlap
  • Control overlapping of content below
  • Control overlapping of floating table with Z-INDEX
  • Rotate an image with TRANSFORM

@media print, @page

  • View your web page in Print Preview and evaluate layout for print
  • Use @media print in external style sheet to control what prints
  • Add a page break in internal style sheet
  • Use @page to control print margins 
  • Use TRANSFORM to scale DIV

DOC to HTML

  • Convert a Word doc to HTML
  • Compare to original to see some of the problems in converting 

WYSIWYG

  • Use embeded WYSIWYG editor
    • Type text
    • Apply headings and formatting with buttons
    • View source code in the editor
    • Add formatting styles in the source code
    • Add an image
    • Print resulting page from the editor
    • Copy and paste source code to Notepad or text editor and print
    • Evaluate using a WYSIWYG editor

Skills Covered in Exercises

Exercise Web 2-1: Format (Ricardo's page)

  • Title the page Create an internal style sheet
  • Format the page
  • Insert an image
  • Create a text link and an image link
  • Apply heading tags
  • Add styles to an internal style sheet
  • Adjust text wrapping
  • Add and style a horizontal rule
  • Insert a timestamp from Notepad
  • Print from Notepad and the browser

Exercise Web 2-2 Data Table (Los Lobos page)

  • Create a fixed background for the page
  • Add an image, format it, and center it
  • Create a data table and enter the data
  • Center the table
  • Icon: New Skill Merge cells in a single column with ROWSPAN
  • Create styles for the table and table cells
  • Icon: New Skill Use the ADDRESS element
  • Create links
  • Add a horizontal rule
  • Print from Notepad and from the browser

 

Exercise Web 2-3 Convert and Position (Ergonomics article)

  • Copy and paste a Word doc to Notepad
  • Add HTML tags
  • Add CSS styles to format
  • Float image
  • Change background to use a side border
  • Use a positioned DIV to keep text off border
  • Use @media print

Exercise Web 2-4 (Tahiti Packages)

  • Use text to create a new web page
  • Use CSS to format text, elements, DIVs, list
  • Icon: New Skill Apply properties text-transform, list-style-image, text-shadow, box-shadow.
  • Use positioned DIVs to arrange text into side-by-side columns
  • Print in Landscape orientation with @media print formatting
  • Use multiple selectors for the same style

Exercise Web 2-5 Positioning (Hector's hobbies)

  • Use CSS to create three side-by-side DIVs

 


Important Terms

absolute path

absolute position

anchor

anchor tag

align

animated GIF

attribute

backwards compatible

block element

bmp

browser

browser safe colors

bullet

cascade

cell

cell padding

class

closing tag

column

compress

CSS

cursive font

declaration

deprecated

DHTML

dither

domain name

download

element

external style sheet

fantasy font

fixed position

generic font

gif

graphics conversion 
    program

graphics program

hack

horizontal rule

href

HTML

hyperlink

inline element

inline style

interlaced GIF

internal style sheet

JavaScript

jpg

link

list: definitions

list: descriptions

list: numbered

list: bulleted

mailto link

monospace font

nesting

non-breaking space

opening tag

overflow 

path

pixel

png

primary colors

progressive JPG

property

proportional font

publish

relative path

relative position

row

sans-serif font

selector

serif font

source code

stacking order

static position

style sheet

svg

tag

table

text editor

text graphics

texture

thumbnail

tile

transparent GIF

upload

value

vector image

W3C

watermark

web server

web page

web space

white space

WYSIWYG editor

XHTML

XML

z-index