EMPTY

The difference between HTML and XHTML

What is the difference between HTML and XHTML

Probably you have seen that a lot, when modifying or inserting new codes into your Blogger template, page element, or blog post, you may have seen error one of the messages: code could not be parsed, not well-formed, broken, the elements were not closed properly etc.

I know these errors can be really frustrating and really make you go mad but in fact these errors can be corrected if you understand the rules that must be adhered to in XHTML documents [ XHTML 1.0 Strict Document Type ]. Now, I willl explain some of the XHTML syntax & rules, so that you may resolve and troubleshoot the problems if these error messages should occur while you are trying to modify the codes *meaning the XHTML Template*.

XML - HTML - XHTML

I will try to keep this short so that you guys won't get confused but just so you understand about document type: when viewing the Page Source or the Source of your Blogger template, you should see this document type declaration at the top:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">

The terms: XML, HTML and XHTML refer to the markup language used to write the web pages and herewith I will give a short explanation:

HTML [ Hypertext Markup Language ], invented by Tim Berners-Lee, and used since the early days of internet - as most of you guys know about it.

XML [ Extensible Markup Language ] is a meta-language, used to create other markup languages. The traditional HTML was later recast to use the rules of XML and that resulted in a new XML application, called XHTML.

XHTML [ Extensible Hypertext Markup Language ] rules are strict, unforgiving and also conforming when attempting to modify the template & codes which would result in error messages as stated above.

What are these rules that Blogger People should take note of?!

1. Basic Rules of XHTML

- Use All Lowercase Tags
- Nest Elements Correctly
- Always UseEnd Tags
- End Empty Elements
- Use Quotes for Values
- Give Every Attribute a Value
- Use Code for Special Characters
- Use id instead of name
- Separate Styles and Scripts
- Ensure you follow those steps

All codes need to be in lowercase since XML is case sensitive, all the element keywords and attribute names used in XHTML should be in the lowercase. For example, the template code is not this:

<TITLE>Free Templates Blogger Tips and Tricks</TITLE>

but instead it should be like this [lowercase]:

<title>Free Templates Blogger Tips and Tricksc</title>

If you have noticed, the elements and attribute names between the < and > signs have to be in the lowercase. However, the value, which in this case is “Free Template Blogger Tips”, can be in the uppercase, lowercase, or mixed case.


2. Attribute values to be in quotation marks

All the attribute values have to be enclosed either in single or double quotation marks. The following example is not accepted by XHTML:

<div id=header-wrapper>
<a href=http://freetemplatesblogger.blogspot.com>The difference between HTML and XHTML</a>
<img src=photo.jpg/>
<table width=200 border=0 cellpadding=2>

Instead, single quotation as such:

<div id='header-wrapper'>
<a href='http://freetemplatesblogger.blogspot.com'>The difference between HTML and XHTML</a>
<img src='photo.jpg'/>
<table width='200' border='0' cellpadding='2'>

Or, double quotation as such:

<div id="header-wrapper">
<a href="http://freetemplatesblogger.blogspot.com">The difference between HTML and XHTML</a>
<img src="photo.jpg"/>
<table width="200" border="0" cellpadding="2">


3. Container elements must have closing tags

This is not acceptable:

<p>A paragraph

In XHTML, there must be a closing tag with a forward slash / at the end:

<p>A paragraph.></p>

Here are some other examples of the many non-empty elements that have opening and corresponding closing tags are:

<ul> ... </ul>
<li> ... </li>
<table> ... </table>
<h2> ... </h2>
<div> ... </div>
<span> ... </span>
<dt> ... </dt>
<dd> ... </dd>
<a href> ... </a>


4. Standalone elements to be closed

Some of the elements are empty or standalone. They do not have associated closing tags and common examples are:

<br>
<img>
<input>
<frame>
<hr>
<meta>
<link>

In XHTML, these elements must be terminated or closed. There are two ways to do that: One way to terminate the element is to put a forward slash / at the end like this:

<br/>
<img/>
<input/>
<frame/>
<hr/>
<meta/>
<link/>

The second way is to add a corresponding closing tag like this:

<br> ... </br>
<img> ... </img>
<input> ... </input>
<frame> ... </frame>
<hr> ... </hr>
<meta> ... </meta>
<link> ... </link>


5. Elements to be properly nested

The elements must be closed in the reverse order. This code is not accepted in XHTML:

<form><table> ... </form></table>

Why is it not accepted!? Simply because, it is improperly nested! As you notice, the form was created first followed by the table and to close them in the proper order, the table must be closed before the form:

<form><table> ... </table></form>


6. Document to have only one root element

In the XHTML document all the codes are nested between <html< and </html<. That's what you call a root element and all other elements or sub elements are in between. The document structure will look like this:

<html>
<head> ... </head>
<body> ... </body>
</html>


7. Attribute minimization is not allowed

In XHTML, all attributes should single or double quoated like this name="value". Even if the value is the same as the name, it cannot be minimized to one word. Here an two examples:

<textarea readonly>Hyperlink Code</textarea>

<textarea readonly="readonly">Hyperlink Code</textarea>


Conclusion

The next time you see an error message on your blog, take a look at your codes and see if it is well formed, well parsed, properly closed, etc. Troubleshoot the problem and try out the possible solutions as you have just learned (hopefully).

Blogger Help Facility

Are you a new Blogger User and you got really not much idea how things work?! No worrieeeeees dude that's why you are here :) so have a look around and you will find a lot of useful information/Wigets/TipsTricks/Tutorials etc.

By the way Blogger.com has got its own Help Support Facility where you can get some information about a lot of things!

Just got to this site http://help.blogger.com/

Good Luck


PS: If you got any questions, drop a comment!

How to install a Blogger XML Template

This is pritty easy! Make a BackUp of your current XML Template so in case anything goes wrong, you always can restore it back at any time.

So now, that's how it works - How to install a Blogger XML Template :




1. Download a Blogger XML Template you like










2. Save the XML file on you Desktop






















3. Go to Template - Edit HTML














4. Browse to the saved XML file and upload it

















5. Click Save Template








6. You Are Done!

How to install a Blogger HTML Template

This is pritty easy, to be honest with you but before you start to do any changes, it is very wise to make a BackUp of your current Template. That is in case anything goes wrong and you always can restore it back.

So now, that's how it works - How to install a Blogger HTML Template :




1. Download a Blogger HTML Template you like








2. Copy the Source / HTML Code
















3. Go to Template - Edit HTML














4. Click on Revert to Classic Template













5. Paste the code into the Template area
















6. Click Save Template Changes








You are all done now :) that was not that difficult, was it?!

Blogger XML Templates (New)

Blogger XML Templates is the latest updated Blogger version, which is much much better as the HTML version simply because it offers you a wide range of options - Widgets & Add ons & Page Elements etc - it is really cool.

To be honest, trying to make changes on the XML Template may be seen as too chaos and too complicated as a new User (without much of experience) but within a short time even you will get year head around.

Here is a small Introduction:

What is XML !?

XML (acronym: Extensible Markup Language)is a markup language for documents containing structured information - both content (words, pictures, etc.) and some indication of what role that content plays (for example, content in a section heading has a different meaning from content in a footnote, which means something different than content in a figure caption or content in a database table, etc.). Almost all documents have some structure.

A markup language is a mechanism to identify structures in a document. The XML specification defines a standard way to add markup to documents.

So XML is Just Like HTML !?

NO! In HTML, both the tag semantics and the tag set are fixed. An <h1> is always a first level heading and the tag is meaningless. The W3C, in conjunction with browser vendors and the WWW community, is constantly working to extend the definition of HTML to allow new tags to keep pace with changing technology and to bring variations in presentation (stylesheets) to the Web. However, these changes are always rigidly confined by what the browser vendors have implemented and by the fact that backward compatibility is paramount. And for people who want to disseminate information widely, features supported by only the latest releases of Netscape and Internet Explorer are not useful.

XML specifies neither semantics nor a tag set. In fact XML is really a meta-language for describing markup languages. In other words, XML provides a facility to define tags and the structural relationships between them. Since there's no predefined tag set, there can't be any preconceived semantics. All of the semantics of an XML document will either be defined by the applications that process them or by stylesheets.

Why XML !?

In order to appreciate XML, it is important to understand why it was created. XML was created so that richly structured documents could be used over the web. The only viable alternatives, HTML and SGML, are not practical for this purpose.

HTML, as we've already discussed, comes bound with a set of semantics and does not provide arbitrary structure.

If you are intrested to know more, go to: http://www.w3schools.com/xml/

Blogger HTML Templates (Classic)

Blogger HTML Templates, is also known ans Blogger Classic Templates, is the first Blogger version - which then got updated to Blogger XML. The HTML Templaces are quite easy to modify (when having a bit of HTML & CSS knowledge) but no worries if you got no clue what I am talking about then keep reading!

First, let me give you a small clue about HTML and CSS ... ready?!

PS: Those who know this all - please skip this painfull readin lol

HTML, an initialism of Hypertext Markup Language, is the predominant markup language for web pages. It provides a means to describe the structure of text-based information in a document — by denoting certain text as headings, paragraphs, lists, and so on — and to supplement that text with interactive forms, embedded images, and other objects.

HTML is written in the form of labels (known as tags), surrounded by angle brackets and can also describe, to some degree, the appearance and semantics of a document, and can include embedded scripting language code which can affect the behavior of web browsers and other HTML processors.

Once again: What is HTML !?

- HTML stands for Hyper Text Markup Language
- An HTML file is a text file containing small markup tags
- The markup tags tell the Web browser how to display the page
- An HTML file must have an htm or html file extension
- An HTML file can be created using a simple text editor

What the F*** - Tags !?

Tags are labels you use to mark up the begining and end of an element. All tags have the same format: they begin with a less-than sign "<" and end with a greater-than sign ">".

Generally speaking, there are two kinds of tags - opening tags: <html> and closing tags: </html>. The only difference between an opening tag and a closing tag is the forward slash "/". HTML is all about elements and YOU label content by putting it between an opening tag and a closing tag.

To learn HTML is to learn and use different tags...

What is CSS !?

CSS (acronym: Cascading Style Sheets) is a style language that defines layout of HTML documents. For example, CSS covers fonts, colours, margins, lines, height, width, background images, advanced positions and many other things.

HTML can be (mis-)used to add layout to websites but CSS offers more options and is more accurate and sophisticated - PLUS - is supported by all browsers today :D

Which benefits will CSS give to You !?

CSS was a revolution in the WWW and the benefits include:

- control layout of many documents from one single style sheet;
- more precise control of layout;
- apply different layout to different media-types (screen, print, etc.);
- numerous advanced and sophisticated techniques.

Ohh no no no, hold on dude... this is not it!
There is a lot more to know & to learn, so if you want to get into it then go to: http://www.w3schools.com/html/html_intro.asp and learn something.

If you got any questions, drop a comment :)