0

How do i change the position for this menu on pc version i want to move it alittle more away from the right side, and on mobil version i want the menu links to be in the right side not the left side.

there is no css only the 2 scripts

    <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
    <script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.1.3/js/bootstrap.bundle.min.js"></script>
            <a class="navbar-brand" href="#">Logo here</a>
            <button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbar-collapse">☰</button> 
            <div class="collapse navbar-collapse" id="navbar-collapse">
                <ul class="nav navbar-nav ml-auto">
                    <li class="nav-item active"> <a class="nav-link" href="#">Home</a>
                    </li>
                    <li class="nav-item"> <a class="nav-link" href="#">Link 1</a>
                    </li>
                    <li class="nav-item"> <a class="nav-link" href="#">Link 2</a>
                    </li>
                    <li class="nav-item"> <a class="nav-link" href="#">Link 3</a>
                    </li>
                </ul>
            </div>
        </nav>

1 Answers1

0

you can use javascript navigator.platform or navigator.userAgent and use else/if to check the device is mobile or pc ( with check os ) and based on these values , add style to html element using javascript

you can get idea from this answer :

Detecting a mobile browser

parisam
  • 26
  • 2