Why there's 'This is not a zero-length file' in <head> - css

When I inspect a web page (even stackoverflow), I always see
<style type="text/css">/* This is not a zero-length file! */</style>
<style type="text/css">/* This is not a zero-length file! */</style>
(yes, twice) at the bottom of the <head> tag.
Google gives no answer about that...
Does it come from Chrome? What's the point?
Edit
Thanks the others for the answer. This code was generated by the Instant Translate Chrome extension.

Try disabling your extensions and see if it remains. If it disappears, try enabling your extensions one by one, to find the culprit.

Related

Google Chrome is not displaying chinese characters correctly

I am facing issues that Chinese characters are not displayed properly in chrome. Below is a screenshot of whats happening.
I am wondering is there any extensions that is causing this or its because my CSS / fonts are not coded well.
I really want to fix this via my code side. Is it possible?
EDIT: Some of the words show up while some did not.
I did add in the meta charset=UTF-8
EDIT2 : #torazaburo, showing you the code snippet. The problem is that firefox is able to display all the Chinese text!
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
</head>
<body>
<h1>My Website</h1>
<p>Some text...</p>
</body>
have you tried using meta charset
<meta charset="UTF-8">
It enables browsers to understand any language it can be chinese , Urdu , hindi any language which you will write.
I am wondering is there any extensions that is causing this or its because my CSS / fonts are not coded well.
It's unlikely that this has anything to do with an extension. It could be due to a font issue, but that's also relatively unlikely. Probably you have an encoding problem, so:
Make sure your file is saved in UTF-8.
Make sure the file is being served as UTF-8.
Specify the the <meta charset="UTF-8"> tag proposed in another answer.
Make sure you have fonts selected which can display Chinese.
See also the second answer to this question.

wordpress website display wrong in IE

I have wordpress website, and the homepage of this website display incorrect in IE.
I'm developer too, so I know I have to put doctype in the header to force IE display in standard mode. But when I use developer tool in IE, it's display the doctype stay inside body tag.
Here is my website: http://kidscare.edu.vn/
and the screenshot:
http://imageshack.us/f/546/kidcareiebug.png/
The weird thing is another page is display correct. I don't understand why this error appear.
this site is working perfect in all IE expect ie6 quirks mode, the prob is you are viewing this site in quirks mode,
For changing this mode alt+7 or press f12 than change the document mode to the standard one.
Please change this mode and this will work fine see my ss.
its how site will look in IE7+.
you can check these questions also :
How do I get IE9 to use standards compliant mode when developing on
localhost?
why am I triggering quirks mode in IE8?
You have two starting HEAD tags and one closing HEAD tag. There should be one starting and one closing HEAD tag on your page. Try removing one.
Oeps, I typed HEAD but meant HTML. There is a typo in the conditional statement at the end of the first line:
<!--[if !(IE 6) | !(IE 7) | !(IE 8) ]><!-->
<html dir="ltr" lang="vi-VI" xmlns:fb="http://www.facebook.com/2008/fbml" xmlns:og="http://ogp.me/ns/fb#" >
<!--<![endif]-->

Why is header's css not loading correctly on a specific page in IE?

The page not working in IE8 is http://gainntrain.com/shopping/index.php
It IS working chrome and firefox...
This page loads from CubeCart, but the page I edited to alter the skin http://gainntrain.com/shopping/skins/KitaBlue/styleTemplates/global/index.tpl
That page has the same problem in IE8
The thing I don't understand is that the same header works fine on other pages of the site in IE8
Changed the <header> and <nav> tags to divs with classes using the styles that the tags had and that seems to be handling it just fine so thanks for the answers!
Look at
Validator
and
Jigsaw
Notice that the only errors in Jigsaw are CSS3 rules.
I would suggest looking at the HTML because of this line in Validator's analysis of your page
Line 11, Column 107: end tag for "link" omitted, but OMITTAG NO was specified
…="http://www.gainntrain.com/site/css/style.css" type="text/css" media="screen">
✉
You may have neglected to close an element, or perhaps you meant to "self-close" an element, that is, ending it with "/>" instead of ">".
It looks like your document is using HTML5 features but is using an older doctype declaration. I would suggest changing:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
to:
<!doctype html>
<html>
That is as long as it doesn't break the site. :]
Try an online HTML validator on the output, like this one. If you choose the right validator, it's likely to be able to pick out the sticky bits that work better in some browsers than others. Sifting through code by hand to find a solution like this is difficult and time-consuming.

Internet Explorer 9 ignores my Stylesheet

I am currently setting up a new page and wanted to test it with the Internet Explorer (9). I thought it was not going to be a problem, because it does work with FireFox, Opera, and Chrome (newest Versions). However, the IE does not attempt to load my style sheet.
I already searched Google and stackoverflow for an answer, but nothing helped.
My page looks as follows:
<!DOCTYPE HTML>
<html>
<head>
<title>Hello World</title>
<meta charset="UTF-8">
<link href="css/main_styles.css" rel="stylesheet" type="text/css">
</head>
<body>
etc.
Any ideas?
Thanks for your help in advance!
PS: I validated the page and the css styles. No errors found.
Edit (July 2014):
Hey, I'm sorry I forgot to update this question for so long. The answer is simple. I had to put #charset "utf-8"; at the beginning of my stylesheet. That's all it took to make it work. Cheers!
Try changing the reference of the link: href="/css/main_styles.css" or href="../css/main_styles.css"
The most obvious possible cause I can think of for this would be that your server is providing the wrong mime type of the CSS file. It might be that IE is more picky about this sort of thing than the other browsers you've tested.
Check what the mime type is by checking the HTTP headers, either in one of the other browsers debugging tools or with an HTTP sniffing program like Fiddler.
Fiddler will also be good for sniffing exactly what is going on when you try to make the request using IE. Whether it's a mime type issue or something else, this will be the best way to find out exactly what's happening.
Finally, you could also try opening the stylesheet's URL directly in IE. That will prove that IE can access the URL.
Hope that helps.
We had this issue with Internet Explorer 11, it's weird but if you rename the stylesheet to anything without the word "style" it will start working!
This is only the case when the accessing the file local on a machine, on a web server it will work fine

Combining HTML docs with different charset

I saved a MS-Word Doc with the 'save-as' option of "Web Page, Filtered". I want to insert the HTML & CSS code that was generated inside an HTML5 document that has my header, menu, footer, etc. The first question is in regard to charset and header info:
MS-Word generated HTML (Saved as "Web Page, Filtered"):
<html>
<head>
<meta http-equiv=Content-Type content="text/html; charset=windows-1252">
<meta name=Generator content="Microsoft Word 12 (filtered)">
My HTML5 template:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
The main issue I see is the two different character sets (UTF-8 vs windows-1252). Additionally, I am guessing the meta tag "name=Generator content="Microsoft Word 12 (filtered)" will not be a problem and perhaps can just be removed (?).
I can sort out the CSS with one exception. I do not know what the '#' symbol means. Example:
#font-face
{font-family:"Book Antiqua";
panose-1:2 4 6 2 5 3 5 3 3 4;}
I looked through the document and do not see "font-face" IDs or classes. So I am guessing this might change all of the fonts in the document. This might be a problem (if true); as stated, the new document will have my menu, header, footer, etc.
You should not copy&paste anything that ms office pukes out into a website; mostly because your code becomes a big mess, and it will most likely only look right in IE. This just my experience after i got a lot "Your website is broken!!!" complains after someone pasted ms-word-"html" into joomla pages.
Anyway, charset on your website must be utf-8.
Your #font-face looks broken to me. I only know it in a slightly different syntax:
#font-face {
font-family: "Awesomefont";
src: url("fonts/awesome.ttf");
}
this alone wont do anything, until you apply "Awesomefont" somewhere else:
h1 { font-family: "Awesomefont"; }
Here is a set of PowerShell scripts that will clean Word-Filtered HTML and correctly tag super/subscripts about 95% of the time. (No, you can't get better than that, Word is made for print.)
https://github.com/suzumakes/replaceit
This also changes the characters that M$ barfs out in windows-1252 class to their appropriate UTF-8 counterparts. It removes all the styling and classes so that you can drop the HTML straight into your template with minimal fuss. Depending on how crazy the person who made your Word doc went with justifying text and funky layouts you may have just a few minutes of cleanup, or you may have to fix M$'s propensity to insert soft hyphens all over the place.
Instructions are there in the ReadMe and if you happen to encounter any additional characters that need to be caught or come up with any tweaks/improvements, I'd be happy to see your pull request.

Resources