Page 62 - HTML5
P. 62

A deep and oftenly used nested container layouts shows a bad coding style.


        Rounded corners or some similar functions often create such an HTML code. For most of the last
        generation browsers there are CSS3 counterparts. Try to use as little as possible HTML elements
        to increase the content to tag ratio and reduce page load, resulting in a better ranking in search
        engines.

        div section Element should be not nested deeper than 6 layers.


        Basic usage


        The <div> element usually has no specific semantic meaning by itself, simply representing a
        division, and is typically used for grouping and encapsulating other elements within an HTML
        document and separating those from other groups of content. As such, each <div> is best
        described by its contents.


         <div>
           <p>Hello! This is a paragraph.</p>
         </div>


        The div element is typically a block-level element, meaning that it separates a block of an HTML
        document and occupying the maximum width of the page. Browsers typically have the following
        default CSS rule:


         div {
           display: block;
         }



              It's strongly encouraged by the The World Wide Web Consortium (W3C) to view the
              div element as an element of last resort, for when no other element is suitable. The use
              of more appropriate elements instead of the div element leads to better accessibility for
              readers and easier maintainability for authors.


        For example, a blog post would be marked up using <article>, a chapter using <section>, a page's
        navigation aids using <nav>, and a group of form controls using <fieldset>.


        div elements can be useful for stylistic purposes or to wrap multiple paragraphs within a section
        that are all to be annotated in a similar way.

        Read Div Element online: https://riptutorial.com/html/topic/1468/div-element



















        https://riptutorial.com/                                                                               46
   57   58   59   60   61   62   63   64   65   66   67