How to open HTML file as words not codes using notepad++? - html

I have article saved as HTML Formula and when I open that article by notepad++, the notepad++ open the article as codes not as words like that
(<!DOCTYPE HTML PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" <meta HTTP-equiv="Content-Type" content=" text/html; charset=UTF-8" />

Notepad++ doesn't support visual editor for html files.
It's just a kind of source code editor something like visual studio code.
But you can see the html formula with dreamweaver, webstorm and so on since they support visual editor for html files.

Related

Flash (swf) can't play automatically in Google Chrome

My web site has got swf files where their heights are smaller than 298px and which are not auto-played in Google Chrome.
I tried autoplay=true, play=true, ... but with no success.
How can I play automatically those SWFs?
Example :
This is not possible in more and more browsers.
It's time to embrace HTML5 and re-write or convert your SWFs.
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"" http://www.w3.org/TR/html4/loose.dtd "><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"" http://www.w3.org/TR/html4/loose.dtd "><HTML>
<HEAD>
<TITLE></TITLE>
<META content="text/html; charset=iso-8859-1" http-equiv=Content-Type>
works for me, i think the issue is you have to work with html previous to html 5

HTML: How to initiate HTML document header

I am still pretty new to HTML and programming in general so this is more of a curiosity question but I am asking as I want to use it the right way.
Whenever I have to initiate an HTML document I start it as below and never observed any issues.
However, when I work in Adobe Dreamweaver and create a new document there it always shows me the below initiation.
Of course I can overwrite this but I would like to know what is the difference and when it would make sense to use any of Adobe's suggested attributes or to add something else to my first four lines.
Can someone help me with this ?
My current initiation:
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<!-- ... -->
HTML initiation shown in Dreamweaver:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<!-- ... -->
Many thanks in advance,
Mike
<!DOCTYPE html>
This is HTML 5. The current standard.
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
This is XHTML 1.0 Transitional. A standard from 2000 designed to combine the transition from HTML 3.2 (1997) to HTML 4 (1998) and XML (which never saw wide use, except while pretending to be HTML 4.
can you explain the single attributes that are different to mine and when it would make sense to use any of them ? Esp. regarding
"PUBLIC",
That isn't an attribute. The PUBLIC portion of a Doctype declaration tells the client where it can download the DTD. (As opposed to the SYSTEM portion which gives it an identifier that it can use to look it up from a local catalogue).
Browsers have never cared about DTDs.
"xmlns",
XML Namespace. It lets you distinguish between elements and attributes that have the same name but are from different specifications.
"http-equiv"
"This is equivalent to an HTTP header with this name"
It is largely a joke. Nothing really implements this except for the character encoding portion of the content-type header and HTML 5 gives much nicer syntax for specifying that.
"content".
The value of the above.
Your first declaration is a HTML5 declaration which is the current standard.
The declaration produces by Dreamweaver is a deprecated XHTML 1.0 Transitional declaration (maybe your Dreamweaver is not up-to-date ?).
See here for more information on doctype

Why XHTML markup does not generate parsing error?

I started learning the basics of HTML and I have studied differences between XHTML and HTML. I have noticed XHTML is much stricter. Consider below markup
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/TR/xhtml1" xml:lang="en" lang="en">
<head>
<title>Every document must have a title</title>
</head>
<body>
<b><p>hey</b></p><br>
</body>
</html>
I have not properly nested the tags and <br> is not properly closed in XHTML but it does not raise any parsing error and when I have saved the file as test.xhtml then it raised parsing error. So how to actually create XHTML files and also how to use XHTML in HTML5? and could anyone explain me that files saved with .xhtml are XHTML files and with .html are treated as HTML files?
Iam using google chrome. I understand the differences but unable to view practically in the browser. Could anyone help me figuring this out.
Most web browsers have XML and HTML parsers. These use different rules.
In general, the rules they follow are:
If the document has one of various XML content-types and the document in in the XHTML name space: Use the XML parser
If the document has a text/html content-type then use the HTML parser
If the document is loaded from a local file and has a .xhtml file extension, then treat it as having the content-type application/xhtml+xml
If the document is loaded from a local file and has a .html file extension, then treat it as having the content-type text/html

How do you embed an .epub in a web page?

Is there a viewer or plugin of any kind that would allow an .epub document to be viewable on a web page? A Google search turned up tons of installable epub viewing desktop software but I couldn't seem to find anything for embedding this format on a web page. Perhaps you folks have some insight into this?
epub files are just HTML/XML and CSS, so you could easily open the epub container (it's a zip), then parse the XML inside using a language like PHP.
It shouldn't be too difficult to do that.
The format looks like:
--ZIP Container--
mimetype
META-INF/
container.xml
OPS/
book.opf
chapter1.xhtml
ch1-pic.png
css/
style.css
myfont.otf
Here's an example of the content you might find in chapter1:
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
<head>
<meta http-equiv="Content-Type" content="application/xhtml+xml; charset=utf-8" />
<title>Pride and Prejudice</title>
<link rel="stylesheet" href="css/main.css" type="text/css" />
</head>
<body>
...
</body>
</html>
I'd suggest that this should in most cases be done with Javascript using a library like one of these How to read epub files using javascript

Is the "xmlns" in <html xmlns= ...> needed when the page is served as HTML 4.01?

I like to serve the page as HTML 4.01, because XHTML is not really taken as XHTML in some browsers anyway, but Facebook's OpenGraph meta tags requires:
<html xmlns="http://www.w3.org/1999/xhtml"
xmlns:og="http://ogp.me/ns#"
xmlns:fb="http://www.facebook.com/2008/fbml">
but since the DOCTYPE of the page is not XHTML, does it matter if the xmlns are there, and should the page be made into DOCTYPE XHTML instead?
(actually, if the page is HTML, the xmlns is kind of confusing, as it is not really XML, but the Facebook page doesn't talk about how to add the meta tags in a page that is HTML 4.01)
For HTML 4.01 Strict:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
For HTML 4.01 Trasitional:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
The xmlns stuff you see in the facebook example are XML namespaces and their purpose is to allow the developer to include custom tailored information to HTML documents.
Think of it like folders in a filesystem.
So when facebook declares:
xmlns:fb="http://www.facebook.com/2008/fbml"
They are defining a "folder" in which their custom tags/attributes/properties are stored, so:
<meta property="fb:admins" content="USER_ID"/>
...where the important part is "fb:admins" is the same as having this on your hard drive:
/fb/admins.txt
which contains the USER_ID value.
So it's just a way to keep data organized and separated.
Hope this clears things up for you.
It won't be valid HTML 4.01 if you add xmlns attributes, but it most likely won't affect the rendering.
I wouldn't use HTML 4.01 if I was you. HTML 5 is the new standard, and you should use it.
Those are XML namespace definitions they exist as a way to avoid collisions in XML element names.
Since this is facebook's protocol, they are the ones that define the namespaces.
It has "nothing" to do with how the page is served.