Reputation: 6106
I have a php file on my test server, and it outputs the following:
There is some extra white space on the page, highlighted by the red box. Dev tools view: The extra whitespace is highlighted in the dev tools. File that is outputted: As you can see, all of the file is on one line.
Code:
<?php
header("Content-Type: text/html; charset=utf-8");
if(!isset($_GET['action']))
{
$_GET['action'] = "home";
}
echo("<!DOCTYPE HTML>");
echo("<html>");
echo("<head>");
echo("<title>Bug Tracker - ");
echo($_GET['action']);
echo("</title>");
echo('<link rel="stylesheet" href="common.css" />');
echo("</head>");
echo('<body>');
require("action.php");
echo("</body>");
echo("</html>")
?>
This happens in firefox as well.
Upvotes: 2
Views: 7704
Reputation: 31
In my CSS, setting the h1 margin to 0 fixed it for me.
CSS:
h1 {
margin:0;
}
Upvotes: 1
Reputation: 5963
You need to be more clear in what you want.
The white space in your browser is most likely due to action.php having white space in it. White space is only created because php prints HTML (or similar) to the browser. Remember that PHP runs server-side, so the browser doesn't actually download the php file, it only reads the HTML.
Check (or show us) your action.php file
Also try
echo "<h1 style='vertical-align:text-top;'>Bug tracker home page</h1>";
~ Dan
Upvotes: 0
Reputation: 21262
<h1>
tag usually has a default margin. Try to set h1 { margin:0 }
in your CSS.
Upvotes: 5
Reputation: 449
I believe a h1 tag always has margin top and bottom that is why you are seeing the white space. If you add a margin-top: 0 to the h1 then it will remove the space above.
Upvotes: 3