Skip to content

Instantly share code, notes, and snippets.

@blmarket
Created August 31, 2012 17:08
Show Gist options
  • Save blmarket/3555947 to your computer and use it in GitHub Desktop.
Save blmarket/3555947 to your computer and use it in GitHub Desktop.
css tiles
<html>
<head>
<style type="text/css">
table.tile {
position: relative;
padding: 0;
border-spacing: 0;
border: 0;
border-collapse: collapse;
}
table.tile th,tr,td { padding: 0; }
td {
display: block;
position: relative;
width: 32px;
height: 32px;
}
table.tile td.brown { background: url('wall.png') 0 0; }
table.tile td.green { background: url('wall.png') 0 -32; }
div {
position: absolute;
left: 0px;
top: 0px;
width: 32px;
height: 32px;
}
div.tree {
background: url('feat.png') 0 0;
}
div.blood {
background: url('feat.png') 0 -288;
}
</style>
</head>
<body>
<table class="tile">
<tr>
<td class="green"><div class="tree"/><div class="blood"/></td>
<td class="brown"></td>
</tr>
<tr>
<td class="brown"></td>
<td class="brown"><div class="tree"></div></td>
</tr>
</table>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment