Weird Issue Causing Header to be dropped down on only 1 page - html

Check out http://cancerpreventionnetwork.org/participants.shtml and you can see that the header is dropped down on this page. If you click on any other page, the header is not dropped like that. I have tried everything and I can't figure out what is causing this.

When I check the page in Chrome with inspect element, I see an extra text node. I can't see it in the source, but maybe you can?

seems to me that it's the classic UTF8 BOM encoding problem
you need to check all your source files and make sure that they are not encoded using the BOM.
there are many ways to remove it. I use notepad++ but there might be an automated tool or some shell code to remove the BOM for multiple files
and also.. if you're including files (templates) make sure that they don't have white spaces or new lines after the ?>
Good Luck

Related

VS Code isn't recognizing html files

VS had suddenly stopped recognizing HTML files and it doesn't autocomplete tags or even show the syntax unless I manually input every single file name in it, I would really appreciate the help on any idea how to solve that Here is how it looks:
I have tried many things but nothing seems to work or help fix it
See if this solves the problem:
On the bottom right of the application, you should see something like this:
Click on the "Plain text".
Search HTML in the list and click it.
Then your HTML should turn colorful.

VS Code no longer recognising html files

For some reason when I try to create an html file vs code doesn't seem to recognize it and nothing html related works within it (autocomplete, etc). I'm not really sure where to go from here since VS code has been my go-to work environment.
Here's a picture of what it's saving the file as (usually the logo beside the file would look like this: <> ):
You should be able to just save it as html.
otherwise in the bottom right there is an option to change the language

Document header not evaluated below ie10

I have a Wordpress site and created a custom theme for it. The pure CSS and HTML test version (without making it an actual Wordpress theme) is displayed 100% correct.
As soon as I make it dynamic and create a WP theme, IE 10 is ok, but IE10 compatibility and below somehow evaluate my document head as part of the body. It is displayed in IE html view window like this:
'!!!' is my actual title. All the CSS and meta information should be before my title, and somehow the head ending metatag is not displayed but it is present in my html markup.
SourceCode view is displayed as:
Head ending and everything in place. However there are two leading whitespace before DOCTYPE declaration, I have no idea how they got there, cleaned up every possible place in my source files. If I copy and paste their value into notepad two question marks "??" are displayed instead of whitespace.
Have never seen anything like this before. Mozilla and Chrome are 100% ok.
In case anybody has the same problem I found the answer.
My page.php and functions.php file of the Wordpress theme was utf-8 encoded that sometimes puts leading whitespace in the source code. This was enough for IE. I made it ANSI encoded and now it is ok.

SunOne Webserver HTML Includes

I'm running a large site, one that has a nav bar at the top. Rather than change the 100+ html files each time we want to change one of the buttons in the top nav, we want to switch the navbar to be displayed using an include of some kind. I want these includes to work on both Firefox and IE, and I don't want to have to change the extensions of each file either.
So far I've tried:
Javascript read file - This works fine on firefox, but IE has file reading blocked it seems.
HTML include - So far only works if we change the extension to shtml
PHP include - I know you can set up apache servers to run php scripts within html, but I don't know how to make this happen in SunOne.
iframes - I had to block iframes in order to comply with security standards.
I'm more than open to suggestions I haven't considered, or ways to make the above attempts work. Any ideas?
Eureka! I've found it!
So rather than include the html, why not just include the javascript and css? Every page will include a .js and .css file. The css can set the image src, and in each image I can use "onclick" to tell it to execute a function in the .js file with a simple window.location. Voila! Two quick changes will change the whole site!
Thanks to Mr. Lister for the CSS idea. That set me on the path.

Generated HTML word document not displaying image correctly

I'm trying to add an image to a generated html word document that is embedded in a classic ASP page. The code looks something like this:
<%
Response.ContentType = "application/msword"
%>
<html xmlns:v="urn:schemas-microsoft-com:vml"
xmlns:o="urn:schemas-microsoft-com:office:office"
xmlns:w="urn:schemas-microsoft-com:office:word">
...
<v:shape id="_x0000_s1030" type="#_x0000_t75" style='position:absolute;
left:0;text-align:left;margin-left:0;margin-top:17.95pt;width:7in;height:116.85pt;
z-index:2;mso-position-horizontal:center;mso-position-horizontal-relative:page;
mso-position-vertical-relative:page'>
<v:imagedata src="http://xxx/image001.gif" o:title="image001"/>
<w:wrap anchorx="page" anchory="page"/>
<w:anchorlock/>
</v:shape><![endif]--><![if !vml]><span style='mso-ignore:vglayout;position:
absolute;z-index:0;left:0px;margin-left:0px;margin-top:24px;width:672px;
height:156px'><img width=672 height=156
src="http://xxx/image001.gif" v:shapes="_x0000_s1030"></span><![endif]>
The image URL is correct and can be viewed through a browser, however when the word document opens, the image has a red x, with the error message:
The image cannot be displayed. Your
computer may not have enough memory to
open the image, or the image may be
corrupted. Restart your computer, and
then open the file again. If the red x
still appears, you may have to delete
the image and then insert it again.
If i copy the html code and try to open the word document on my local machine, it displays the image correctly. It just doesn't work when retrieving the document from the server. This happens for any images I try to add. Is there another way to add images to html-generated word documents that can be output from an asp page?
Thanks.
Update:
Something that I've noticed is that when copying the word doc code from the asp page, pasting it into a file and renaming it as a word doc, I get this prompt when opening it:
Some of the files in this Web page aren't in the expected location. Do you want to download them anyway? If you're sure the Web Page is from a trusted source, click Yes.
If I click Yes, the image displays fine, if I click No, I get the same error as I described above. I'm thinking that because the word doc is coming from an ASP page, it is defaulting the security setting to not display external items. I've tried adding the site URL (it is a local intranet site) to my trusted sites and as a trusted location in word, but still no luck.
You could try removing the o:title tag. I've found that if that tag is there word tries to embed the image, but will only do so if it is in the proper location. By removing the o:title tag, word just treats it as a link.
Go into Options, Web Options (which might be under Advanced), uncheck "Rely on VML for displaying graphics in browsers"
Is all that code generated by Word 2007, or are you adding code by hand? It's interesting that the img tag doesn't have a slash to close it.
I know its a silly mistake, but did you make sure to put the image in the right place so that it can be accessed by the web page? If you just type in the http://xxx/image001.gif url into your browser, does the image appear? If not, I would say thats your problem.
Make sure the image's URL (location) is correct and add a slash.
If it still doesn't work, check if any other images from the same directory can display.
If they do then re-upload the image and try again.
If other images don't display and if you're sure that the URL is correct, then try editing the read permissions on the image directory and the images. I can't imagine that it could be caused by permissions though.
Unless there's a very specific reason to generate the HTML in MS Word, I'd advise you not to do it. Even for somebody who never saw HTML or CSS before, they're both very simple and tidy to learn and can produce much better results than MS Word.
Is Word 2007 allowed to access the internet? Maybe there's a firewall rule blocking it?
Replace the following line
"<v:imagedata src="............" o:title="image001"/>"
with simple a single line of code
"<img src="............"/>"
I am sure you will get the result.
I have checked it.