After successfully building a website using bootstrap 4 and testing it on my computer, I encountered an issue when loading the same page on my mobile device:
https://i.sstatic.net/M5J3J.jpg
The layout seems to display as if for a desktop screen rather than adjusting for the mobile view. I have included the necessary meta tag in the header to support mobile devices:
<meta name="viewport" contain="width=device-width, initial-scale=1.0">
. However, the problem persists, and I am unsure why!
Here is the code from my <head> section:
<!DOCTYPE html>
<html>
<head>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/css/bootstrap.min.css" integrity="sha384-Gn5384xqQ1aoWXA+058RXPxPg6fy4IWvTNh0E263XmFcJlSAwiGgFAW/dAiS6JXm" crossorigin="anonymous">
<link href="https://fonts.googleapis.com/css?family=Open+Sans" rel="stylesheet">
<link rel="stylesheet" href="/css/master.css" type="text/css">
@yield('css_includes')
<meta name="viewport" contain="width=device-width, initial-scale=1.0">
</head>
<body>
@yield('navbar')
<div class="container-fluid h-100">
@yield('content')
</div>
<script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.12.9/umd/popper.min.js" integrity="sha384-ApNbgh9B+Y1QKtv3Rn7W3mgPxhU9K/ScQsAP7hUibX39j7fakFPskvXusvfa0b4Q" crossorigin="anonymous"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/js/bootstrap.min.js" integrity="sha384-JZR6Spejh4U02d8jOt6vLEHfe/JQGiRRSQQxSfFWpi1MquVdAyjUar5+76PVCmYl" crossorigin="anonymous"></script>
@yield('page_scripts')
@stack('extra_scripts')
</body>
</html>
This is the code snippet for the navbar:
<nav class="navbar navbar-expand-lg navbar-dark bg-dark">
<a class="navbar-brand" href="/">Order Happy</a>
<button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbar_content" aria-controls="navbar_content" aria-expanded="false" aria-label="Toggle Navigation">
<span class="navbar-toggler-icon"></span>
</button>
<div class="collapse navbar-collapse" id="navbar_content">
<ul class="navbar-nav mr-auto">
<li class="nav-item {{ request()->is($business->business_slug) ? 'active' : '' }}">
<a class="nav-link" href="/{{ $business->business_slug }}">{{ $business->name }}</a>
</li>
<li class="nav-item {{ request()->is($business->business_slug . "/basket") ? 'active' : '' }}">
<a class="nav-link" href="/{{ $business->business_slug }}/basket">Basket <span class="badge badge-light">{{ $basket_quantity }}</span></a>
</li>
</ul>
</div>
</nav>