Appendix A: A sample style sheet for HTML 4.0

This appendix is informative, not normative.

The Base Style Sheet describes the typical rendering of all HTML 4.0 [HTML40]) elements visual UAs. The style sheet is based on extensive research on how current UAs render HTML, and developers are encouraged to use it as a default style sheet in their implementations.

The full presentation of some HTML elements cannot be expressed in CSS2, including replaced elements (IMG, OBJECT), scripting elements (SCRIPT, APPLET), form control elements, frame elements, and BR.

/* rendered CSS1-addressable elements and all applicable non-inherited
properties set to initial values and default display types */

A, ABBR, ACRONYM, ADDRESS, BDO, BLOCKQUOTE, BODY, BUTTON, CITE, CODE,
DD, DEL, DFN, DIV, DL, DT, EM, FIELDSET, FORM, H1, H2, H3, H4, H5, H6,
IFRAME, IMG, INS, KBD, LABEL, LI, OBJECT, OL, P, Q,
SAMP, SMALL, SPAN, STRONG, SUB, SUP, UL, VAR, APPLET, BASEFONT, 
B, BIG, CENTER, DIR, FONT, HR, I, MENU, PRE, S, STRIKE, TT, U {
	background: transparent;
	width: auto;
	height: auto;
	text-decoration: none;
	margin: 0;
	padding: 0;
	border: 0;
	float: none;
	clear: none;
	vertical-align: baseline;
	list-style-image: none;
	list-style-type: disc;
	list-style-position: outside;
	}	 

ADDRESS, BLOCKQUOTE, BODY, DD, DIV, DL, DT, FIELDSET, FORM, FRAME, FRAMESET
H1, H2, H3, H4, H5, H6, IFRAME, NOSCRIPT, NOFRAMES, OBJECT, 
OL, P, UL, APPLET, CENTER, DIR, HR, MENU, PRE {
	display: block;
	}

A, ABBR, ACRONYM, BDO, BUTTON, CITE, CODE, DEL, DFN, EM, IMG, INPUT, INS,
ISINDEX, KBD, LABEL, MAP, Q, SAMP, SELECT, SMALL, SPAN, STRONG, SUB, SUP, 
TEXTAREA, VAR, B, BASEFONT, BIG, FONT, I, S, STRIKE, TT, U { 
	display: inline;
	}

LI	{
	display: list-item;
	}

/* Don't display HEAD elements */
HEAD, LINK, META, PARAM, STYLE, TITLE  {
	display: none;
	}

/* Begin tree of inherited properties and cascades. */

BODY	{
	font-size: 1em;
	line-height: 1.33em;
	margin: 8px;
        /* background flush with initial containing block edge */
	background-position: -8px -8px; 
	word-spacing: normal;
	letter-spacing: normal;
	text-transform: none;
	text-align: left;
	text-indent: 0;
	white-space: normal;
	}

H1	{
	font-size: 2em;
	margin: .67em 0; 
	}

H2	{ 
	font-size: 1.5em;
	margin: .83em 0; 
	}

H3	{ 
	font-size: 1.17em;
	line-height: 1.17em;
	margin: 1em 0; 
	}

H4, P, BLOCKQUOTE, UL, OL, DL, DIR, MENU	{ 
	margin: 1.33em 0; 
	}

H5	{
	font-size: .83em;
	line-height: 1.17em;
	margin: 1.67em 0; 
	}

H6	{
	font-size: .67em;
	margin: 2.33em 0; 
	}

H1, H2, H3, H4, H5, H6, B, STRONG	{ 
	font-weight: bolder;
	}
	
BLOCKQUOTE	{ 
	margin-left: 40px;
	margin-right: 40px;
	}

I, CITE, EM, VAR, ADDRESS	{ 
	font-style: italic;
	}

PRE, TT, CODE, KBD, SAMP	{ 
	font-family: monospace;
	}

PRE	{
	white-space: pre;
	}

BIG	{ 
	font-size: 1.17em;
	}
	
SMALL, SUB, SUP	{
	font-size: .83em;
	}

SUB	{
	vertical-align: sub;
	}

SUP	{
	vertical-align: super;
	}

S, STRIKE, DEL	{
	text-decoration: line-through;
	}

HR	{
	border: 1px inset;
	}

OL, UL, DIR, MENU, DD	{
	margin-left: 40px; 
	}
	
OL LI	{
	list-style-type: decimal;
	}
	
OL UL	{
	margin-top: 0;
	margin-bottom: 0;
	}

UL OL	{
	margin-top: 0;
	margin-bottom: 0;
	}

UL UL	{
	margin-top: 0;
	margin-bottom: 0;
	}

OL OL	{
	margin-top: 0;	
	margin-bottom: 0; /* how far to carry such contextual declarations? Exhaustive list
		could be very long. */
	}

U, INS	{
	text-decoration: underline;
	}

CENTER	{
	text-align: center;
	}



/* Table element rendering behavior cannot be described completely in CSS1, 
yet the following declarations appear to apply. This section is likely to become
obsolete upon the deployment of a more comprehensive style sheet specification
for tables. */

CAPTION, COL, COLGROUP, LEGEND, TABLE, TBODY, TD, TFOOT, TH, THEAD, TR	{
	background: transparent;
	text-decoration: none;
	margin: 1px;
	padding: 1px;
	border: none;
	float: none;
	clear: none;
	}

TABLE, TBODY, TFOOT, THEAD, TR	{
	display: block;
	background-position: top left;
	width: auto;
	height: auto;
	}

CAPTION, LEGEND, TD, TH	{ 
	display: inline;
	vertical-align: baseline;
	font-size: 1em;
	line-height: 1.33em;
	color: black;
	word-spacing: normal;
	letter-spacing: normal;
	text-transform: none;
	text-align: left;
	text-indent: 0;
	white-space: normal;
	}

TH	{
	font-weight: bolder;
	text-align: center;
	}

CAPTION	{
	text-align: center;
	}


/* proposed default for HTML 4.0's new ABBR/ACRONYM elements */

ABBR, ACRONYM {
	font-variant: small-caps;
	letter-spacing: 0.1em; 
           /* This is almost facetious. Should they not have any
           default rendering? Uppercase transform? Not all languages
           distinguish between simple abbreviations and acronyms, and
           not all abbrev. should be capped. */ }

/* not part of the legacy browser default sheet, but an obvious enhancement */

OL OL LI	{
	list-style-type: lower-alpha;
	}
	
OL OL OL LI	{
	list-style-type: lower-roman
	}