
Mike Scott, MSF&W Accessibility Solutions
http://www.msfw.com/accessibility
accessibility@msfw.com
Version 1.2, February 14, 2002
<tag>content</tag><tag attribute="value">content</tag><tag attribute="value"><p>This is a paragraph.</p><a href="http://www.google.com">Google</a><img src="myimage.gif" alt="My Image"><strong><em>not good</strong></em><strong><em>much better</em></strong><, >, &, and sometimes "<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"><html lang="en"><head><title>Document Title</title><meta http-equiv="Content-Type"content="text/html; charset=utf-8"></head><body></body></html>
selector { property: value; }
selector { property: value; property: value; }
selector1, selector2 { property: value; }
selector1 selector2 { property: value; }
| Selector | CSS Example | HTML Example |
|---|---|---|
| element | p {...} |
<p> |
| element.class | p.warning {...} |
<p class="warning"> |
| element#id | element#warning1 {...} |
<p id="warning1"> |
| .class | .warning {...} |
<p class="warning"> |
| #id | #warning1 {...} |
<p id="warning1"> |
| pseudo-class | a:hover {...} |
<a href="..."> |
<tag style="property: value;">
<style type="text/css">
selector { property: value; }
</style>
<link rel="stylesheet" type="text/css" href="stylesheet.css">
p { font-weight: bold; }
p { font-style: italic; }
p { color: red; }
This paragraph is bold, italic & red.
p { font-weight: bold; }
em { font-style: italic; }
strong { color: red; }
This paragraph is bold; this phrase is italic; this word is red.
<html lang="en"><p lang="es">¿Habla español?</p><p>In France, <span lang="fr">"c'est la vie"</span></p>:-) = "colon dash left parenthesis"--> = "dash dash greater"<< previous = "less than less than previous"<img src="image.gif" alt="alternate text">
alt="" (empty)
<img src="image.gif" alt="alt text"
longdesc="description.html">
(Or, don't use them.)
(Really, don't use them.)
"Click here, click here, click here, click here..."
<form action="url" method="get|post" name="">
... fields ...
</form>
<input type="text" name="" value="">
<input type="password" name="" value="">
<input type="hidden" name="" value="">maxlength="#"readonly<textarea name="" cols="#" rows="#"></textarea>readonly<input type="checkbox" name="" value=""><input type="radio" name="" value="">checked<input type="submit" name="" value="Submit"> <input type="reset" name="" value="Reset"> <input type="button" name="" value="Button"> <button name="">Button</button> onclick (for scripted events)
<select name=""><option value="">Choice 1</option><option value="">Choice 2</option><option value="">Choice 3</option></select>
|
|
size="#" (for select)multiple (for select)selected (for option)
<fieldset>
<legend>Legend</legend>
... form fields ...
</fieldset>
<label for="fieldId">Label Text:</label>
<input type="text" name="fieldName" id="fieldId">
<input type="text" title="Label Text">
and/or
<input type="text" tabindex="1" >
readonly on text fields and textareasonclick="return false;" on checkboxes & radio buttonsselect's as text fieldsinput, textarea, button, select { font-size: 100%; }
<table cellpadding="#" cellspacing="#" border="#" width="%">
<tr>
<td>data</td>
<td>data</td>
<td>data</td>
</tr>
... repeat rows ...
</table>
| data | data | data |
| data | data | data |
| data | data | data |
| data | data | data |
| data | data | data |
<table>
<tr>
<th scope="col">column header</th>
<th scope="col">column header</th>
</tr>
<tr>
<th scope="row">row header</th>
<td>data</td>
</tr>
</table>
| column header | column header | column header |
|---|---|---|
| row header | data | data |
| row header | data | data |
| row header | data | data |
| row header | data | data |
| Meals | Hotels | Transport | Subtotals | |
|---|---|---|---|---|
| San Jose | ||||
| 25-Aug-97 | 37.74 | 112.00 | 45.00 | |
| 26-Aug-97 | 27.28 | 112.00 | 45.00 | |
| Subtotals | 65.02 | 224.00 | 90.00 | 379.02 |
| ... and so on ... | ||||
| Totals | 196.27 | 442.00 | 162.00 | 800.27 |
<table>
<tr>
<td colspan="3">Colspan</td>
</tr>
<tr>
<td rowspan="2">Rowspan</td>
<td>data</td>
</tr>
<tr>
<td>data</td>
</tr>
</table>
| colspan | ||
| rowspan | data | |
| data | ||
| data | ||
| data | ||
id and headers
<table>
<tr>
<th id="col1">column header</th>
<th id="col2">column header</th>
</tr>
<tr>
<th id="row1">row header</th>
<td headers="col2 row1">data</td>
</tr>
</table>
<table summary="Summary of the table (imagine that)">
<tr>
<td>data</td>
<td>data</td>
<td>data</td>
</tr>
</table>
onevent="this.style.property='value';"
onevent="document.getElementById('id')
.style.property='value';"
this can be used to identify current elementdocument.getElementById() identifies any elementfont-weight = fontWeight)onfocus similar to onmouseover (for focusable elements)onblur similar to onmouseout (for focusable elements)onclick can work for both (for focusable elements)In Internet Explorer, onchange fires when arrowing through options
For example: