Never been to DZone Snippets before?

Snippets is a public source code repository. Easily build up your personal collection of code snippets, categorize them with tags / keywords, and share them with the world

« Newer Snippets
Older Snippets »
Showing 1-2 of 2 total  RSS 

Generic XHTML template

I'm often having to reconstruct this, as I can no longer memorize everything (just blank HTML and BODY tags used to be acceptable ;-)) with the DOCTYPE and namespaces.. so to make it easier to grab in future:

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

<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
	<head>
		<title></title>
		<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
		<link rel="stylesheet" href="styles.css" type="text/css" media="screen" />
		<script type="text/javascript" src="common.js"></script>
	</head>

	<body>
		<div id="container">

			<div id="header">
			</div>

			<div id="wrapper">
				<div id="main">
					
				</div>
			</div>

			<div id="footer">
			</div>
			
		</div>
	</body>

</html>

Making bordercolor work in FireFox / Mozilla

IE and Safari support the bordercolor attribute directly on TABLE elements which colors the external and internal borders. FireFox does not, but you can use standard CSS to fix it.

TABLE { border: 1px solid #eee; }
TABLE TD { border: 1px solid #eee; }


Unlike most solutions, this also correctly changes the color of the cell borders.
« Newer Snippets
Older Snippets »
Showing 1-2 of 2 total  RSS