6
I have a website that I am developing on which I have a top set menu (a navbar). The problem is this navbar has different views on Chrome and Firefox. I’d like to know why this is happening.
- I use Bootstrap 4.3.1 on the page.
See below the navbar code:
<!DOCTYPE html>
<html lang="pt-br">
<head>
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<!-- Meta tags Obrigatórias -->
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<!-- Bootstrap CSS -->
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.1.3/css/bootstrap.min.css" integrity="sha384-MCw98/SFnGE8fJT3GXwEOngsV7Zt27NXFoaoApmYm81iuXoPkFOJwJ8ERdknLPMO" crossorigin="anonymous">
<!-- Font Awesome -->
<link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.3.1/css/all.css" integrity="sha384-mzrmE5qonljUremFsqc01SB46JvROS7bZs3IO2EmfFsd15uHvIt+Y8vEf7N7fWAU" crossorigin="anonymous">
<!-- Estilo customizado -->
<link rel="stylesheet" type="text/css" href="css/estilo.css">
<link rel="icon" href="img/favicon.ico">
</head>
<body>
<header>
<nav class="navbar navbar-expand-md navbar-light fixed-top navbar-transparente">
<div class="container">
<a href="index.html" class="navbar-brand text-light" id="a-logo">
<marquee>Thiago Petherson | Desenvolvedor Web</marquee>
</a>
<button class="navbar-toggler" data-toggle="collapse" data-target="#nav-principal">
<i class="fas fa-bars text-white"></i>
</button>
<div class="collapse navbar-collapse" id="nav-principal">
<ul class="navbar-nav ml-auto">
<li class="nav-item">
<a href="views/cursos.html" class="nav-link">Minhas Qualificações</a>
</li>
<li class="nav-item">
<a href="views/calculador_imc.php" class="nav-link">Calcule seu IMC</a>
</li>
<li class="nav-item divisor">
</li>
<li class="nav-item">
<a href="views/consideracoes.html" class="nav-link">Me conheça</a>
</li>
<li class="nav-item">
<a href="" class="nav-link">Projetos Desenvolvidos</a>
</li>
<li class="nav-item">
<a href="views/historico-profissional.html" class="nav-link">Histórico Profissional</a>
</li>
</ul>
</div>
</div>
</nav>
</header>
<!-- Fim do Cabeçalho -->
How it looks in Chrome:
Now on Firefox
I would like to know why this is happening and if there is a way to solve it. These things happen a lot in different browsers. I have been through several situations where the code was displayed differently in the browsers. Thank you!
But Sam, is it just the dial that’s ruining all the other elements that are in the navbar ? Because if you stop the problem that is happening is not based on the functionality of the marque, but of the <li>...
– Gato de Schrödinger
It is the same Marquee that is breaking the layout. Firefox is not treating it as Chrome does, for example.
– Sam
What is this @keyframes ?
– Gato de Schrödinger
It’s a CSS animation.
– Sam
I made your suggestion but the <span> text is stopped.
– Gato de Schrödinger
Take a look at the example I posted, it doesn’t stand still :D
– Sam
I mean, I checked here now. What was happening in firefox, is now happening in Chrome. Firefox worked.
– Gato de Schrödinger
I didn’t notice here no. I put
.nav-item a{
 white-space: nowrap !important;
}
not to break lines in the menu.– Sam
With that you solved, @Sam. Thanks!
– Gato de Schrödinger