Das Spielfeld

Dieser Quellcode zeigt dir, wie du das HTML-<div>-Tag und CSS verwenden kannst, um ein Spielfeld mit drei Reihen und drei Spalten zu erzeugen.

<!DOCTYPE html>
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8"/>
<title>Tic-Tac-Toe</title>
<style>
.zeile div {
padding: 10px;
border: 1px solid black;
height: 30px;
width: 30px;
float: left;
}
.zeile {
clear: both;
}
</style>
</head>
<body>
Klicke hier, um Tic-Tac-Toe zu spielen!<br/>
<div>
<div class="zeile">
<div></div>
<div></div>
<div></div>
</div>
<div class="zeile">
<div></div>
<div></div>
<div></div>
</div>
<div class="zeile">
<div></div>
<div></div>
<div></div>
</div>
</div>
</body>
</html>
Copyright © 2008 Walker Books Ltd
Illustrations © Duncan Beedie
All rights reserved.