Html tips and basic knowledge for beginners.

Text Ads Only

Text Ads Only

336 x 280 Block ads
Here at Techteazer.com,we try our possible best of us, to make you have fun with your computer/ laptop, then, you will know that your computer pc/ laptop, can venture you of so many surprise's and some hidding trick's you might not know, that might interest you.


Hyper text mark-up language is a basic knowledge one should know, or inclined in. Hyper text mark-up language (Html), is the knowledge, one should interest/ engage itself in the activity, to enhance its coding skill’s in our everyday life.
 We have some brief of tips, to share with you (our follower’s, and reader’s), we promise to brake everything down to your understanding.

First of all, we start from;

1. Always close your Html tags.
When you type an opening Html tag (e.g.; <b>, <p>), always place the corresponding closing tag at the end for example:

<b> My favourite
Animals are horses and
Elephants. </b>.

<p>My favourite
Animals are horses and
Elephant’s. </p>.

 <h2>My favourite
Animal’s are horses and
Elephants. </h2>.

It will ensure that your Html pages, work properly on all browsers, and will help to prevent any strange problems occurring in your pages!

This is especially important with tags such as;
<div>, <span>,
<table>, <tr>
And <td>.

Some tags, that don’t have a corresponding closing tag, just use these tags on their own. Example’ include:

The <br> tag, is for creating line break’s.

The <img> tag is for inserting images.

With XHTML mark-up, you even have to close tags like; br, and img. You can do this in a short-hand way, by placing a “/” before the closing angle bracket (“>”), for example, <br>, and <img…/
>.

What is XHTML, and why is it good? In this article you explore the concept’s behind XHTML, and learn how it differs from regular HTML.
XHTML, first introduced in 2000, is billed as the Successor to HTML. It is short for Extensible Hyper-text Mark-up language. XHTML 1.0, is essentially a reworking of HTML 4 in XML. Extensible Mark-up language. as such, HTML 4, and XHTML 1.0, are very similar.

XHTML is stricter than regular HTML, as you’ll see in a moment. While this extra strictness requires a bit more effort, when creating XHTML pages, it does mean that, those pages are very easy for computer’s to read.
HTML, in contrast, is notoriously difficult for browser’s, to interpret, which is partly why no two browser’s, seen to display a web page in the same way!

? Advantage’s of XHTML.
XHTML offer’s many advantages over HTML. Here are a few important ones:

No more badly-written “tag soup” pages. XHTML ensures that your web pages are, well-formed.
This means that, the Mark-up contains no errors, or ambiguities, and is structured correctly.

XHTML pages are readable by more devices. Because, XHTML pages, are well-formed, they can be more easily read by simple browser’s, such as those in mobile phones, and PDA’s, as well as by standard HTML browser’s.

It’s easy to extract semantic information from XHTML pages.
As XHTML, is XML, it can be any XML parser, making it easy to automatically extract useful information from your XHTML pages.

It’s possible to add other XML content to an XHTML page.
By using XML namespace’s, you can “mix and match” plain XHTML with other XML mark-up for example, mathML, allowing you to produce rich, semantic web pages.

? Key differences between XHTML and HTML.
The current widely used version of XHTML, is version 1.0.essentially, it’s a stricter version of html 4.01.

The main differences between HTML 4.01, and XHTML 1.0, are as follows.

? XHTML documents must be well-formed.

Every XHTML page you create needs to be well-formed. This means that all elements in an XHTML page, must be closed, and properly nested. For example, the following mark-up, is valid XHTML, because, the “b”, and “I” elements, aren’t properly nested (their start, and end tags overlap), and the “p” elements, don’t have end tags:
<code/>
<p> the quick <b>brown<i>fox jumps
<p>Every good boy deserves fruit.

Here’s a corrected version that validate’s to ><HTML 1.0:

<code/>
<p>the quick <b>brown<i>fox jumps
<p>Every good by deserves fruit. <

All XHTML elements, must be closed; even example, you can’t write just <br> in XHTML; you have to write either <br></br> or more conveniently, <br/>. (the letter format, is known as Minimized tag syntax, and, is the preferred way, to write empty element’s, that is, element’s that don’t have an end tag in HTML).

Overlapping element’s such as; the “b”, and “I” example above, are also technically invalid HTML, although, they are tolerated by most browser’s. Non-closed tags, however, are perfectly legal in HTML 4.

? All XHTML element’s, must be written in lower case.

Unlike HTML tags, you must always use lower-case letters, when writing XHTML tags. This is due to fact that XML, is case-sensible. The following mark-up, in invalid XHTML:

<code/>

<p> this is invalid because there “I”. There is only a ‘p’ element. </p>

You should also use lower-case element, and attribute names in any css style sheets attached to your xhtml

? All attribute values must be quoted.

Html, allows you to specify numeric attributes without quotes. With XHTML, all attribute values must have quote’s around them, even numeric values:

<code/>

INVALID XHTML:
<tD COLSPAN=2>

VALID XHTML:
<tD COLSPAN= “2”>

? Attribute minimization, is not allowed.
In HTML, some attribute’s, are usually written without a corresponding value, for example:

<code/>

<input type= “checkbox” checked>
<option value= “fred” selected>

In XHTML, this is forbidden; all attribute’s, must have a corresponding value. Rewrite such attribute’s in XHTML as follow’s:

<code/>

<input type= “Checkbox” checked= “ch
<option value= “Fred” selected= “sel

? The id fragment identifier should be used, instead of name.
HTML, allows you to define a fragment (a section of mark-up), within the page, and create a link to it, as follows:

<code/>

<a name= “top”> </a>



<a href= “#top”> Top of page</a>

In XHTML, you should use the id attribute, instead of name. However, to ensure compatibility, with current browsers, it’s wise to include both id, and name attributes as follows:

<a id = “top”></A>

. . .

<a href= “#top”> Top of page </a>

(Name, is still allowed in XHTML 1.0, although, it’s deprecated).

? Ampersand’s (&) on their own, are not allowed.
In both XHTML, and HTML, the ampersand (&), is used to declare entities. For example, & copy; displays the copyright symbol (©), while &amp; display’s the ampersand itself (&).
Many HTML browser’s, interpret an ampersand on its own (&), as a literal ampersand. In XHTML, this is forbidden; if you want to indicate an ampersand, you must encode it as & amp;. This is true, even within URL’s, for examples.

<code/>

Invalid XHTML:
<a href= “/cgi-bin/script.cgi? name=

Valid XHTML:
<a href= “/cgi-bin/script.cgi? name=

? XHTML documents must contain certain items.
HTML 4, isn’t too fussy about exactly which element’s you include in your page. XHTML is somewhat stricter. All XHTML document’s, must contain, at an absolute minimum:

? A DOCTYPE declaration.
Currently, available XHTML 1.0 DOCTYPE’s are;
Xhtml1-
Strict,
Xhtml1-
Transitional,
And xhtml1-
Frameset.

? An html element.
This must also be the root (top-level) element.

? An XHTML name space declaration.
This must appear within the Html element.

For example, here is a minimal XHTML strict page template.

<code/>

<! DOCTYPE Html
Public “-//techteazer//DRD XHTML 1.0
http://www.techteazer.com/TR/xhtml1/

<html XMlns= “http://www.techteazer.com

<head>
<title></title>
</head>

<body>
</body>

</html>

Note; that, the head, title, and body element’s, are also required in this minimal document, because, they are required child element’s of the Html element.

We’ve covered the main difference’s, between XHTML, and HTML here. There are few more differences, most of them subtle, which will explore in future article.

You’ve now learned what XHTML is, and why it’s useful, and you’ve also taken a look at the key differences between XHTML, and HTML. Future articles in this series will show you how to build XHTML pages, and how to convert existing HTML pages, to XHTML. You’ll also take a look at some of the compatibility issues, surrounding XHTML, and how to overcome them.

Attention! It will be of our great joy, if you really enjoy this article. Why can’t you share it with your friend’s, close neighbors, for it to venture a great impact to many looking/ searching for it.

Your comment is highly needed!




























Text Ads Only
336 x 280 Block ads
Sharing Is Caring.

No comments:

Powered by Blogger.