Recently, I encountered an issue with the navbar on my website. In the mobile version, whenever the toggle button in the navbar is clicked, it results in the website shifting to the left and causing the content to be off-center.
However, when I view the website in responsive mode using a different browser, everything seems to be properly centered and the toggle button functions as expected without any misalignment issues.
Here's a snippet of my HTML code:
<!doctype html>
<html lang="fr">
<head>
<meta charset="utf-8">
<title>*******************</title>
<link rel="icon" type="image/png" sizes="96x96" href="favicon-96x96.png">
<meta name="robots" content="noimageindex">
<link rel="stylesheet" href="style.css">
<meta name="viewport" content="width=device-width">
</head>
/* The rest of the HTML code */
And this is part of my CSS code that may be relevant to the issue:
body {
background-color: white;
width: 100%;
font-size: 1rem;
z-index: 1;
}
header {
background-color: white;
}
/* More CSS styling rules here */
If anyone has encountered a similar problem or has any suggestions on how to resolve this issue, please let me know!