2

I need your help and advice with the issue that I am facing in learning Twitter Bootstrap. I am using the exact code from W3Schools for putting up a collapsible NavBar.

I am using Eclipse and Apache Tomcat local server.

I am seeing two different outputs with the same code.

For some weird reasons, I am unable to upload images.. :(

Site when run on "localhost" (http://localhost:8080/test.html)

Site when run on "IP Address" (http://my-ip:8080/test.html)

<!DOCTYPE html>
<html lang="en">
<head>
    <title>Bootstrap Case</title>   
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <link rel="stylesheet" href="http://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap.min.css">
    <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.3/jquery.min.js"></script>
    <script src="http://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/js/bootstrap.min.js"></script>
</head>
<body>
    <nav class="navbar navbar-inverse">
        <div class="container-fluid">
            <div class="navbar-header">
                <button type="button" class="navbar-toggle" data-toggle="collapse"
                    data-target="#myNavbar">
                    <span class="icon-bar"></span> <span class="icon-bar"></span> <span
                        class="icon-bar"></span>
                </button>
                <a class="navbar-brand" href="#">WebSiteName</a>
            </div>
            <div class="collapse navbar-collapse" id="myNavbar">
                <ul class="nav navbar-nav">
                    <li class="active"><a href="#">Home</a></li>
                    <li class="dropdown"><a class="dropdown-toggle"
                        data-toggle="dropdown" href="#">Page 1 <span class="caret"></span></a>
                        <ul class="dropdown-menu">
                            <li><a href="#">Page 1-1</a></li>
                            <li><a href="#">Page 1-2</a></li>
                            <li><a href="#">Page 1-3</a></li>
                        </ul></li>
                    <li><a href="#">Page 2</a></li>
                    <li><a href="#">Page 3</a></li>
                </ul>
                <ul class="nav navbar-nav navbar-right">
                    <li><a href="#"><span class="glyphicon glyphicon-user"></span>
                            Sign Up</a></li>
                    <li><a href="#"><span class="glyphicon glyphicon-log-in"></span>
                            Login</a></li>
                </ul>
            </div>
        </div>
    </nav>

    <div class="container">
        <h3>Collapsible Navbar</h3>
        <p>In this example, the navigation bar is hidden on small screens
            and replaced by a button in the top right corner (try to re-size this
            window).
        <p>Only when the button is clicked, the navigation bar will be
            displayed.</p>
    </div>

</body>
</html>
Nitin
  • 370
  • 2
  • 12
  • Please post the error you're seeing. – leesei Oct 15 '15 at 04:20
  • I can't upload pics @leesei .. it is not allowing me to upload.. sorry! There is no error. In localhost, it is working fine, but when i substitute it with system IP Address, the navbar is collapsed even on full-screen. – Nitin Oct 15 '15 at 04:25

0 Answers0