Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <style>
- #herni_pole {
- margin-right: auto;
- margin-left: auto;
- width: 480px;
- height: 480px;
- border: 5px solid #000;
- }
- .bilej, .cernej {
- float: left;
- width: 60px;
- height: 60px;
- }
- .bilej {background-color: #fff;}
- .cernej {background-color: #000;}
- </style>
- <div id="herni_pole">
- <?php
- $vyska = 8;
- $sirka = 8;
- for($y=$vyska; $y>0; $y--) {
- for($x=0; $x<$sirka; $x++) {
- echo (($x+$y)%2==0) ? "<div class='bilej'></div>" : "<div class='cernej'></div>";
- }
- }
- ?>
- </div>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement