This topic is locked

Bootstrap different header in mabile

8/13/2017 3:08:39 PM
PHPRunner General questions
S
safesurf author

The header code below will make the bootstrap databases work with different header for mobile mode. The desktop header is in a file called include/header2.php and header is for mobile. Just wanted to know if this is the best way to do a different header in mobile devices.
Header.php
<?php

if (MobileDetected())

echo "<font size='6'>Mobile mode</font>";

else

include("include\header2.php");

?>

jadachDevClub member 8/13/2017

You can use bootstrap classes. Here is example code for your header file.

<div class="hidden-md hidden-sm hidden-xs">

<h1>Large Screen Title</h1>

</div>
<div class="visible-sm visible-md visible-xs">

<h3>Small Screen Title</h3>

</div>