Solution 1 :

You can probably just use a utility class on the ul or the li to center the text on the appropriate screen size like this one:

.text-center and .text-md-left

Problem :

I am getting text left aligned when in mobile view.This is done in bootstrap4. How to center the menu contents on collapse
enter image description here

        <ul class="navbar-nav ml-auto">
            <li class="nav-item active">
                <a class="nav-link color-me" href="#home">Home</a>

            </li>
            <li class="nav-item">
                <a class="nav-link color-me" href="#about">About</a>

            </li>
            <li class="nav-item">
                <a class="nav-link color-me" href="#services">Services</a>

            </li>
            <li class="nav-item">
                <a class="nav-link color-me" href="#gallery">Gallery</a>

            </li>
            <li class="nav-item">
                <a class="nav-link color-me" href="#contact">Contact</a>

            </li>
        </ul>
    </div>
</div>

Comments

Comment posted by mahan

Yes. If only width

Comment posted by Andy Holmes

@mahan Yep, but based on the limited knowledge of the situation in the question, I can’t really expand too much. They could also add

By