You can use the Bootstrap 4 navbar .navbar with .navbar-expand{-sm|-md|-lg|-xl} or component to create responsive navigation header for your website
Navbars are responsive by default, or you can easily modify them to change that. Responsive behavior depends on our Collapse JavaScript plugin.
navbar-light: This class will set in Navigation Bar the color of the text to dark. And you can use a light background color.
navbar-dark: This class will set Navigation Bar the color of the text to light. You can use a dark background color.
Bootstrap 4 has some inbuilt classes for the colors of any background.
These can be used to apply on the HTML page in navbar the color of the background of the navigation bar.