HTML <!doctype html public ""> - html

One of the new doctype declarations can be specified as:
<!doctype html>
But recently I came across one which was slightly different (view source on http://html5boilerplate.com/):
<!doctype html public "">
But I couldn't figure what is it for, public part?
Thanks.

You missed one important character
<!doctype html public "✰">
Inside the quotes is a star character. They like putting it everywhere. Its valid but not in any way useful :P

this is mentioned in the html5boilerplate changelog, do a search for doctype on the page.
Its been done to disable dtd warnings in IDE's like eclipse.
See: Disable DTD warning for Ant scripts in Eclipse?

IE10 needs the PUBLIC "" to properly treat the page as HTML 5 - at least on the Windows 7 version.

Related

How to change the <!DOCTYPE> declaration from version HTML4.01 to HTML 5 in IntelliJ

When generating JavaDoc documentation in IntelliJ 2018.3.3 (Community Edition) I get this information
Constructing Javadoc information...
javadoc: warning - You have not specified the version of HTML to use.
The default is currently HTML 4.01, but this will change to HTML5
in a future release. To suppress this warning, please specify the
version of HTML used in your documentation comments and to be
generated by this doclet, using the -html4 or -html5 options.
At the moment the first statement of all generated HTML-files is:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
Therefore I changed the default HTML language level from HTML 4 to HTML 5 at
Project Settings - Languages & Frameworks - Schemas and DTDs - Default XML Schemas
In addition I looked at the project settings at
Editor - File and Code Templates - Default Scheme
There are templates for HTML and HTML4, but not for HTML5.
I wonder about how to change to the right version of HTML as required.
Thanks for your help!
As the message you've quoted says, you can specify the version of the HTML generated by JavaDoc by specifying the -html5 option. In IntelliJ IDEA, this option can be specified under "Other command line arguments:" in the Tools | Generate JavaDoc... dialog.
None of the other options you've tried to change have any impact on JavaDoc generation.

What is the <A W3MIRHREF> tag in HTML?

in a .html file I have found the following code:
<!DOCTYPE HTML PUBLIC "html.dtd">
<HTML>
<P><A W3MIRHREF="http://www.myCompany.org/division/subdivision/repec/handle/wpaper/wp-02-01.rdf" HREF="wp-02-01.rdf">wp-02-01.rdf</A></P>
</HTML>
What exactly mean the W3MIRHREF attribute? I never see it, I always say the classic tag
What is this? and for what is used?
Tnx
Andrea
This attribute is added to a link by w3mir utility:
w3mir is a all purpose HTTP copying and mirroring tool. The main focus
of w3mir is to create and maintain a browsable copy of one, or
several, remote WWW site(s).
This particular attribute is used to store a link to the original document.
The W3MIRHREF has no meaning in any HTML recommendation.
I'd speculate that it is a regular href attribute with a bunch of random characters prepended to it so that browsers will ignore it. i.e. w3mir is a pseudo-comment.

Modyfing code completion in PhpStorm 5

After entering first characters of <textarea> tag and using autocomplete ( e.g. <texta and hitting ENTER) editor generates following snippet: <textarea rows="" cols=""
It's extremely unhelpful since I don't use rows and cols attributes.
How can I modify those snippets ?
I tried "Live templates" section but it's not there.
In this case code completion is performed according to the DTD, which defines rows and cols attributes of the textarea tag as Required.
Most likely your file starts with:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
or the default HTML language level defines it.
To address this problem you can create HTML 5 files with <!DOCTYPE html> and PhpStorm will stop completing these attributes.
See also the related IDE setting:

é HTML Entity code in title tags

I'm trying to use the HTML entity code for 'é' in the title tags of my site, and it doesn't seem to be working in any browser. If I type the French equivalent of "Party:" in the title:
<title>parté</title>
I get parté in the title bar across all browsers when it renders. When I use the 'é' character, it actually works. Does anyone know what is up with this?
Entity references work fine (at least as fine as characters entered directly) in title elements. The problem is most probably caused by something that looks like an entity reference to an author when he looks at his files—the data that browsers get does not include it. Some software is used to generate the HTML document from some file that contains é but the software does not simply pass it forward but e.g. converts & to &.
This can be checked using View Source in a browser.
I tried
<!DOCTYPE html>
<meta http-equiv="Content-type" content="text/html; charset=utf-8">
<title>é</title>
<div>é</div>
and it works (FF13)

strange markup in HTML (HTML_ATR HTML_ELM, SYN_ROW, JS_KEY, etc..)

I've build a website for a client and as we all know 'it works just fine on my machine' :-) as it does on several machines at my clients location. But they have (so far) 3 pc's on wich some errors occur, like cannot find ElementById. These machines are normal up-to-date windows machines running IE8.
When comparing the html-source of the page on my machine with one of a machine on wich the error occurred I found that there seems to be a s--tload of html injected. Loads of DIVS and SPAN around attributes and elementID's and even javascript :
Normal:
<script type="text/javascript" language="JavaScript">
After injection:
script will be surrounded with a SPAN tag using class 'HTML_ELM'
type will be surrounded with a SPAN tag using class 'HTML_ATR'
"text/javascript" will be surrounded with a SPAN tag using class 'HTML_VAL'
<<span class="HTML_ELM">script</span> <span class="HTML_ATR">type</span>=<span class="HTML_VAL">"text/javascript"</span> <span class="HTML_ATR">language</span>=<span class="HTML_VAL">"JavaScript"</span>>
even ID's of html elements are surrounded with these SPAN tags (class='JS_STR') probably causing the problem of cannot find ElementById
I have no idea why this is happening, I also cannot find a cause on Google when searching for these weird classnames used by the injected SPAN/HTML tags (HTML_VAL, HTML_ELM, HTML_VAL).
Does anyone here know what could be causing this ?
many thanks,
Jurjen.
Well, since you are running IE8, are some of the machines in compatibility mode?
This extra code comes from the IE8 source viewer. In IE8, if you view source and go to the File menu there are two options under Save, HTML Source and Formatted HTML View. The Formatted HTML View contains all the extra code you are seeing.
Do your HTML files start with a valid DTD ?
like:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
Try running it through html-tidy.
An online tidier can be found at http://infohound.net/tidy/.
Then, it'll be easier to track down the problem. It sounds like malformed html.
Googling span class=HTML_ELM returns lots of results but they've got nothing much in common.
You don't have a syntax highlighter script (or something similar) running on the site by any chance?