Displaying Desktop Version of Bootstrap Website on Mobile Devices
Question:
Is it possible to display a Bootstrap website as the desktop version on a mobile device, displaying the larger 992px or 1200px viewports?
Answer:
To achieve this, follow these steps:
1. Configure the Viewport:
2. Code:
<code class="html"><a href="mywebsite.php?show_desktop_mode=true">I want desktop mode!</a></code>
<code class="php"><?php session_start(); if ($_GET['show_desktop_mode'] == 'true') { $_SESSION['desktopmode'] = 'true'; } ?></code>
<code class="html"><?php if ($_SESSION['desktopmode'] == 'true') { /* DESKTOP MODE */ ?> <meta name="viewport" content="width=1024"> <?php } else { // DEFAULT ?> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <?php } ?></code>
The above is the detailed content of Can I Force a Bootstrap Website to Display the Desktop Version on Mobile Devices?. For more information, please follow other related articles on the PHP Chinese website!