locked
Need help with an error RRS feed

  • Question

  • User-527908287 posted
    I'm currently building a website with visual studio 2010; each time I try to create a navigation bar it displays it's content in a vertical form, and in the code window it shows an underlined "<nav>" then when I put the cursor on it this pops up: Validation (XHTML 1.0 Transitional): Element 'nav' is not supported. Please what is the way out?
    Saturday, September 29, 2018 3:43 PM

All replies

  • User-271186128 posted

    Hi Donald416,

    in the code window it shows an underlined "<nav>" then when I put the cursor on it this pops up: Validation (XHTML 1.0 Transitional): Element 'nav' is not supported.

    When we edit markup in Source view of the Visual Studio Web designer, the editor continually checks that the markup we are creating is valid. Markup validation works like the spelling checker in a word processing program. The editor examines the markup and adds wavy red lines under the elements or attributes that are not valid. 

    You could try to change the validation schema to "DOCTYPE:XHTML5" or ignore this warning.

    More details about Markup validation, please refer to this link: 

    Markup Validation in Visual Web Developer

    How to: Select Validation Schemas for HTML Editing in Visual Web Developer

    each time I try to create a navigation bar it displays it's content in a vertical form,

    As for this issue, it seems that you are using bootstrap css style, if that is the case, please make sure you have add the bootstrap reference:

    code as below:

    <head runat="server">
        <title></title>  
        <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css"/>
      <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
      <script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script>
    </head>
    <body>
        <form id="form1" runat="server">
            <div>
                <nav class="navbar navbar-default">
                    <div class="container-fluid">
                        <div class="navbar-header">
                            <a class="navbar-brand" href="#">WebSiteName</a>
                        </div>
                        <ul class="nav navbar-nav">
                            <li class="active"><a href="#">Home</a></li>
                            <li><a href="#">Page 1</a></li>
                            <li><a href="#">Page 2</a></li>
                            <li><a href="#">Page 3</a></li>
                        </ul>
                    </div>
                </nav>
            </div>
        </form>
    </body>

    Best regards,
    Dillion

    Monday, October 1, 2018 7:43 AM