...">
    All geek questions in one place

    HTML5 <nav> Element

    I always try to use new html5 elements, but find myself doing things like this:

    <nav class="some-menu">
        <ul class="menu">
           <li>
               <a title="link to somewhere" href="the-link.php">link to somewhere</a>
           </li>
        </ul>
    </nav>
    

    When I could achieve the same (visually) with:

    <ul class="menu">
       <li>
           <a title="link to somewhere" href="the-link.php">link to somewhere</a>
       </li>
    </ul>
    

    More simplicity markup and bloated DOM, should the tag be included <nav>in this situation?

    EDIT

    I found that the element <menu>can be used in this situation along with <li>for example:

    <menu class="side-menu">
        <li><a title="a menu item" href="touch-my-nipples.thanks">Inappropriate Href</a>
    </menu>
    

    Which gets more meaningful markup without details.

    +4
    html5
    Johnnyfaldo Mar 07 '14 at 10:12
    source share
    4 answers

    Well, you can argue that not including html5 tags improves the readability of your html file.

    SEO html5 , , -.

    , <li> , , - .

    +2
    Denis Tsoi 07 . '14 10:25

    . DOM == , . . - :

    <nav class="menu">
      <a class="menu-item" href="...">Link 1</a>
      <a class="menu-item" href="...">Link 2</a>
    </nav>
    

    , , , ( ).

    +3
    Michael Aaron Safyan 07 . '14 10:21

    , . <nav>, , . , ul.menu.

    , SEO.

    +1
    SteveEdson 07 . '14 10:29

    ", , , ." < > : http://html5doctor.com/nav-element/

    :

        <nav>
          <ul>
            <li><a href="index.html">Home</a></li>
            <li><a href="about.html">About</a></li>
          </ul>
       </nav>
    

    , :

    <menu> HTML "" . : https://developer.mozilla.org/en-US/docs/Web/HTML/Element/menu

    0
    Mateus Vahl 26 '14 17:28

    Source: https://habr.com/ru/post/1530573/

    More articles:

    • JAVA HBase: how to use CellUtil.getRowByte (Cell, int) - java
    • PHP public function behaves like static - function
    • CocoaPods - ัƒัั‚ะฐะฝะพะฒะธั‚ัŒ ัะฑะพะน - ruby
    • Entity Framework, preventing duplicate entries, simultaneous connections - c #
    • SQL * Plus command-line options overwritten on Windows - command-line
    • No authentication found - android
    • Are strtol, strtoll, strtod really thread safe? - c ++
    • Failed to get the latest javascript history - javascript
    • Android Emulator crash with floating point exception - android
    • Difference between target and target openMP data? - c ++

    All Articles

    Geek Questions | 2019