Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Bootstrap Mobile Not Working

I have worked with Bootstrap many times, and have only seen this issue when my meta viewport tag is missing. However, that is loaded, and I am still experiencing issues with Bootstrap on mobile devices. Might anyone know what else could be causing this?

Issues:

  • button routes showing
  • styles not displaying properly
  • CSS showing in view
  • mobile nav missing
  • formatting/alignment is off

Head:

<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">

    <title>Training Portal</title>
    <!-- bootstrap/jquery -->
    <link href="http://netdna.bootstrapcdn.com/bootstrap/3.1.1/css/bootstrap.min.css" rel="stylesheet">

    <!-- custom stylesheet -->
    <link href="<?= base_url("stylesheets/cust.css"); ?>" rel="stylesheet" type="text/css" media="screen">

  </head>

Scripts at end of <body>:

    <!-- scripts -->
    <script src="http://code.jquery.com/jquery.js"></script>
    <script src="<?= base_url("assets/script.js"); ?>"></script>

    <!-- Bootstrap JavaScript -->
    <script src="http://netdna.bootstrapcdn.com/bootstrap/3.1.1/js/bootstrap.min.js"></script>
  </body>

Viewport data also added to CSS:

@viewport{
    zoom: 1.0;
    width: extend-to-zoom;
}

Example of issue on mobile:

enter image description here

What this looks like on desktop:

enter image description here

like image 849
Lauren F Avatar asked Apr 24 '15 14:04

Lauren F


People also ask

Does Bootstrap work for mobile?

Mobile devices Generally speaking, Bootstrap supports the latest versions of each major platform's default browsers.

Why Bootstrap is not working?

These are the possible reasons: You have a wrong or incorrect link to the bootstrap file. browser caching and history is messing with your html. Other CSS files are overriding the bootstrap file.

Is Bootstrap 5 mobile first?

Since Bootstrap is developed to be mobile first, we use a handful of media queries to create sensible breakpoints for our layouts and interfaces. These breakpoints are mostly based on minimum viewport widths and allow us to scale up elements as the viewport changes.

Why is Bootstrap mobile first?

Bootstrap has become mobile first since Bootstrap 3. It means 'mobile first' styles can be found throughout the entire library instead of them in separate files. You need to add the viewport meta tag to the <head> element, to ensure proper rendering and touch zooming on mobile devices.


1 Answers

It appears to be a PHP error, and judging by the lack of CSS, I'm going to take a stab and say that maybe the PHP short tags (<?= and <?) are not enabled?

like image 182
Te Riu Warren Avatar answered Sep 22 '22 06:09

Te Riu Warren