Home > Mobile >  bootstrap 3.4.1 navbar link show up and work properly in mobile firefox but do not work in mobile Ch
bootstrap 3.4.1 navbar link show up and work properly in mobile firefox but do not work in mobile Ch

Time:02-13

I'm using Visual studio and ASP.net to build a web page.

My code:

<head>
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/3.4.1/css/bootstrap.min.css" /> 
</head>

<div >
  <div >
    <div >
      <button type="button"  data-toggle="collapse" data-target=".navbar-collapse">
                        <span ></span>
                        <span ></span>
                        <span ></span>
                    </button>
      <a >
        <img alt="" src="~/resources/favicon.ico"></a><a  href="/">ASTRO</a>
    </div>
    <div >
      <ul >
        <li><a href="~/">Home</a></li>
        <li><a href="~/img">Pictures</a></li>
        <li><a href="~/whatsup">Tonight's Sky</a></li>
        <li><a href="~/About">About</a></li>
        <li><a href="~/Contact">Contact</a></li>
      </ul>
    </div>
  </div>
</div>

Bootstrap link I'm using:

<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/3.4.1/css/bootstrap.min.css" /> 

I've tried the latest bootstrap version 5.1.3 with no luck.

As I said in the header, Works fine in the mobile Firefox but all I get mobile Chrome browser is the Navbar and the "ASTRO" link which works the other links in the list don't show. And when I click on the 3 bars button nothing happens.

Does Chrome need some special settings?

Thanks Nor

CodePudding user response:

You needed to include jQuery and Bootstrap .js files since the button uses JavaScript:

Updated code:

<head>
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/3.4.1/css/bootstrap.min.css" /> 
</head>
<body>
<div >
  <div >
    <div >
      <button type="button"  data-toggle="collapse" data-target=".navbar-collapse">
                        <span ></span>
                        <span ></span>
                        <span ></span>
                    </button>
      <a >
        <img alt="" src="~/resources/favicon.ico"></a><a  href="/">ASTRO</a>
    </div>
    <div >
      <ul >
        <li><a href="~/">Home</a></li>
        <li><a href="~/img">Pictures</a></li>
        <li><a href="~/whatsup">Tonight's Sky</a></li>
        <li><a href="~/About">About</a></li>
        <li><a href="~/Contact">Contact</a></li>
      </ul>
    </div>
  </div>
</nav>
<script src="https://code.jquery.com/jquery-1.12.4.min.js" integrity="sha384-nvAa0 6Qg9clwYCGGPpDQLVpLNn0fRaROjHqs13t4Ggj3Ez50XnGQqc/r8MhnRDZ" crossorigin="anonymous"></script>
<script src="https://stackpath.bootstrapcdn.com/bootstrap/3.4.1/js/bootstrap.min.js" integrity="sha384-aJ21OjlMXNL5UyIl/XNwTMqvzeRMZH2w8c5cRVpzpU8Y5bApTppSuUkhZXN0VxHd" crossorigin="anonymous"></script>
</body>

CodePudding user response:

There may be some sizing issues. Do these mobile browser have different display zoom or text size settings?

  • Related