|
| |
|
|
joy
Posts: 176 From: Gilbert AZ USA Status: offline
|
php include - extra space before included content? - 7/20/2008 22:46:58
I am using <?php include("inc-news.php"); ?> to include some content inside a div. All is well and looks great in firefox, but in ie7/windows it's adding a line of space before it puts my content in, almost like it's adding a <br />, which is shoving some of the content down out of its div. If I paste the exact same thing that's in the include file into the page, it all looks fine. I removed all spaces in the source and just have <div id="belownav"><?php include("inc-news.php"); ?></div> on the same line. There are no extra spaces in the inc-news file either - just the content. Anyone else have this problem? Any suggestions?
|
|
|
|
Tailslide
Posts: 6270 Joined: 5/10/2005 From: Out here on the raggedy edge Status: offline
|
RE: php include - extra space before included content? - 7/21/2008 2:28:22
Can you give us a link? There's nothing about includes as such that would cause this as the browser never actually sees the include, only the final code so it's likely to be to do with either incorrect markup in the include itself or the fact that IE7 will generate a greater margin or padding on a div by default. Generally I find it easier to globally reset all margins and padding at the start of a stylesheet - that way you can add it back in where required but everything starts off the same.
_____________________________
"My strategy is so simple an idiot could have devised it" Little Blue Plane Web Design | Blood, Sweat & Rust - A Land Rover restoration project
|
|
|
|
joy
Posts: 176 From: Gilbert AZ USA Status: offline
|
RE: php include - extra space before included content? - 7/21/2008 13:51:59
Yes, that's why I thought it was strange, too. The source looks fine. It's doing it on my windows vista with ie7, and I checked it in browsershots.org and it looks like it's doing the same thing in most ie versions. Maybe I do need to set all margins to 0 and see if that works. I'll try it later today. The really strange thing is that I've repeated everything on another page, except I put the <div> tags in the include file rather than including only the content inside the <div> tags on the main page, and it looks fine. Messed up version: www.mydog8it.com/reptiles.htm -news include file is inc-news.php with content only in it, navigation include is inc-nav.php, header includes are inc-banner.php and inc-pics.php...inc-footer.php Look at news here: www.mydog8it.com/silkie_chickens.htm -div tags are in the include file, inc-new.php on this page BTW, no making fun of the rest of the old site It belongs in the "my first website" thread (it really was) and has errors and ugliness all over, hence the re-design in process...You can make fun of my chickens, though.
|
|
New Messages |
No New Messages |
Hot Topic w/ New Messages |
Hot Topic w/o New Messages |
Locked w/ New Messages |
Locked w/o New Messages |
|
Post New Thread
Reply to Message
Post New Poll
Submit Vote
Delete My Own Post
Delete My Own Thread
Rate Posts
|
|
|