问题
I'm new to web development and I'm really stuck with this silly problem. When I insert php code before html code, something like this: <?php ...some code... ?><!doctype html><html>...
it creates extra blank space on top of my page and 'pushes' whole content down. Is it possible to somehow avoid creating that extra space? It also makes extra space if the php code is in body part of html, for example if it's in between two paragraphs it will create extra space between that two paragraphs.
Thanks for your answers!
回答1:
I guess this what happens
Your code like this
<?php
//your php code here
?>
<!DOCTYPE html PUBLIC "
You should have it like this
<?php
//your php code here
?><!DOCTYPE html PUBLIC "
来源:https://stackoverflow.com/questions/8045435/php-creating-extra-space-in-html-page