Join the social network of Tech Nerds, increase skill rank, get work, manage projects...
 
  • Chapter 2: HTML5 syntax

    • 1
    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 617
    Comment on it

    Hi All,

     HTML5 is much smarter, so its need simple syntax to specify it, Few of them are below:

    • Quotes are optional for attributes.
    • Uppercase tag names.
    • Closing empty elements are optional.
    • Attribute values are optional.

       

    DOCTYPE  -

    In the older version of HTML, we need to write a long like to declare DOCTYPE because HTML is SGML(Standard Generalized Markup Language) based so its need a DTD (document type definition).

    <!DOCTYPE html>

    In HTML5 we need to explain the content type, html5 has dropped this feature. In earlier, it was needed to explain like script and link(stylesheet)

    <script type="text/javascript" src="script.js"></script>
    <link rel="stylesheet" type="text/css" href="style.css">

    and now below will work for you.

     

    <script src="script.js"></script>
    <link rel="stylesheet" href="style.css">


    HTML5 Semantic Element -

    • HTML5 introduced some new elements for better structure −
    • Section − Section element is used for application section.
    • Header − This is used for header.
    • Footer − This is used for footer.
    • Nav − nav is used for navigation area, it hold menu(s).
    • Article − Article is used for an independent box of content like as blog entry or article text.
    • Aside − This is used in slightly related div to rest of the page.
    • Figure − This tag can be used for a graphic, video or an image. figure caption work together with it and can hold some embedded content.


    A demo of htm5 semantic element -

    <!DOCTYPE html>
    <html>
    
       <head>
          <meta charset="utf-8">
          <title>...</title>
       </head>
        
       <body>
          <header>...</header>
          <nav>...</nav>
            
          <article>
             <section>
                ...
             </section>
          </article>
            
          <aside>...</aside>
          <figure>...</figure>
          <footer>...</footer>
          
       </body>
    </html>

 0 Comment(s)

Sign In
                           OR                           
                           OR                           
Register

Sign up using

                           OR                           
Forgot Password
Fill out the form below and instructions to reset your password will be emailed to you:
Reset Password
Fill out the form below and reset your password: