caption tag: Adds a brief summary of the table. Must be inserted before the first <tr> or <td> tag. HTML4 allows an extra attribute, summary, which allows for a longer, more descriptive, caption used for text-to-speech browsers.
Top
cascading style sheets: The basis of style management in
HTML4. The main
CodeHelp site
contains detailed explanations of style sheet syntax and uses. Search for stylesheet More on stylesheets.
Top
cellpadding attribute: (<table> tag) Padding between the
cell border and the cell contents, expressed in pixels. Default is 1.
Top
cellspacing attribute: (<table> tag) Spacing between adjacent
table cells, default is 2.
Top
center tags: Now replaced by <div align=center> </div> or <span align=center> </span> and deprecated in HTML4 . Using div or span allows for subsequent movement or adjustment of the precise location using Javascript. Still commonly used by WYSIWYG HTML editors like FrontPage.
Top
Checkboxes in HTML, see under Input.
Javascriptbox1 in a form named
myform:document.myform.box1var checked = document.formname.boxname.checked;
document.formname.boxname.checked = 1;
document.formname.boxname.defaultChecked = 1;var value =
document.formname.boxname.value;
document.formname.boxname.value="newvalue";<input type="checkbox" name="ID"
onclick="my_clickfunc();">checked attribute: checked=1 sets the radio button or checkbox
to checked (on). <input type="radio" checked=1>
Top
Use the keyword class to assign the settings declared in the style sheet to the HTML tag: <p class=indent> </p> Only <base> <basefont> <head> <html> <meta> <param> <script> <style> and <title> cannot contain a class selector.
To set the settings for a class in the stylesheet, use the syntax
.classname {setting:value;} The period . is the class selector, telling the stylesheet to use the classname as a class. Omitting the period causes the browser to attempt to use the settings on any HTML tag of the same name.
See also:
Specifies whether to allow floating elements on either side, just the left side, just the right side or neither side of an image.
style="clear:none" - default
style="clear:left" - no elements may be placed on the left side.
style="clear:right" - no elements may be placed on the right side.
style="clear:both" - the image is placed with no elements either side.
Top
code tags: <code> changes the default font to monospace (usually Courier). Used to set source code apart from ordinary text in HTML documents. No line break or space is added before <code> or after </code>. Make sure you use the </code> tag before closing a table, div, span or form which includes the <code> tag.
Top
The use of tables to create multi-column text, captions and sidebars is now deprecated. Tags and attributes that support such non-tabular output may be dropped from the HTML standard and from browser support. Tables should only be used for tabular data. The <col> and <colgroup> tags provide control over the width and alignment of columns within the table and largely replace the align attribute in <table> and <td> tags.
Use col to control specific column widths and backgrounds. Use colgroup to control groups of adjacent columns with a single tag.
To set the width of a specific column, create a colgroup and one col tag for each column - add the settings to the appropriate <col> tag, in sequence from left to right. Like most table structures, it is vital that the number of colgroups and <col> tags match the actual number of columns as defined by the later <td> tags. n.b.<col> style attributes apply to the column itself, not the content. i.e. you should not expect style attributes in <col> to affect the contents of the table cell (like text), only to the column structure itself - background colours and images. In this example, the first column takes up twice the space of the second, despite the content being a similar length in each case. Note how the background image, by default, is cropped and tiled (repeated) to fit the column without affecting the column dimensions.
<table>
<colgroup>
<col width="60%" style="background-color:yellow">
<col width="30%" style="background-image:url(../images/navbar.png);">
</colgroup>
<tr>
<td>cell 1, row 1, column 1</td>
<td>cell 2, row 1, column 2</td>
</tr>
<tr>
<td>cell 3, row 2, column 1</td>
<td>cell 4, row 2, column 2</td>
</tr>
</table>
This code generates the following table. (The border has been turned on to illustrate the rows, columns and cells.
| cell 1, row 1, column 1 | cell 2, row 1, column 2 |
| cell 3, row 2, column 1 | cell 4, row 2, column 2 |
See also: col
The use of tables to create multi-column text, captions and sidebars is now deprecated. Tags and attributes that support such non-tabular output may be dropped from the HTML standard and from browser support. Tables should only be used for tabular data. The <colgroup> tag provides control over the grouping of columns within a table.
Use col to control specific column widths and backgrounds. Use colgroup to control backgrounds for groups of adjacent columns with a single tag.
To make a group out of adjacent columns, create a colgroup and set the span attribute to the number of columns included within the group. Remember to include one col tag for each column within the group. Like most table structures, it is vital that the number of colgroups and <col> tags match the actual number of columns as defined by the later <td> tags. The <colgroup> tag has a required end tag </colgroup> n.b.<colgroup> style attributes apply to the column group itself, not the content. i.e. you should not expect style attributes in <colgroup> to affect the contents of the table cell (like text), only to the column structure itself - background colours and images. In this example, the first column group (which spans two <col> columns) displays a background image which, by default, is cropped and tiled (repeated) to fit the column without affecting the column dimensions. The second <colgroup> displays a background-color for the entire column group.
<table>
<colgroup span="2" style="background-image:url(../images/navbar.png)">
<col><col></colgroup>
<colgroup span="2" style="background-color:olive;">
<col><col>
</colgroup>
<tr>
<td>cell 1, row 1, column 1</td>
<td>cell 2, row 1, column 2</td>
<td>cell 3, row 1, column 3</td>
<td>cell 4, row 1, column 4</td>
</tr>
<tr>
<td>cell 5, row 2, column 1</td>
<td>cell 6, row 2, column 2</td>
<td>cell 7, row 2, column 3</td>
<td>cell 8, row 2, column 4</td>
</tr>
</table>
This code generates the following table. (The border has been turned on to illustrate the rows, columns and cells.
| cell 1, row 1, column 1 | cell 2, row 1, column 2 | cell 3, row 1, column 3 | cell 4, row 1, column 4 |
| cell 5, row 2, column 1 | cell 6, row 2, column 2 | cell 7, row 2, column 3 | cell 8, row 2, column 4 |
color attribute: Takes a colour name or a
hexadecimal
expression of the RGB value of the colour to be displayed. color="#00FF00" is green - FF = 255 or maximum, 00 is minimum. To make your HTML colours match colours used for graphics, use colour names in the HTML and match the RGB values in your graphic - this makes sure that the browser selects the intended colour from a limited Web palette, instead of making two separate guesses as to the closest colour to the specified RGB value and also avoids 'dithering' - the mixing of two colours using a grid pattern which makes graphics and text appear grainy.
Top
| Aqua #00FFFF | Navy #000080 | ||
| Black #000000 | Olive #808000 | ||
| Blue #0000FF | Purple #800080 | ||
| Fuchsia #FF00FF | Red #FF0000 | ||
| Gray #808080 | Silver #C0C0C0 | ||
| Green #008000 | Teal #008080 | ||
| Lime #00FF00 | Yellow #FFFF00 | ||
| Maroon #800000 | White #FFFFFF |
cols attribute: <frameset> tag. Specifies the size of
the vertical frames. See also rows.
<frameset cols="25%,100,*"> sets three columns, the first 25% of
the available screen area, the second precisely 100 pixels wide and the third
taking whatever remains of the available screen area. Take care with precise
values, you have no control over the screen area your visitor chooses to make
available.
Top
For extra flexibility, you can set style rules only if the element occurs in a specific context. The context can include any element or class:
element.classname element{setting:value;} e.g.
p.halfpara B {color:red;}
This rule means that if a bold tag occurs within a paragraph AND if the paragraph has the class selector "halfpara", then the tag contents items will be red instead of the default. contextual selector applied
default
Top
CSS see cascading style sheets.
Top