30
HTML5 History HTML5 is a markup language, has been come into existence around January 2008. The two major organizations have been involved in developing of HTML5 since its initial time. One is W3C (World Wide Web Consortium) and the other one is WHATWG (Web Hypertext Application Technology Working Group). According to these organizations, they have been working on the HTML5 since initial time. So HTML5language is still under development. There is more about to come yet in HTML5. During the development of HTML5, It was announced that the HTML5 will reach the W3C recommendation till at the end of 2010. But the last call didn’t match till the target date. Now according to W3C the HTML5 will reach its full recommendation last by 2014. Where according to WHATWG the last call for HTML5 Specification was in October 2009. Then suddenly the amazing changes in decision the WHATWG started to work on envisioning development of HTML, and with abounding its HTML5 Project. Later in January 2011, it renamed the HTML5 Standard to HTML5. On 18 January 2011, the W3C introduced a logo to represent the HTML5 interest. While presenting its logo to publicly, W3Cannounced that, the logo can be used for general purpose. What is Html5 ?

HTML5 for beginners

Embed Size (px)

DESCRIPTION

first codes in HTML programming

Citation preview

Page 1: HTML5 for beginners

HTML5 HistoryHTML5 is a markup language, has been come into existence around January 2008. The two major organizations have been involved in developing of HTML5 since its initial time. One is W3C (World Wide Web Consortium) and the other one is WHATWG (Web Hypertext Application Technology Working Group). According to these organizations, they have been working on the HTML5 since initial time. So HTML5language is still under development. There is more about to come yet in HTML5.

During the development of HTML5, It was announced that the HTML5 will reach the W3C recommendation till at the end of 2010. But the last call didn’t match till the target date. Now according to W3C the HTML5 will reach its full recommendation last by 2014.

Where according to WHATWG the last call for HTML5 Specification was in October 2009. Then suddenly the amazing changes in decision the WHATWG started to work on envisioning development of HTML, and with abounding its HTML5 Project. Later in January 2011, it renamed the HTML5 Standard to HTML5.

On 18 January 2011, the W3C introduced a logo to represent the HTML5 interest. While presenting its logo to publicly, W3Cannounced that, the logo can be used for general purpose.

What is Html5 ?HTML5 is the newest version of Hyper Text Markup Language. The first web browser was introduced in 1993 and the name was MOSAIC. The development of MOSAIC was at theNCSA (National Center for Supercomputing Applications). Later it was discontinued to development on 7th of January 1997. Still the people were using the nonstandard version of HTML.

Page 2: HTML5 for beginners

The standard version came into existence in 1995, when HTML 2.0 was announced. Later after two years HTML 3.0 and after two years HTML 4.01 was announced. And still we are using the milestone of HTML 4.01.

The First Draft of HTML5 Was announced in January 2008. And amazingly HTML5 has a broad browser support. Though theHTML5 is still under developing phase. And a lot of organizations are working and planning for the development of HTML5.

We can’t expect the HTML5 may be the future of Web Designing, but we can say that this is the present of Web designing. Before the development of HTML5, we were in compulsion to work in Photoshop and Flash application, but with the development of HTML5, these affords has been reduced. Many more long script code can be done with a simple tagging. As we can use <details> and <summary> tag for show and hide function of Java Script. We need not to put a long affords to code this thing. Apart from this feature we can use the 3D image with <canvas>, the special designed paragraph with<article> and many more.

HTML5 New ElementsThe web, and the utilization of the web, has changed a considerable measure since 1999, when HTML 4.01 turned into a standard.

Today, a few components in HTML 4.01 are old, never utilized, or not utilized the way they were planned. Every one of those components are uprooted or re-composed in HTML5.

To better handle today's web needs, HTML5 has likewise included new elements for drawing representation, showing media content, for better page structure and better structure taking care of, and a few new APIs, for example, move and customize, get the land position of a client, store neighborhood information, and that's only the tip of the iceberg.

Page 3: HTML5 for beginners

Below is a quick reference of components that are new or have been reclassified in HTML5. For every component there is a short description, a link to the particular, and a browser support list has been given.

Semantic or Structural Elementso <article>

o The <article> element speaks to a part of a page that comprises of an independent arrangement in a report, page, provision, or site and that is proposed to be freely distributable or reusable, e.g. in syndication. This could be a gathering post, a magazine or daily paper article, a web journal entrance, a client submitted remark, an intuitive gadget or device, or any possible free thing of substance.

Source: w3.org Description

Supported Browser

9.0 4.0 11.1 5.0 6.0

o <aside>

o The <aside> element speaks to a segment of a page that comprises of substance that is tangentially identified with the substance around the <aside> element, and which could be viewed as partitioned from that substance. Such segments are regularly spoken to as sidebars in printed typography.

Source: w3.org Description

Supported Browser

9.0 4.0 11.1 5.0 6.0

Page 4: HTML5 for beginners

o <bdi>

o The <bdi> elements speaks to a compass of content that is to be secluded from its surroundings for the reasons of bidirectional content arranging.

Source: w3.org Description

Supported Browser

10.0 16.0

o <details>

o The <details> element speaks to an exposure gadget from which the client can get extra data or controls. This element shouldn't be used in footnotes. This element is used as the parent of <summary> element

Source: w3.org Description

Supported Browser

15.0 6.0 12.0

o <dialog>

o The <dialog> element characterizes a dialog box or window. The <dialog> element makes it simple to make popup dialogs and models on a website page.

Source: w3.org Description

Page 5: HTML5 for beginners

Supported Browser

6.0 Canary

o <figcaption>

o The <figcaption> element speaks to a caption or legend for a figure or image. This element is used with it's parent <figure> element.

Source: w3.org Description

Supported Browser

9.0 4.0 11.1 5.0 6.0

o <figure>

o The <figure> element speaks to an unit of substance, alternatively with a subtitle, that is independent, that is normally referenced as a solitary unit from the principle stream of the record, and that could be moved far from the primary stream of the archive without influencing the report's importance. This element is followed by it's child, <figcaption> element.

Source: w3.org Description

Supported Browser

9.0 4.0 11.1 5.0 6.0

Page 6: HTML5 for beginners

o <footer>

o The <footer> element speaks to a footer for its closest precursor segmenting substance or separating root element. A <footer> element normally holds data about its area, for example, who thought of it, connections to related records, copyright information, and so forth.

Source: w3.org Description

Supported Browser

9.0 4.0 11.1 5.0 6.0

o <header>

o The <header> element is a gathering of initial or navigational helps. A <header> element ordinarily holds the segment's heading (a h1–h6 element or a <hgroup> element), however can likewise hold other substance, for example, a list of chapters, an inquiry structure, or any applicable logo.

Source: w3.org Description

Supported Browser

9.0 4.0 11.1 5.0 6.0

o <hgroup>

o <hgroup> has now been removed from the HTML5 specification.

Page 7: HTML5 for beginners

The <hgroup> element is commonly used to gathering a set of one or more h1-h6 elements — to gathering, for instance, a segment title and a going with subtitle.

Source: w3.org Description

Supported Browser

9.0 4.0 11.1 5.0 6.0

o <main>

o The <main> element could be utilized as a compartment for the predominant substance of an alternate element. It speaks to its youngsters.

Source: w3.org Description

Supported Browser

4.0 11.1 5.0 5.0

o <mark>

o The <mark> element speaks to a run of content in one record marked or highlighted for reference purposes, because of its importance in an alternate setting.

Source: w3.org Description

Supported Browser

9.0 4.0 11.1 5.0 6.0

Page 8: HTML5 for beginners

o <menuitem>

o The <menuitem> element characterizes a command/menu thing that the client can conjure from a popup menu.

Source: w3.org Description

Supported Browser

8.0 (for context menus)

o <menu>

o The <menu> element represents a list or set of commands. On clicking the <menu> element the drop down or popup appears.

Source: w3.org Description

Supported Browser

8.0 (for context menus)

o <nav>

o The <nav> element speaks to a segment of a page that connections to different pages or to parts inside the page: an area with navigation joins. Not all gatherings of connections on a page need to be in a<nav> element just areas that comprise of real navigation squares are suitable for the <nav> element. Specifically, it is regular for footers to have an arrangement of connections to different key parts of a site, yet the footer

Page 9: HTML5 for beginners

element is more suitable in such cases, and no <nav> element is vital for those connections.

Source: w3.org Description

Supported Browser

9.0 4.0 11.1 5.0 6.0

o <rp>

o Ruby parentheses (<rp>), an element used to wrap opening and shutting enclosures around rt, ruby content. These are for client executors that don't help ruby content, so it bodes well when shown inline.

Source: w3.org Description

Supported Browser

5.5 15.0 5.0 5.0

o <rt>

o The <rt> tag characterizes a clarification or elocution of characters (for East Asian typography) in a ruby annotation. It comes after the base text it defines.

Source: w3.org Description

Supported Browser

5.5 15.0 5.0 5.0

Page 10: HTML5 for beginners

o <ruby>

o The <ruby> element permits compasses of stating substance to be stamped with ruby annotations. It is utilized for East Asian typography, to show the elocution of East Asian characters.

Source: w3.org Description

Supported Browser

5.5 15.0 5.0 5.0

o <section>

o The <section> element speaks to a bland archive or provision section… The <section> element is not a non specific compartment element. At the point when an element is required just for styling purposes or as a comfort for scripting, creators are swayed to utilize the <div> element. A general standard is that the<section> element is proper just if the element's substance would be recorded expressly in the record's framework.

Source: w3.org Description

Supported Browser

9.0 4.0 11.1 5.0 6.0

o <summary>

Page 11: HTML5 for beginners

o The <summary> element speaks to a summary, heading, or legend for whatever is left of the substance of the <summary> element's guardian <details> element, if any.

Source: w3.org Description

Supported Browser

15.0 6.0 12.0

o <time>

o The <time> element speaks to either a time on a 24 hour clock, or an exact date in the proleptic Gregorian datebook, alternatively with a time and a time-zone balance.

Source: w3.org Description

Supported Browser

9.0 4.0 11.1 5.0 6.0

o <wbr>

o The <wbr> element speaks to a line break good fortune. Any substance inside <wbr> elements should not be viewed as a feature of the encompassing content.

Source: w3.org Description

Supported Browser

3.0 11.7 4.0 1.0

Embedded Elements

Page 12: HTML5 for beginners

o <audio>

o An <audio> element speaks to a sound or audio stream.

Substance may be given inside the <audio> element. Client operators ought not demonstrate this substance to the client; it is expected for more established Web programs which don't help audio, so that legacy audio plugins could be attempted, or to show content to the clients of these more established programs illuminating them of how to get to the audio substance.

Source: w3.org Description

Supported Browser

9.0 3.5 10.5 4.0 4.0

o <canvas>

o The <canvas> element gives scripts a determination subordinate bitmap canvas, which might be utilized for rendering charts, amusement representation, workmanship, or other visual pictures on the fly.

Source: w3.org Description

Supported Browser

9.0 2.0 9.0 3.1 4.0

o <embed>

Page 13: HTML5 for beginners

o The <embed> element gives a mix point to an outer (normally non-HTML) requisition or intelligent substance.

Source: w3.org Description

Supported Browser

5.5 1.0 9.2 1.3 2.0

o <map>

o The <map> element, in conjunction with an img element and any zone element relatives, characterizes a picture map. The element speaks to its kids.

Source: w3.org Description

Supported Browser

5.5 1.0 9.2 1.3 2.0

o <math>

o The <math> element from the Mathml namespace falls into the implanted substance, stating substance, and stream content classes for the reasons of the substance demonstrates in this particular.

Source: w3.org Description

Supported Browser

Gecko

Page 14: HTML5 for beginners

o <source>

o The <source> element permits creators to tag different option media resources for media elements. It doesn't speak to anything on its own. It is used with <audio> and <video> tag.

Source: w3.org Description

Supported Browser

9.0 3.5 10.5 4.0 4.0

o <svg>

o The <svg> element from the SVG namespace falls into the installed substance, stating substance, and stream content classes for the reasons of the substance shows in this determination.

Source: w3.org Description

Supported Browser

9.0 3.5 10.5 4.0 4.0

o <track>

o The <track> element permits creators to point out unequivocal outer timed content tracks for media elements. It doesn't speak to anything on its own. This tag is often used with <video> tag.

Source: w3.org Description

Page 15: HTML5 for beginners

Supported Browser

10.0 31.0 15.0 6.0 18.0

o <video>

o A <video> element is utilized for playing videos or films, and sound documents with subtitles.

Substance may be given inside the <video> element. Client executors ought not indicate this substance to the client; it is proposed for more seasoned Web programs which don't help video, so that legacy video plugins could be attempted, or to show content to the clients of these more established programs advising them of how to get to the video substance.

Source: w3.org Description

Supported Browser

9.0 3.5 10.5 4.0 4.0

New Form Elementso <datalist>

o The <datalist> element speaks to a set of option elements that speak to predefined options for different controls. In the rendering, the <datalist> element speaks to nothing and it, alongside its youngsters, ought to be covered up.

Source: w3.org Description

Supported Browser

10.0 4.0 9.0 20.0

Page 16: HTML5 for beginners

o <keygen>

o The <keygen> element speaks to a key pair generator control. At the point when the control's structure is submitted, the private key is put away in the nearby keystore, and general society key is bundled and sent to the server.

Source: w3.org Description

Supported Browser

1.0 3.0 1.2 1.0

o <meter>

o The <meter> element speaks to a scalar estimation inside a known extent, or a fragmentary worth; for instance plate utilization, the significance of an inquiry result, or the division of a voting populace to have chosen a specific competitor.

Source: w3.org Description

Supported Browser

6.0 11.0 6.0 8.0

o <output>

o The <output> element speaks to the aftereffect of an estimation performed by the requisition, or the consequence of a client activity.

Page 17: HTML5 for beginners

Source: w3.org Description

Supported Browser

4.0 11.0 10.0

o <progress>

o The <progress> element speaks to the culmination progress of an undertaking. Progress may be either uncertain — importance it is vague the amount work stays before the undertaking is finished (e.g., the errand is sitting tight for a reaction from a remote host) — or a numeric esteem somewhere around 0 and a given greatest, expressly indicating the division of work that has so far been finisshed.

Source: w3.org Description

Supported Browser

10.0 16.0 11.0 6.0 8.0

The comment tag is utilized to embed comments in the source code. Comments are not shown in the programs.

<!-- -->You can utilize comments to clarify your code, which can help you when you alter the source code at a later date. This is particularly valuable on the off chance that you have a great deal of code.

Comments aren't shown in the program, they are essentially there for the software engineer's profit. Comments can support you, on the grounds that you can compose notes to yourself that clarify what the code does. This is particularly valuable when you have a great deal of code.

Page 18: HTML5 for beginners

In fact, the comments tag is not really a tag. It is basically an intends to furnish designers with an approach to comment their code without it being rendered on the page. In this manner, there are no traits accessible for the comments tag.

Here is the Syntax for COMMENT TAG1 <!-- -->

Below is complete syntax along with example12345678910111213141516

<!DOCTYPE html> <html>         <head>        <title>        Page title will go here        </title>    </head>         <body>    <!-- Code inside this tag, will not be rendered in the browser. -->    This is test page    </body>     </html>

The DOCTYPE announcement must be the exact first thing in your HTML report, before the html tag.

<!DOCTYPE html>The DOCTYPE announcement is not a HTML label; it is a guideline to the web program about what variant of HTML the page is composed in.

In HTML 4.01, the DOCTYPE affirmation alludes to a DTD, in light of the fact that HTML 4.01 was focused around SGML. The DTD points out the tenets for the markup dialect, so that the programs render the substance accurately.

HTML5 is not focused around SGML, and hence does not oblige a reference to a DTD.

Page 19: HTML5 for beginners

You'll note that its fundamentally less complex than most Doctypes that you've seen — and that was purposeful. A ton has changed in HTML5 trying to make it much less demanding to create a measures based site page, and it ought to truly pay off at last.

What's decent about this new DOCTYPE, particularly, is that all present programs (IE, FF, Opera, Safari) will take a gander at it and switch the substance into norms mode — despite the fact that they don't execute HTML5. This implies that you could begin composing your website pages utilizing HTML5 today and have them keep going for, quite a while.

On the off chance that nothing else, this ought to be a decent reason to look through the progressions in HTML5 and acquaint yourself with what's in the pipeline for programs.

Note: Always add the DOCTYPE revelation to your HTML archives, so that the program comprehends what kind of record to anticipate.

Here is the Syntax for DOCTYPE1 <!DOCTYPE html>

Below is complete syntax along with example123456789101112131415

<!DOCTYPE html> <html>         <head>        <title>        Page title will go here        </title>    </head>         <body>    This is test page    </body>     </html>

Well, now you are familiar with the HTML5 Dcotype declaration. This chapter will teach you the very second line and first active element, which is <html>.

Page 20: HTML5 for beginners

<html>HTML is an initial element of HTML5, which tells the browser that the file is written in HTML. And then after the browser behave with the file like HTML. The complete code of a file is wrapped within the HTML Tag.

Here is the Syntax for HTML Tag1 <html>

Below is complete syntax along with example123456789101112131415

<!DOCTYPE html> <html>         <head>        <title>        Page title will go here        </title>    </head>         <body>    This is test page    </body>     </html>

The HTML meta tag is utilized for proclaiming metadata for the HTML record.

<meta charset="UTF-8">Metadata can incorporate report portrayal, decisive words, creator and so on. It can likewise be utilized to revive the page or set treats.

The meta tag is set inside the head tag.

META CHARSET

The Meta charset quality indicates the character encoding for the HTML report.

Page 21: HTML5 for beginners

The Meta charset quality could be generally overridden utilizing the lang characteristic on any component.

The Meta charset quality is new in Html5, and replaces the requirement for:

<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">Tagging the character-set utilizing the http-equiv property is still permitted, however the new way obliges less code.

In principle, any character encoding could be utilized, however no program sees every one of them. The all the more generally a character encoding is utilized, the better the risk that a program will comprehend it.

Here is the Syntax for META Tag1

2

3

4

<meta charset="UTF-8">

<meta name="description" content="Put here your meta description." />

<meta name="keywords" content="Put here keyword sperated with comma." />

<meta name="author" content="html5andcss3" />

Below is complete syntax along with example1

2

3

4

5

6

7

8

9

10

11

<!DOCTYPE html>

<html>

    

    <head>

        <meta charset="UTF-8">

        <meta name="description" content="Put here meta description." />

        <meta name="keywords" content="Put here keywords" />

        <meta name="author" content="html5andcss3" />

        <title>Title Name will go here</title>

    </head>

    

Page 22: HTML5 for beginners

12

13

14

15

16

17

    <body>

    This is test page

    </body>

    

</html>

With reference of previous chapters you may have now familiar with HTML declaration, META Tag implementation and all about the HEAD part of HTML5. Now We will start from here about BODY Tag and its containing element. It's a humble request to the user that If you are at all new in website designing and want to learn a complete range of HTML elements, you can try it from any other resources. This tutorial will now start step by step learning of HTML5 Elements only.

<body> ..... </body>A BODY Tag is most required tag of HTML. It is defined after the head section of HTML. The all contents that are shown in the browser, is written in the <body>. It sends an information to the browser that what content has been defined for displaying in the browser.

Here is the Syntax for BODY Tag123

<body>    <!-- Start writing your content here --></body>

Below is complete syntax along with example12345678

<!DOCTYPE html> <html>         <head>        <title>        BODY Tag        </title>    </head>

Page 23: HTML5 for beginners

9101112131415

         <body>    <!-- Start writing your content here -->    </body>     </html>

The <article> tag indicates autonomous, independent substance. An article ought to bode well on its own and it ought to be conceivable to disperse it autonomously from whatever remains of the site.

<article> .... </article>Here is the Syntax for <ARTICLE> Tag

Supported Browser

9.0 4.0 11.1 5.0 6.0

1

2

3

4

5

6

7

8

9

10

11

12

13

<!DOCTYPE html>

<html>

    

    <head>

         <title>Title Name will go here</title>

    </head>

    

    <body>

        <article>

            <h1>Computer</h1>

        <p>An electronic device which is capable of receiving information (data) in a particular form and of performing a sequence of operations in accordance with a predetermined but variable set of procedural instructions (program) to produce a result in the form of information or signals.</p>

Page 24: HTML5 for beginners

14

15

16

17

18

    </article>

    </body>

    

</html>

STYLING OF HTML5 ARTICLEAlthough you won't be able to see any style or design with the <article> tag implementation, but this can be used for HTML5 standards, the proper SEO (search engine optimization) and better bots and machine readablity.

For better design and format of article element, you will have to use some css code also.

Page 25: HTML5 for beginners

DETAILED DESCRIPTION OF HTML5 ARTICLE ELEMENT

A ton of discussion have been since it's devlopment, however the <article> component has by one means or another got away from the magnifying instrument… up to this point! <article> is one of the new segmenting components. It is frequently befuddled with <area> and <div> however don't stress we'll clarify the contrast between these.

An unique and exact definition by W3C Specification

The <article> element represents a complete, or self-contained, composition in a document, page, application, or site and that is, in principle, independently distributable or reusable, e.g. in syndication. This could be a forum post, a magazine or newspaper article, a blog entry, a user-submitted comment, an interactive widget or gadget, or any other independent item of content.

Source: W3C SpecificationThe HTML <article> Element holds either genuine substance or holds a few diverse segment components or one or more<article> components inside it.

On the off chance that it holds <article> component inside it, the substance of the inward articles expected to be identified with the external article's substance.

The HTML aside Element speaks to a segment of a page that comprises of substance that is tangentially identified with the substance around it, which could be viewed as divided from that substance. Such areas are regularly spoken to as sidebars or as supplements. They regularly hold side clarifications, in the same way as a glossary definition; all the more approximately related stuff, in the same way as ads; the life story of the creator; or in web-requisitions, profile data or related online journal connections.

<aside> .... </aside><aside> is easy to use as long as we remember that it is just a html tag, importance we utilize it with respect to the significance of the substance it conveys, and never in regards to the visual part of the site - that part must be just done utilizing CSS

Page 26: HTML5 for beginners

Here is the Syntax for ASIDE Tag

SupportedBrowser

12345

<aside> <p>Your content goes here.</p> </aside>

Below is complete syntax along with example12345678910111213141516171819202122

<!DOCTYPE html> <html>         <head>         <title>Title Name will go here</title>    </head>         <body>         <article>            <p>Your content goes here.</p>                     <aside>            <p>Your content goes here.</p>            </aside>         </article>             </body>     </html>