如何在navbar-toggler引导程序中将位置更多地移到左侧?

时间:2019-05-30 00:38:49

标签: css bootstrap-4

我打算稍微向左稍微更改导航栏图标,以及它们各自的菜单。我已经尝试过更改css中的位置,但这只会更改图像中显示的图标,并且菜单完全相同。他们能帮我吗?谢谢。

https://imgur.com/MZBGbCC

菜单代码:

<a href="#" id="scroll"><span></span></a>
<div class="menu">
    <nav class="navbar container-fluid navbar-expand-lg navbar transparent">
    <button class="navbar-toggler navbar-toggler-right" id="menu_colapso" type="button" data-toggle="collapse" data-target="#navbarSupportedContent" aria-controls="navbarSupportedContent" aria-expanded="false" aria-label="Toggle navigation">
        <span class="navbar-toggler-icon"><img src="conteudo/menu.png" id="imagem_icon"></span>
    </button>
    <a class="navbar-brand">
        <img src="conteudo/asus.png" class="collapse navbar-collapse" id="imagem_logo">
    </a>
    <div class="collapse navbar-collapse pr-5 mt-5" id="navbarSupportedContent">
        <ul class="navbar-nav ml-auto">    <!--mr-auto para voltar ao lado esquerdo-->
            <li class="nav-item">
                <a class="nav-link" id="linhaactiva" href="inicio">Início</a>
            </li>
            <li class="nav-item">
                <a class="nav-link" href="destaques">Destaques</a>
            </li>
            <li class="nav-item">
                <a class="nav-link" href="museu">Museu</a>
            </li>
            <li class="nav-item dropdown">
                <a class="nav-link dropdown-toggle" href="#" id="navbarDropdown" role="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">Urgeiriça</a>
                <div class="dropdown-menu" aria-labelledby="navbarDropdown">
                <a class="dropdown-item" href="historia">Cronologia</a>
                <a class="dropdown-item" href="bairro">Bairro Mineiro</a>
                <a class="dropdown-item" href="minas">As Minas</a>
                <a class="dropdown-item" href="processamento">Processamento</a>
                <a class="dropdown-item" href="ambiental">Impactos Ambientais</a>
                <a class="dropdown-item" href="saude_publica">Saúde Pública</a>
                <a class="dropdown-item" href="recuperacao">Recuperação Ambiental</a>
                </div>
            </li>
            <li class="nav-item dropdown">
                <a class="nav-link dropdown-toggle" href="#" id="navbarDropdown" role="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">Mineiros</a>
                <div class="dropdown-menu" aria-labelledby="navbarDropdown">
                <a class="dropdown-item" href="laborais">Condições Laborais</a>
                <a class="dropdown-item" href="impacto_saude">Impacto na Saúde</a>
                <a class="dropdown-item" href="mural">Mural</a>
                </div>
            </li>
            <li class="nav-item dropdown">
                <a class="nav-link dropdown-toggle" href="#" id="navbarDropdown" role="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">Associação</a>
                <div class="dropdown-menu" aria-labelledby="navbarDropdown">
                <a class="dropdown-item" href="fundacao">Fundação</a>
                <a class="dropdown-item" href="objectivos">Objectivos</a>
                </div>
            </li>
            <li class="nav-item">
                <a class="nav-link" href="informacoes">Informações </a>
            </li>
            <li class="nav-item">
                <a class="nav-link"> </a>
            </li>
            <li class="nav-item">
                <a class="nav-link" href="#">PT</a>
            </li>
            <li class="nav-item2">
                <a class="nav-link" href="#">|</a>
            </li>
            <li class="nav-item">
                <a class="nav-link" href="#">EN</a>
            </li>
        </ul>
    </div>
    </nav>
</div>

1 个答案:

答案 0 :(得分:0)

r_id是您要寻找的...

  • 您可以在切换器上进行操作...将其向左移动一点(类:pullToLeft)
  • 您可以在导航上执行此操作……它将向左移动一点(类:pullNavLeft)
  • 我替换了您拥有的图像,以便我和堆栈溢出的其他人可以看到实际的效果;下面的工作片段:

padding-left:0
.pullToLeft {
  padding-left: 0 !important;
}

.pullNavLeft {
  padding: .5rem .3rem !important;
}