top of page
Search
Writer's picturelinuxtech

How to make a simple chessboard using HTML


source code:

<html>

<head>

<meta charset="UTF-8">

<title>simple chessborad made by linux tech</title>

<style type="text/css">

.chessboard {

width: 640px;

height: 640px;

margin: 20px;

border: 25px solid #333;

}

.black {

float: left;

width: 80px;

height: 80px;

background-color: #999;

font-size:50px;

text-align:center;

display: table-cell;

vertical-align:middle;

}

.white {

float: left;

width: 80px;

height: 80px;

background-color: #fff;

font-size:50px;

text-align:center;

display: table-cell;

vertical-align:middle;

}

</style>

</head>

<body>

<div class="chessboard">

<!-- 1st -->

<div class="white">&#9820;</div>

<div class="black">&#9822;</div>

<div class="white">&#9821;</div>

<div class="black">&#9819;</div>

<div class="white">&#9818;</div>

<div class="black">&#9821;</div>

<div class="white">&#9822;</div>

<div class="black">&#9820;</div>

<!-- 2nd -->

<div class="black">&#9821;</div>

<div class="white">&#9821;</div>

<div class="black">&#9821;</div>

<div class="white">&#9821;</div>

<div class="black">&#9821;</div>

<div class="white">&#9821;</div>

<div class="black">&#9821;</div>

<div class="white">&#9821;</div>

<!-- 3th -->

<div class="white"></div>

<div class="black"></div>

<div class="white"></div>

<div class="black"></div>

<div class="white"></div>

<div class="black"></div>

<div class="white"></div>

<div class="black"></div>

<!-- 4st -->

<div class="black"></div>

<div class="white"></div>

<div class="black"></div>

<div class="white"></div>

<div class="black"></div>

<div class="white"></div>

<div class="black"></div>

<div class="white"></div>

<!-- 5th -->

<div class="white"></div>

<div class="black"></div>

<div class="white"></div>

<div class="black"></div>

<div class="white"></div>

<div class="black"></div>

<div class="white"></div>

<div class="black"></div>

<!-- 6th -->

<div class="black"></div>

<div class="white"></div>

<div class="black"></div>

<div class="white"></div>

<div class="black"></div>

<div class="white"></div>

<div class="black"></div>

<div class="white"></div>

<!-- 7th -->

<div class="white">&#9817;</div>

<div class="black">&#9817;</div>

<div class="white">&#9817;</div>

<div class="black">&#9817;</div>

<div class="white">&#9817;</div>

<div class="black">&#9817;</div>

<div class="white">&#9817;</div>

<div class="black">&#9817;</div>

<!-- 8th -->

<div class="black">&#9814;</div>

<div class="white">&#9816;</div>

<div class="black">&#9815;</div>

<div class="white">&#9813;</div>

<div class="black">&#9812;</div>

<div class="white">&#9815;</div>

<div class="black">&#9816;</div>

<div class="white">&#9814;</div>

</div>

</body>

</html>

5 views0 comments

Recent Posts

See All

HOw to make a simple login form using HTML.

source code: <html> <head> <title>Login Page</title> </head> <body> <form name="loginForm" method="post" action="login.php"> <table...

How to make a simple snake game using html

source code: <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8" /> <meta name="viewport" content="width=device-width,...

Comments


bottom of page