![]() |
[Solved] Content from <Head> is inserted in <Body>. Why? - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20) +--- Forum: Archived General Discussion (https://forum.codeigniter.com/forumdisplay.php?fid=21) +--- Thread: [Solved] Content from <Head> is inserted in <Body>. Why? (/showthread.php?tid=37833) Pages:
1
2
|
[Solved] Content from <Head> is inserted in <Body>. Why? - El Forum - 01-21-2011 [eluser]Zefirs[/eluser] Hello, I hope you guys could help me (newbie), I have this weird problem. Here is the example view.php code-> Code: <html> When I inspect element in Firefox or Chrome or .. code is -> Code: <html> Why link or script parts are transfered in <body>? Only meta tag stays in head tag.. Solution! The cause - Im using notepad++ , default encoding is ASNI, but I needed UTF-8,I realized that when half php file was written already. I converted it to UTF-8, and then it happened. CSS from <HEAD> jumped in <BODY>, and other crazy things started. Do not convert encoding in Notepad++ if file is containing any information, use other editor than notepad++ to convert encodings ANSI -> UTF-8. Sorry for my bad English. [Solved] Content from <Head> is inserted in <Body>. Why? - El Forum - 01-21-2011 [eluser]RedIgniter[/eluser] I don't know if this may be the problem but try inserting title in your head tags by doing Code: <html> [Solved] Content from <Head> is inserted in <Body>. Why? - El Forum - 01-21-2011 [eluser]talldarkmystere[/eluser] If you're including your head as part of a sub-view that is then included in another template, be sure that you're using the TRUE flag to tell CI that it needs to process the sub template before passing it to the main one. Code: $headerdata['title'] = 'My Page Title'; Without the TRUE flag, the content will still be passed, but it will be thrown into the top of the page. [Solved] Content from <Head> is inserted in <Body>. Why? - El Forum - 01-21-2011 [eluser]Zefirs[/eluser] I have no templates, only one view. Problem is that only link and meta tags are somehow inserted in wrong place. [Solved] Content from <Head> is inserted in <Body>. Why? - El Forum - 01-21-2011 [eluser]talldarkmystere[/eluser] Did you try adding a new line between the <head> and <body> tags as suggested above? Is this a common problem with all pages served, or just CI backed ones? Also: You say that you're inspecting the element - Are you just viewing the source, or using a tool for inspecting elements? Sometimes tools like that can monkey with the code. See if you get the same problem just viewing your source. [Solved] Content from <Head> is inserted in <Body>. Why? - El Forum - 01-21-2011 [eluser]Zefirs[/eluser] I added new line - no changes. Problem is only with CI backed ones.. Inspecting element with chrome default element inspecting tool, and in firefox with firebug plugin. Source code is correct in all browsers, but when I inspect element it shows me this problem. Im using wampserver 2 and newest CI. Sent my friend the CI to test, he had the same issue. [Solved] Content from <Head> is inserted in <Body>. Why? - El Forum - 01-21-2011 [eluser]talldarkmystere[/eluser] So long as this does not effect regular source viewing, or page generation in the browser, I'd say just chalk it up as an oddity in the DOM inspector. In other words, nothing to worry about. I found it odd that it appeared to include the contents of the css file as well as placing it in the 'wrong' place - I have a feeling that it's showing you the source that's been interpreted by the browser in some funny way. [Solved] Content from <Head> is inserted in <Body>. Why? - El Forum - 01-21-2011 [eluser]InsiteFX[/eluser] Maybe you need a DOCTYPE! InsiteFX [Solved] Content from <Head> is inserted in <Body>. Why? - El Forum - 01-21-2011 [eluser]talldarkmystere[/eluser] [quote author="InsiteFX" date="1295664539"]Maybe you need a DOCTYPE! InsiteFX[/quote] Good idea, that. That could effect the results! [Solved] Content from <Head> is inserted in <Body>. Why? - El Forum - 01-21-2011 [eluser]talldarkmystere[/eluser] Code: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> |