HTML Body is spaced?

So there is a spacing around the edges with the body, i have no idea why it has done this, here is my php / html code:

<html>
<head>
	<title>CSGODice.co.uk</title>
	<link rel="stylesheet" type="text/css" href="theme.css">
</head>
<body>
	<?php
	try {
		$user = "";
		$pass = "";
		$dbh = new PDO('mysql:host=;dbname=', $user, $pass);
		}
	catch (PDOException $e) {
		print "Error!: " . $e->getMessage() . "<br/>";
		die();
	}
	?>
<div id="header">
    <div id="navbar">
        <a class="nav1" href="/"><bold>HOME</bold></a>
        <a class="nav2" href="dice.php"><bold>DICE</bold></a>
        <a class="nav3" href="support.php">SUPPORT</a>
		<a class="nav4" href="https://steamcommunity.com/tradeoffer/new/?partner=208924206&token=RkdKXvNB" target="_blank">DEPOSIT (DO NOT YET)</a>
		<a class="balance" href="#">$0.00</a>
        <div id="steamLogon">
            <?php

                require 'steamauth/steamauth.php';

                if(!isset($_SESSION['steamid'])) {

                    loginbutton("small"); //login button

                }  else {
					include("steamauth/SteamConfig.php");
                    include('steamauth/userInfo.php'); //To access the $steamprofile array
                    //Protected content
					echo '<div class="dropdown">';
						echo '<div class="dropdown-toggle" href="#">';
							echo '<img src="'.$steamprofile['avatar'].'" height="30" style="border-radius: 100%;">';
						
							echo '<div class="dropdown-content">';
								echo '<a href="account.php"><div class="account">Account</div></a>';
								echo '<a href="'.logoutbutton().'"></a>';
							echo '</div>';
						echo '</div>';
					echo '</div>';
                } 
            ?>
        </div>
    </div>
    <div id="dicelogo">
        <a href="/">
            <img src="img/logo.png" alt="logo" id="logo"/>
        </a>
    </div>
</div>
<div id="btn-black">
	<div id="games">
	</div>
</div>
</body>
`

You will need to include the css for anyone to diagnose a display problem.

1 Like

This is what your HTML shows. We need to see the CSS and the <php> after it has been interpreted into HTML.

or a link to your test page.

<ot> </ot>

1 Like

It’s hard to second guess without full code but I assume you are not talking about the default margin/padding on the html /body element are you?

If so then set the defaults to zero:

html,body {margin:0;padding:0}

1 Like

This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.