Showing posts with label HTML5. Show all posts
Showing posts with label HTML5. Show all posts

Saturday, June 21, 2014

Using HTML5 semantic tags (Part 3) : section, mark, time


Good day everyone! this is Part3 of sematic tag tutorials for beginners, before moving on we would like you to go through the Part1 & Part2 of this tutorial for better understanding. In this Part 3 of our semantic tags tutorials we are going to show how to define different sections of a webpage using <section> tag, and how to highlight text using <mark> tag & defining timings using <time> semantic tags.

<section> : <section> semantic tag is used to define different sections of your page. For example imagine a webpage with few parts like login part, article part, community follow part, subscription part etc. now these different parts which contributes to your webpage are different sections of your web page which were earlier grouped using <div> tags without any definition to what it was can now be grouped using <section> tags for each different sections. Although you will use <article> tag or any other semantic tag to define the specific contents but still each specific content is a part of your page and so each part will go inside the section tag and also a webpage can have any number of sections. Look at the example below :

     <body>
       <section>
          <header>
             <img src='logo.jpg'></img>
             <p>Contact Us</p>
          </header>
       </scetion>
       <section>
          <main>
             <section>
                <article>
                     --- article goes here ---
                </article>
             </section>
          </main>
       </section>
     </body>

<mark> : <mark> semantic tag is a very simple definitive tag used to highlight text in webpages. Look at the example below:

    <body>      
       <p>
         <mark>Eifel Tower</mark> is in <mark>Paris</mark>
       </p>
    </body>

<time> : <time> semantic tag is also a very simple definitive tag used to define time and dates in webpages. <time> can not only be used to time & date like "12:00" , "2014-02-12" but can also be used to define words that relates to time & dates like for example "tomorrow" , "yesterday" , "2 hours" etc. The datetime attribute of <time> tag is used to define a specific time or date to the related words. Look at the example below :

    <body>
         <p>
            I am going to paris tomorrow for a seminar
            on HTML5 at <time>12:00</time>
         </p>
         <p>
            I am going to my native place
            <time datetime="2014-06-25">tomorrow</time>.
         </p>
    </body>


We hope you liked this post if you did make sure you share it with your social networks.

Happy Designing !

Friday, May 16, 2014

Using HTML5 semantic tags (Part 2) : aside, nav, main


Good day everyone! this is Part2 of sematic tag tutorials for beginners, before moving on we would like you to go through the Part1 of this tutorial for better understanding. In this Part 2 of our semantic tags tutorials we are going to show how to use & define your related, navigation and main contents using <aside>, <nav> and <main> semantic tags.

<aside> : aside semantic tags in HTML5 is used to define contents that are not part of your article or page but are still related to them. Mostly all designers think of aside as an element to design the sidebar which is not the perfect way to use <aside> but still you can use it for sidebar. The best example for the use of <aside> is to provide article, post or page's author information as it is no part of the article or post but still is related to it. You can notice in the left side of this page which you are viewing right now contains the information of the author of this blog which is something not a part of this post but still is related to it providing you with the information bout the author, this is where you can use the <aside>. Look at the example below :

    <body>
            <aside>
               <h3>About Me</h3>
               <p>I am a designer based in San Francisco</p>
            </aside>
    </body>

<nav> : From the name itself we guess that you have guessed this tag's use. The <nav> tag is a very simple tag of HTML5 which is used to define any type of navigations on your web page.
The use is very simple just enclose your entire navigation markup tat you previously created inside your <nav> and you are done. Anyone looking at your markup even a naive can make out that it is your navigation. If a naive can make out then why not the smart search engines. Look at the example below:

    <body>        
        <nav>
          <ul>
            <li><a href="www.google.com">Google</a></li>
            <li><a href="www.yahoo.com">Yahoo</a></li>
            <li><a href="www.msn.com"></a>MSN</li>
          </ul>
        </nav>
    </body>

<main> : The <main> is used to define the main part of your web page. It can contain any number of contents which we will make the main part of your page. Unlike other tags the <main> tag can be used only once in a document with contents representing the main items, this can even be your articles part contained inside your <main> tag. Look at the example below :

    <body>
         <main>   
            <article>
               <h1>Introduction to semantic tags</h1>
               <span>Sematic tags are
               used to define content in HTML5</span>
            </article>
         </main>
    </body>


Click here to view the demo example. You can also download it by clicking the below link:

Download

We hope you liked this post if you did make sure you share it with your social networks.

Happy Designing !

Saturday, May 10, 2014

Document Type Definition in HTML5


Hello everyone! in today's post we are going to discuss about the changes to "document type definition" declaration in HTML5. As you all may know prior to HTML5 i.e in HTML 4.01 declaring the type of document was a hectic task as it was very lengthy and had multiple types like ("transitional","strict","frameset") depending on what we are building. The declaration for these three types are given below:

Transitional :

  <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" 
  "http://www.w3.org/TR/html4/loose.dtd">

Strict :

  <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" 
  "http://www.w3.org/TR/html4/strict.dtd">

Frameset :

  <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Frameset//EN" 
  "http://www.w3.org/TR/html4/frameset.dtd">

As you can see the above document type declarations from version 4 of HTML is quiet tricky and very much time consuming proccess. But with the rise of HTML5 it brought with it a new dawn of ease for declaring your document type definition. Just look at the below HTML5 code for declaring document type and you just compare both the versions,

The one and only document type declaration

  <!DOCTYPE html>

We guess till now you must have compared both the version of document type declaration and understood the difference in power and ease of use. In HTML5 just 1 declaration covers every aspect and type of documnet, thats the power of HTML5.

Hope you liked our post if you did please link this post to you blog our website and do comment.

Happy Designing !

Tuesday, May 6, 2014

Using HTML5 semantic tags (Part 1) : header, footer, article.


Good day everyone! In this post we are going to introduce you to the semantic tags. Prior to HTML5 we lacked the ability to define our contents completely for every now and then we relied on <div> tag to group our content. It was good to group our content but lacked the ability to define contents which made a big confusion for web crawlers to search for a content and even developers and designers found it hard to identify and maintain a particular contents.
However, the new HTML5 has introduced several semantic tags to define our contents and in this part 1 of our semantic tags tutorials we are going to show how to define your header, footer and article contents using <header>, <footer> and <article> semantic tags.

<header> : header semantic tags in HTML5 is used to define & group header contents. All you have to do is whatever header contents like name of the site, logo, slogan etc that you were previously grouping under the <div> group it under the <header> element. This will clearly specify that the contents are header contents. Look at the example below :

    <body>
            <header>
               <img src="logo.jpg"></img>
               <span id="slogan">All good</span>
            </header>
    </body>

<article> : Now this is the tag we really wanted "the article semantic tag". Article semantic tag is used to define articles and posts on our blog or website. This tag can be very useful as unlike header and footer there can be multiple articles on page or website. This tag clearly specifies and define its contents. It is very useful to you and web crawlers. Look at the example below:

    <body>
            <header>
               <img src="logo.jpg"></img>
               <span id="slogan">All good</span>
            </header>
        
            <article>
               <h1>Introduction to semantic tags</h1>
               <span>Sematic tags are
               used to define content in HTML5</span>
            </article>
    </body>

<footer> : Unlike the header tag footer semantic is used to define and group footer contents that can be the copyright information of your site, contacts, recent links, Quick links etc. Use footer tag to specify and group all these footer contents. Look at the example below :

    <body>
            <header>
               <img src="logo.jpg"></img>
               <span id="slogan">All good</span>
            </header>

            <article>
               <h1>Introduction to semantic tags</h1>
               <span>Sematic tags are
               used to define content in HTML5</span>
            </article>

            <footer>
                  copyright © 2014
            </footer>
    </body>

So don't you think the new HTML5 tags are worth using, yes it is as it makes things a lot more easier for designers as well as for the search engines. So keep practicing and after that you can read partII of this article. We hope you liked this post if you did make sure you share it with your social networks.

Happy Designing !

Monday, April 21, 2014

Understanding HTML5 tags & attributes


Hello everyone ! in this post we are going to help you understand how to use HTML5's tags & attributes so that you can easily kick start your HTML5 tutorials and easily follow our future articles & tutorials or any other tuorial you will find on the net. OK, this post is going to be the easiest one as almost all the rules & syntax are the same except some minor changes and believe us these minor changes will make your HTML writing even easier and less time consuming. So let's start with the changes made to some tags in this latest version of HTML :

  1. Document type definition : Do you guys remember the document type definition in the previous version of html i.e, HTML 4.01 ? I know you don't, you only remember that it was long, ugly & very much time consuming. Well put all that memories into a trash because HTML5 has completely replaced & redesigned the old doctype definition into a new doctype definition tag given below :

       <!DOCTYPE html>

    yes that's all guys what we have to do to define our document type. Isn't it easy, short, beautiful & very much time saving.
  2. <script> tag : The declaration syntax of script tag to attach external scripts to html has been choped a little and made little more time saving. The previous syntax wanted you to include the following attributes : "type" & "src" for perfect declaration but HTML5 has removed the "type" attribute from declaration as it is automatically detected and you can now write your script tag declaration as below :

       <script src="D:\abc.js"></script>
  3. <link> tag : Same syntax changes have been made to the link tag as well. The previous syntax wanted you to include the following attributes : "rel" , "type" & "href" for perfect declaration but HTML5 has removed the "type" attribute from declaration as it is automatically detected and you can now write your link tag declaration as below :

       <link rel="stylesheet" href="D:\abc.css"></script>

Ok that's all with changes to tags now let us look at the changes to syntax rules :


  1. Case-Insensitive : HTML5 is case-insensitive i.e, you can use any type of case for tag names & attributes, you can use upper, lower & even mix them as per your convenience like below :

       <HTML>
    
          <head></head>
    
          <Body BGCOLOR="green"></Body>
    
          <a Href="www.google.com">google</a>
    
       </HTML>
    
  2. Quotes are optional : The basic syntax rule that has been around for years that every attribute value must be quoted has been replaced with no quotes by HTML5 i.e, there is no more need to provide quotes for attribute values with 1 exception that every attribute value containing { > , < ,  , = , ' , " } must be quoted. The correct & incorrect attribute syntax are given below :

       Correct Syntax                     Incorrect Syntax
     
       <div id=hello world></div>        <div id=blah blah></div>
       <div id="hello'eorld"></div>       <div id=blah'blah></div>
       <div id=hello&gt;world></div>      <div id=hello>world></div>
       <div id="hello=world"></div>       <div id=hello=world></div>
       <div id='hello'world'></div>       <div id=hello'world></div>
       <div id='hello"world'></div>       <div id=hello"world></div>
    
  3. Attributes values are optional : There are some attributes in HTML5 that does not require a value they are called empty attributes in HTML5. For example look at theexample given below :

      <video src="videofile.mp4" controls>
      </video>
    

    Notice the control attribute above which indicates whether or not the video controls should be visible. It by default means "true". i.e, the controls should be visible. There are many more attributes like this which you will come to know in our future articles.
  4. Closing Empty tags are optional : HTML5 makes it optional to close the tags without contents i.e, you no more have to waste your time by closing all the tags with no body contents. For example look below :

      <hr>
      <br>
    
Ok guys that's it and now you are ready to advance in HTML5 as your are clear with all the basic things. To learn more about HTML5 continue to follow our posts. You can also validate your HTML5 pages by going to this link http://validator.w3.org/ an uploading your code and then clicking on validate.

We hope you liked our post, please visit again and share our post with your social network.

Happy Designing !

Saturday, April 19, 2014

Introduction to HTML5




HTML or Hyper Text Markup Language as you all know is a markup language used to create a well structured layout for a web page, it came into existence in 1999 since then the internet has changed significantly. But still designners all over the world noticed that something was missing and incomplete but managed and got seasoned by using third party software and tools. Some of the noticeable demerits of html4 were :

  • lengthy document type definitions (difficult to memorise)
  • lack of ability to play sounds & videos without 3rd party plugins (adobe flash, shockwave etc etc)
  • lack of ability to draw vector graphics (but managed by using 3rd party drawing tools & embedded it into HTML file)
  • fewer semantic tags (using the same tags for article, address, header, footer etc etc. for eg: <div> making it difficult to define a particular content)
  • and many more......

You all may be thinking so many missings but still we were structuring our web pages using HTML to be precise HTML 4.01 that was all because we were bound to use what was there and what was available to us. But don't worry gone are the days of limitations as something new has emerged HTML5.

Yes HTML5 ! a new behaviour, name & power for our old markup language. HTML5 which is the latest version of HTML, came into existence in the early 2008 and since then it is slowly releasing it's updates. Today almost every popular browser supports HTML5. HTML5 is developed jointly by World Wide Web (WWW) and Web Hypertext Application Technology Working Group (WHATWG) and is still under development that means there is more & "more is yet to come".

HTML5 was developed to replace HTML4, XHTML and HTML DOM to overcome the above mentioned limitations and many more so that user can design interactive and rich web pages with animations, graphics, music, videos etc without using 3rd party plugins and tools which adds to the page size ultimately affecting your page performance.

HTML5 is device independent as it was designed to work on any device whether you are using a smartphone, PC, laptop or a tablet. Some of many of the features of HTML5 is given below :

  • Two - Dimensional & Vector drawings & graphics
  • Audio & Video playback
  • Drag & Drop operations
  • Geolocation
  • Local data storage

These are some of the features of our latest version of HTML and all of them work without any third party plugin support, there are many more features and many more is to come. Look at the below demo code to get a key idea how HTML5 structures it's contents :



As you can see from the above code HTML5 has a very small, simple & a single document type definition which is eazy to remember than that of HTML 4.01.

HTML5 also defines different and unique tags to define particular contents for our web pages for example <header> tag for header contents like website name, logo, slogan and everything that usually goes inside the header, and <footer> tag for contents like copright information, contact numbers, address etc etc and <article> tag for writing & posting your articles. There are any more which you can learn just keep visiting and wait for our next article which will continue with HTML5 basics.

Thank you for visiting our blog if you liked our post please link our article to your blog or website and do comment.

Happy Designing !