Jump to content

Do php includes have a top margin?


Zohia

Recommended Posts

Hi!
I'm trying to put together a layout I made and am using php includes for the menu. The menu is in flash.
I have a column for the logo and the menu (which, as I said, is inside an include) and it's as if the include has a top margin:
http://www.os3porquinhos.com/racas.php

I put a border around the logo image and the flash menu so you could see the blue area on top of the menu.
Any ideas on how to eliminate this blue area?

Joana
Link to comment
https://forums.phpfreaks.com/topic/24134-do-php-includes-have-a-top-margin/
Share on other sites

You need to revise your code.  The generated html for the page has two body openers, two heads, two doctypes and has code after the body closing tag, any or all of which will ruin the output.

It looks as though you have an include that has head and body tag openers and closers in it.  Think of "include" as being like copy/paste and obviously only needing to the content you want, not a complete stand-alone html file.
Yes, the idea behind include is.
If you have an include like
<?php
include './includes/general.inc.php';
?>
Inside it says.
<h3>Hello</h3>
<p>Hello how are you today.</p>
Then you include that into a page like this

<html>
<head>
<title>Hi</title>
</head>
<body>
<?php
include './includes/general.inc.php';
?>
</body>
</html>

If you go to the browser, and look at hte source you see

[code]<html>
<head>
<title>Hi</title>
</head>
<body>
<h3>Hello</h3>
<p>Hello how are you today.</p>
</body>
</html>
[/code]
See it simply cut's it into the text.
Include is the same thing for every language roughly.
It is just a way to insert text from another page.
That is the general idea.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.