Currently, I am facing an issue while attempting to change the navbar icon into a close symbol when it is open. Despite my efforts, the display is not optimal and I need the icon to be positioned next to the MENU text. To achieve this, I have applied CSS styling for the close icon by utilizing three spans for the horizontal bars. The approach involves hiding the middle bar and rotating the first and third bars to transform them into a close symbol. However, the positioning is incorrect. Even when setting the display value of .navbar-toggler span to block, the appearance is still unsatisfactory but at least all three bars are visible. How can I adjust the size of navbar-toggler to ensure that the Menu text and icon align properly side by side? Additionally, how can I prevent the icons from shifting out of place? My goal is to maintain the icon in the same position both before and after collapsing the navigation menu.
.navbar {
border-top: 2px solid #C66FF4;
width: 100%
}
@media (min-width: 768px) {
nav .navbar .navbar-custom {
background: rgba(0,0,0,0);
}
}
.navbar-toggler:focus,
.navbar-toggler:active {
outline: 0;
}
... (remaining code omitted for brevity)
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link href="https://stackpath.bootstrapcdn.com/bootstrap/4.1.1/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-WskhaSGFgHYWDcbwN70/dfYBj47jz9qbsMId/iRN3ewGhXQFZCSftd1LZCfmhktB" crossorigin="anonymous">
... (remaining code omitted for brevity)