How to make menu look like fixed-top without following on scroll - html

I'm using fixed-top on nav it makes it on top of the header as shown on image.
Problem is, that when I scroll down, the menu goes down.
Is there any way (sure there is) how to make nav look the same but not follow when scroll?
I mean without fixed-top on nav.
Pictures
Here are codes:
* {
padding: 0;
margin: 0;
}
body {
background-color: #fff;
}
nav.navbar {
transition: top 0.3s;
}
nav.navbar.navbar-light .navbar-nav {
padding: 1.5rem 0;
}
nav.navbar.navbar-light .navbar-nav .nav-item {
text-transform: uppercase;
font-weight: 700;
}
nav.navbar.navbar-light .navbar-nav .nav-item .nav-link {
padding-left: 1.5rem;
color: #fff;
}
nav.navbar.navbar-light .navbar-nav .nav-item .nav-link:hover {
color: #FE5000;
}
nav.navbar.navbar-light .navbar-nav .nav-item.active .nav-link {
color: #FE5000;
}
header.masthead {
padding-top: 10.5rem;
padding-bottom: 6rem;
text-align: center;
color: #fff;
background-image: linear-gradient(45deg, rgba(0, 0, 0, 0.8), rgba(0, 0, 0, 0.8)), url("https://www.patrikderka.cz/stavby-seibert/assets/img/home-bg.jpg");
background-repeat: no-repeat;
background-attachment: scroll;
background-position: center center;
background-size: cover;
}
header.masthead .btn {
background-color: #FE5000 !important;
border: #FE5000 !important;
padding: 1.25rem 2.5rem;
}
header.masthead .btn a {
color: #fff;
text-decoration: none;
}
header.masthead .masthead-subheading {
font-size: 1.5rem;
font-style: italic;
line-height: 1.5rem;
margin-bottom: 25px;
}
header.masthead .masthead-heading {
font-size: 3.25rem;
font-weight: 700;
line-height: 3.25rem;
margin-bottom: 2rem;
}
#media (min-width: 768px) {
header.masthead {
padding-top: 17rem;
padding-bottom: 12.5rem;
}
header.masthead .masthead-subheading {
font-size: 2.25rem;
font-style: italic;
line-height: 2.25rem;
margin-bottom: 2rem;
}
header.masthead .masthead-heading {
font-size: 4.5rem;
font-weight: 700;
line-height: 4.5rem;
margin-bottom: 4rem;
}
}
<script src="https://kit.fontawesome.com/e5f67cf6ac.js" crossorigin="anonymous"></script>
<script src="reveal.js"></script>
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css" integrity="sha384-ggOyR0iXCbMQv3Xipma34MD+dH/1fQ784/j6cY/iJTQUOhcWr7x9JvoRxT2MZw1T" crossorigin="anonymous" />
<nav class="navbar navbar-expand-lg navbar-light fixed-top">
<div class="container">
<button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarNavDropdown" aria-controls="navbarNavDropdown" aria-expanded="false" aria-label="Toggle navigation">
<span class="navbar-toggler-icon"></span>
</button>
<div class="collapse navbar-collapse justify-content-center" id="navbarNavDropdown">
<ul class="navbar-nav">
<li class="nav-item active">
<a class="nav-link" href="/">Domu</a>
</li>
<li class="nav-item">
<a class="nav-link" href="/reference/">O nás</a>
</li>
<li class="nav-item">
<a class="nav-link" href="/cenik">Služby</a>
</li>
<li class="nav-item">
<a class="nav-link" href="/cenik">Portfolio</a>
</li>
<li class="nav-item">
<a class="nav-link" href="/kontakt">Kontakt</a>
</li>
</ul>
</div>
</div>
</nav>
<header class="masthead">
<div class="container">
<div class="masthead-subheading">My jsme stavaři.</div>
<div class="masthead-heading">PTS-STAVBY Seibert</div>
<a class="btn btn-primary btn-lg text-uppercase" href="#services">Zjistit více</a>
</div>
</header>
<section id="onas" class="py-5">
<div class="container">
<div class="title">
<h2>
O nás
</h2>
<p>
Kdo jsme a co děláme?
</p>
</div>
</div>
<div class="container">
<div class="row mb-5">
<div class="col-12 col-md-6 my-auto">
<p>
Stavební firma PTS-STAVBY SEIBERT byla založena v dubnu roku 2006. Zpočátku se firma zaměřuje na rekonstrukce objektů.
</p>
<p>
Postupem času začíná převládat klasická stavební činnost od základní desky včetně projektů.
</p>
<p>
V letech 2010-2020 firma realizuje řadu výstaveb v obcí našeho regionu a to převážně rekonstrukce stávajících objektů.
</p>
<p>
V roce 2020 firma rozšiřuje svoji činnost o speciální stavební práce (brušení podlach jansen,příprava podkladu pro velkoobchody s krytinamy všeho druhu.atd).
</p>
</div>
<div class="col-12 col-md-6">
<img title="Stavitelství" alt="Stavitelství" class="img-fluid" src="https://www.patrikderka.cz/stavby-seibert/assets/img/mixfotek.jpg" />
</div>
</div>
</section>
I tried to put the nav into header.

It sounds like you don't want fixed-top at all. Something like position: absolute;, so that the nav doesn't take up space and moves as the page does.
I've added the following:
.myNav {
position: absolute !important;
width: 100%;
}
Note: I added !important because _Navbar.scss comes in after, if you want to bump the custom CSS up the order, you need to increase the CSS Specificity (with an id or more classes, etc...)
* {
padding: 0;
margin: 0;
}
body {
background-color: #fff;
}
nav.navbar {
transition: top 0.3s;
}
nav.navbar.navbar-light .navbar-nav {
padding: 1.5rem 0;
}
nav.navbar.navbar-light .navbar-nav .nav-item {
text-transform: uppercase;
font-weight: 700;
}
nav.navbar.navbar-light .navbar-nav .nav-item .nav-link {
padding-left: 1.5rem;
color: #fff;
}
nav.navbar.navbar-light .navbar-nav .nav-item .nav-link:hover {
color: #FE5000;
}
nav.navbar.navbar-light .navbar-nav .nav-item.active .nav-link {
color: #FE5000;
}
header.masthead {
padding-top: 10.5rem;
padding-bottom: 6rem;
text-align: center;
color: #fff;
background-image: linear-gradient(45deg, rgba(0, 0, 0, 0.8), rgba(0, 0, 0, 0.8)), url("https://www.patrikderka.cz/stavby-seibert/assets/img/home-bg.jpg");
background-repeat: no-repeat;
background-attachment: scroll;
background-position: center center;
background-size: cover;
}
header.masthead .btn {
background-color: #FE5000 !important;
border: #FE5000 !important;
padding: 1.25rem 2.5rem;
}
header.masthead .btn a {
color: #fff;
text-decoration: none;
}
header.masthead .masthead-subheading {
font-size: 1.5rem;
font-style: italic;
line-height: 1.5rem;
margin-bottom: 25px;
}
header.masthead .masthead-heading {
font-size: 3.25rem;
font-weight: 700;
line-height: 3.25rem;
margin-bottom: 2rem;
}
#media (min-width: 768px) {
header.masthead {
padding-top: 17rem;
padding-bottom: 12.5rem;
}
header.masthead .masthead-subheading {
font-size: 2.25rem;
font-style: italic;
line-height: 2.25rem;
margin-bottom: 2rem;
}
header.masthead .masthead-heading {
font-size: 4.5rem;
font-weight: 700;
line-height: 4.5rem;
margin-bottom: 4rem;
}
}
.myNav {
position: absolute !important;
width: 100%;
}
<script src="https://kit.fontawesome.com/e5f67cf6ac.js" crossorigin="anonymous"></script>
<script src="reveal.js"></script>
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css" integrity="sha384-ggOyR0iXCbMQv3Xipma34MD+dH/1fQ784/j6cY/iJTQUOhcWr7x9JvoRxT2MZw1T" crossorigin="anonymous" />
<nav class="navbar navbar-expand-lg navbar-light myNav">
<div class="container">
<button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarNavDropdown" aria-controls="navbarNavDropdown" aria-expanded="false" aria-label="Toggle navigation">
<span class="navbar-toggler-icon"></span>
</button>
<div class="collapse navbar-collapse justify-content-center" id="navbarNavDropdown">
<ul class="navbar-nav">
<li class="nav-item active">
<a class="nav-link" href="/">Domu</a>
</li>
<li class="nav-item">
<a class="nav-link" href="/reference/">O nás</a>
</li>
<li class="nav-item">
<a class="nav-link" href="/cenik">Služby</a>
</li>
<li class="nav-item">
<a class="nav-link" href="/cenik">Portfolio</a>
</li>
<li class="nav-item">
<a class="nav-link" href="/kontakt">Kontakt</a>
</li>
</ul>
</div>
</div>
</nav>
<header class="masthead">
<div class="container">
<div class="masthead-subheading">My jsme stavaři.</div>
<div class="masthead-heading">PTS-STAVBY Seibert</div>
<a class="btn btn-primary btn-lg text-uppercase" href="#services">Zjistit více</a>
</div>
</header>
<section id="onas" class="py-5">
<div class="container">
<div class="title">
<h2>
O nás
</h2>
<p>
Kdo jsme a co děláme?
</p>
</div>
</div>
<div class="container">
<div class="row mb-5">
<div class="col-12 col-md-6 my-auto">
<p>
Stavební firma PTS-STAVBY SEIBERT byla založena v dubnu roku 2006. Zpočátku se firma zaměřuje na rekonstrukce objektů.
</p>
<p>
Postupem času začíná převládat klasická stavební činnost od základní desky včetně projektů.
</p>
<p>
V letech 2010-2020 firma realizuje řadu výstaveb v obcí našeho regionu a to převážně rekonstrukce stávajících objektů.
</p>
<p>
V roce 2020 firma rozšiřuje svoji činnost o speciální stavební práce (brušení podlach jansen,příprava podkladu pro velkoobchody s krytinamy všeho druhu.atd).
</p>
</div>
<div class="col-12 col-md-6">
<img title="Stavitelství" alt="Stavitelství" class="img-fluid" src="https://www.patrikderka.cz/stavby-seibert/assets/img/mixfotek.jpg" />
</div>
</div>
</section>
Note: Due to media queries, you may need to run the snippet in fullscreen to see the effect.

Just change your CSS position to Absolute instead of Fixed.
.fixed-top {
position: absolute;
top: 0;
right: 0;
left: 0;
z-index: 1030;

Related

Media Query and Image Swapping

I want the image in my site to completely change when the browser is resized.
I've been using media-queries, but I can't seem to get it right. Any thoughts/tips?
The thing is I have tried the display trick with media query but its not working
I did this, but it's not working even when I am lowering the viewport. The image in the laptop viewport remains the same in the phone viewport.
.blocks {
height: 58%;
}
.mob {
display: none;
}
#media (max-width:400px) {
.mob {
display: block;
}
.blocks {
display: none;
}
}
<div class="col-lg-6 border:1px">
<img class="blocks" src="https://via.placeholder.com/200" alt="laptop-mockup">
<img class="mob" src="https://via.placeholder.com/200/ff0000" alt="android-mockup">
</div>
The whole html and css code:
HTML
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>News homepage</title>
<link rel="icon" type="image/png" sizes="32x32" href="./images/favicon-32x32.png">
<script src="https://cdn.jsdelivr.net/npm/bootstrap#5.2.0/dist/js/bootstrap.bundle.min.js" integrity="sha384-A3rJD856KowSb7dwlZdYEkO39Gagi7vIsF0jrRAoQmDKKtQBHUuLZ9AsSv4jD4Xa" crossorigin="anonymous"></script>
<link href="https://cdn.jsdelivr.net/npm/bootstrap#5.2.0/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-gH2yIJqKdNHPEq0n4Mqa/HGKIhSkIHeL5AyhkYV8i59U5AR6csBvApHHNl/vI1Bx" crossorigin="anonymous">
<link rel="stylesheet" href="css/styles.css">
<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link href="https://fonts.googleapis.com/css2?family=Poppins:wght#400&display=swap" rel="stylesheet">
<link href="https://fonts.googleapis.com/css2?family=Noto+Sans:wght#600;700;800&family=PT+Sans:wght#700&display=swap" rel="stylesheet">
</head>
<body>
<div class="container">
<div class="navigator">
<nav class="navbar navbar-expand-sm navbar-dark navbar-light">
<a class="navbar-brand" href=""> <img src="C:\Users\91826\Desktop\news-homepage-main\css\images\logo.svg" alt="My Happy SVG" /></a>
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbarSupportedContent" aria-controls="navbarSupportedContent" aria-expanded="false" aria-label="Toggle navigation navbar-light">
<span class="navbar-toggler-icon navi"></span>
</button>
<div class="collapse navbar-collapse" id="navbarSupportedContent">
<ul class="navbar-nav ms-auto">
<li class="nav-item ms-auto navelement">
<a class="nav-link " href="#footer">Home </a>
</li>
<li class="nav-item ms-auto navelement">
<a class="nav-link " href="#pricing"> New </a>
</li>
<li class="nav-item ms-auto navelement">
<a class="nav-link " href="#cta"> Popular </a>
</li>
<li class="nav-item ms-auto navelement">
<a class="nav-link" href="#footer"> Trending </a>
</li>
<li class="nav-item ms-auto navelement">
<a class="nav-link " href="#footer"> Categories </a>
</li>
</ul>
</div>
</nav>
</div>
<div class="row ">
<div class="col-lg-6 border:1px">
<img class="blocks" src="C:\Users\91826\Desktop\news-homepage-main\css\images\image-web-3-desktop.jpg" alt="laptop-mockup">
<img class="mob" src="C:\Users\91826\Desktop\news-homepage-main\css\images\image-web-3-mobile.jpg" alt="android-mockup">
</div>
<div class="tag">
<h1 class="tagline">The Bright<br />Future of<br />Web 3.0?</h1>
</div>
<div class="read">
<h1 class="readline">We dive into the next evolution of the web that claims to put the power of the platforms back into the hands of the people.
But is it really fulfilling its promise?</h1>
</div>
<button class="button-50 readmore" type="button" name="button">READ MORE</button>
<div class="col-lg-6 border:1px">
<div class="new">
<h1>New</h1>
<h2>Hydrogen VS Electric Cars</h2>
<h3>Will hydrogen-fueled cars ever catch up to EVs?</h3>
<hr>
<h2>The Downsides of AI Artistry</h2>
<h3>What are the possible adverse effects of on-demand AI image generation?</h3>
<hr>
<h2>Is VC Funding Drying Up?</h2>
<h3>Private funding by VC firms is down 50% YOY. We take a look at what that means.</h3>
</div>
</div>
</div>
</div>
<div class="info">
<div class="row">
<div class="col-lg-4 box">
<div class="row">
<div class="col-lg-2 box">
<img class="infoimg" src="C:\Users\91826\Desktop\news-homepage-main\css\images\image-retro-pcs.jpg" alt="" />
</div>
<div class="col-lg-2 box">
<div class="inf">
<h1 class="infohead1 "> 01</h1>
<h2 class="infohead2"> Reviving Retro PCs</h2>
<h3 class="infohead3"> What happens when old PCs<br>are given modern upgrades?</h3>
</div>
</div>
</div>
</div>
<div class="col-lg-4 box2">
<div class="row">
<div class="col-lg-2 box">
<img class="infoimg" src="C:\Users\91826\Desktop\news-homepage-main\css\images\image-gaming-growth.jpg" alt="">
</div>
<div class="col-lg-2 box">
<div class="inf1 inf">
<h1 class="infohead1"> 02</h1>
<h2 class="infohead2"> Top 10 laptops of 2022</h2>
<h3 class="infohead3">Our best picks for various <br> needs and budgets.</h3>
</div>
</div>
</div>
</div>
<div class="col-lg-4 box2">
<div class="row">
<div class="col-lg-2 box">
<img class="infoimg" src="C:\Users\91826\Desktop\news-homepage-main\css\images\image-top-laptops.jpg" alt="">
</div>
<div class="col-lg-2 box">
<div class="inf">
<h1 class="infohead1"> 03</h1>
<h2 class="infohead2"> The Growth of Gaming</h2>
<h3 class="infohead3">How the pandemic has sparked <br> fresh opportunities.</h3>
</div>
</div>
</div>
</div>
</div>
<hr class="hori">
<div class="attribution">
Challenge by Frontend Mentor.
Coded by Saswat Seth.
</div>
</body>
</html>
CSS
.navigator {
margin-bottom: 2%;
}
body {
padding: 0% 10% 2% 10%;
}
.nav-link {
color: black;
}
:hover.nav-link {
color: #6B728E;
}
.navigator {
padding: 2% 5% 0% 0%;
}
.blocks {
height: 58%;
}
.mob {
display: none;
}
#media (max-width:400px) {
.mob {
display:block;
}
.blocks {
display:none;
}
}
.new {
height: 85%;
width: 23%;
background: hsl(240, 100%, 5%);
position: absolute;
right: 140px;
padding: 2%;
}
.navelement {
padding-right: 6%;
font-size: 100%;
}
h1 {
color: hsl(35, 77%, 62%);
font-family: 'noto sans';
font-weight: 600;
}
h2 {
color: #fff;
font-size: 23px;
margin-top: 10%;
font-family: 'noto sans';
font-weight: 700;
}
h3 {
color: #6B728E;
font-size: 15px;
padding: 4% 0%;
line-height: 25px;
}
hr {
color: #fff;
border-top: solid white;
}
.tag {
position: absolute;
bottom: 20px;
}
.tagline {
font-family: 'noto sans';
color: #000;
font-weight: 800;
font-size: 60px;
}
.read {
padding: 2% 38%;
position: absolute;
bottom: 54px;
right: -15px;
}
.readline {
font-size: 110%;
color: #6B728E;
line-height: 27px;
}
.button-50 {
height: 49px;
width: 200px;
appearance: button;
background-color: hsl(5, 85%, 63%);
background-image: none;
border: 1px solid #000;
border-radius: 4px;
box-shadow: #B73E3E 4px 4px 0 0, #000 4px 4px 0 1px;
box-sizing: border-box;
color: #fff;
cursor: pointer;
display: inline-block;
font-family: "Montserrat";
font-size: 18px;
font-weight: 400;
line-height: 20px;
margin: 20% 5% 10% 0%;
overflow: visible;
padding: 14px 30px;
text-align: center;
text-transform: none;
touch-action: manipulation;
user-select: none;
-webkit-user-select: none;
vertical-align: middle;
white-space: nowrap;
position: absolute;
bottom: -45px;
right: 45%;
}
.button-50:focus {
text-decoration: none;
}
.button-50:hover {
text-decoration: none;
}
.button-50:active {
box-shadow: rgba(0, 0, 0, .125) 0 3px 5px inset;
outline: 0;
}
.button-50:not([disabled]):active {
box-shadow: #C9BBCF 2px 2px 0 0, #1d1716 2px 2px 0 1px;
transform: translate(2px, 2px);
}
.readmore {
margin: 10% 3% 5% 0;
font-family: 'Poppins';
font-weight: 400;
}
.info {
margin-top: 5%;
margin-left: 10%;
position: absolute;
right: 10%;
}
.infoimg {
width: 315%;
padding: 20%;
}
.infohead1 {
color: #7D9D9C;
}
.infohead2 {
color: #000;
}
.inf {
padding: 30%;
margin-left: 68px;
white-space: nowrap;
}
.hori {
margin-top: 10%;
color: #000;
border-top: solid black;
}
#media (max-width:350px) {
img{
object-fit: cover;
height: 400px;
}
}
#media screen and (max-width:400px) {
.mob {
display: block;
}
}

Set width of div to full page

Hello i have a landing page. I would like to set width of my header to the full page with bootstrap. I was trying to set it with container-fluid class but its not working. How to fix this? That it will be responsive and width set to the full page? Thanks for Help
Here is the code:
#import url('https://fonts.googleapis.com/css?family=Open+Sans&display=swap');
#import url('https://fonts.googleapis.com/css2?family=Raleway:ital,wght#0,200;0,400;0,700;0,900;1,600&display=swap');
#import url('https://fonts.googleapis.com/css2?family=Raleway:ital,wght#0,200;0,700;0,900;1,600&display=swap');
.raleway600 {
font-family: raleway, sans-serif;
font-weight: 600;
font-style: italic;
}
.raleway900 {
font-family: raleway, sans-serif;
font-weight: 900;
font-style: normal;
font-size: 4em;
}
* {
font-family: "Raleway", sans-serif;
}
body {
display: flex;
flex-direction: column;
justify-content: center;
height: 100%;
padding-top: 60px;
width: 98%;
font-family: "Raleway", sans-serif;
}
.navbar {
font-family: "Raleway", sans-serif;
}
.container {
padding-top: 10rem;
}
/* fix padding under menu after resize */
#media screen and (max-width: 767px) {
body {
padding-top: 60px;
}
}
#media screen and (min-width:768px) and (max-width: 991px) {
body {
padding-top: 110px;
}
}
#media screen and (min-width: 992px) {
body {
padding-top: 60px;
}
}
footer {
padding: 0;
margin: 0 auto;
position: relative;
background-color: rgb(11, 11, 11);
width: 100%;
}
.logo {
width: 7rem;
height: 7rem;
}
.navbar-brand {
margin-left: 17em !important;
}
#banner {
position: relative;
background-image: linear-gradient(rgba(0, 0, 0, 0.5), rgba(0, 0, 0, 0.5)), url("logo");
background-position: center;
background-repeat: no-repeat;
background-size: cover;
height: 100%;
}
.hero-text {
text-align: center;
position: absolute;
top: 40%;
left: 50%;
transform: translate(-50%, -50%);
color: white;
}
.row-fluid {
text-align: center;
justify-content: center !important;
}
.img-responsive {
margin: 0 auto
}
nav {
overflow: auto;
}
header {
height: 100vh;
}
.card-img-top {
width: 100%;
height: 15vw;
object-fit: cover;
}
<header>
<div id="banner" class="container-fluid baner p-0 ">
<div class="hero-text">
<h1 class="raleway900">"Text 1"</h1>
<p class="raleway600"><strong>Text 2</strong></p>
<p class="raleway600"><strong>Text 3</strong></p>
<p class="raleway600"><strong>Text 4</strong> </p>
<p class="raleway600"><strong>Text 5</strong> </p>
<button class="btn btn-primary raleway600">Button 1</button>
<button class="btn btn-outline-light raleway600">Button 2</button>
</div>
</div>
</header>
https://jsfiddle.net/j28qyhrw/1/
You can have it, hope it helps
<div class="header container-fluid d-flex justify-content-between align-items-center">
<div class="logo">Logo</div>
<nav class="nav">
<ul class="d-flex">
<li>
Link 1
</li>
<li>
Link 2
</li>
<li>
Link 3
</li>
<li>
Link 4
</li>
</ul>
</nav>
<div class="hamburger-menu-wrap ">
<span></span>
<span></span>
<span></span>
</div>
</div>
<header class="banner container-fluid border-bottom">
<div class="banner1">
<p>Header 1</p>
<p>Header 2</p>
<p>Header 3</p>
<p>Header 4</p>
</div>
</header>
<div class="main-container container-fluid">
<p>Content 1</p>
<p>Content 2</p>
<p>Content 3</p>
<p>Content 4</p>
<p>Content 5</p>
</div>
<footer class="footer container-fluid text-center">
<p class=" pb-0">Footer</p>
</footer>
/* header */
.header{ background-color: #2b2d3b; color: #fff; padding-top: 10px; padding-bottom: 10px; }
.header nav ul{ list-style-type: none; padding: 0; margin: 0; background-color: #2b2d3b; color: #fff; }
.header nav ul li{ list-style: none; padding:0 ; margin: 0 15px; color: #fff; }
.header nav ul li a{ color: #fff; }
/* hamburger menu */
.hamburger-menu-wrap {width: 24px;height: 16px;cursor: pointer;z-index: 1;display: none;}
.hamburger-menu-wrap span {background: #fff;display: block;height: 2px;margin-bottom: 6px;width: 100%;float: right;cursor: pointer !important;}
#media(max-width:991px){
.hamburger-menu-wrap{ display: block; }
.header nav{ display: none; }
.hamburger-open .header nav{ display: flex; }
.hamburger-open .header nav ul{ flex-direction: column!important; }
}
.footer{ background-color: #2b2d3b; color: #fff; padding-top: 10px; padding-bottom: 10px; }
Or check in jsfiddle example link :
https://jsfiddle.net/DeveloperSandip/u6ph27cx/4/
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
<script src="https://cdn.jsdelivr.net/npm/bootstrap#5.0.2/dist/js/bootstrap.bundle.min.js" integrity="sha384-MrcW6ZMFYlzcLA8Nl+NtUVF0sA7MsXsP1UyJoMp4YLEuNSfAP+JcXn/tWtIaxVXM" crossorigin="anonymous"></script>
<link href="https://cdn.jsdelivr.net/npm/bootstrap#5.0.2/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-EVSTQN3/azprG1Anm3QDgpJLIm9Nao0Yz1ztcQTwFspd3yD65VohhpuuCOmLASjC" crossorigin="anonymous">
</head>
<body>
<nav class="navbar navbar-expand-lg navbar-light bg-light">
<div class="container-fluid">
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbarTogglerDemo01" aria-controls="navbarTogglerDemo01" aria-expanded="false" aria-label="Toggle navigation">
<span class="navbar-toggler-icon"></span>
</button>
<div class="collapse navbar-collapse" id="navbarTogglerDemo01">
<a class="navbar-brand" href="#">Hidden brand</a>
<ul class="navbar-nav me-auto mb-2 mb-lg-0">
<li class="nav-item">
<a class="nav-link active" aria-current="page" href="#">Home</a>
</li>
<li class="nav-item">
<a class="nav-link" href="#">Link</a>
</li>
<li class="nav-item">
<a class="nav-link disabled" href="#" tabindex="-1" aria-disabled="true">Disabled</a>
</li>
</ul>
<form class="d-flex">
<input class="form-control me-2" type="search" placeholder="Search" aria-label="Search">
<button class="btn btn-outline-success" type="submit">Search</button>
</form>
</div>
</div>
</nav>
<div class="container-fluid p-md-5 p-5 m-md-auto">
<div class="text-center" id="">
<img id="logo" style="pointer-events:none;" src="" class="img-fluid g-md-5 p-md-5" alt="">
</div>
</div>
</body>
</html>
try
Responsive containers allow you to specify a class that is 100% wide until the specified breakpoint is reached, after which we apply max-widths for each of the higher breakpoints. For example, .container-sm is 100% wide to start until the sm breakpoint is reached, where it will scale up with md, lg, xl, and xxl.Watch the screenshot
hope it will help you
Why do you use your own css for it? I don't have much experience yet, it's possible that I misunderstood. It is enough to insert the cdn in the head - I thought. Could it be that your css file conflicts with Bootstrap?

How do i make my css root rule work for my website

I created a card which i would like it to translate along the y-axis and throw a shadow upon hover. The translation along the y-axis is working well but the shadow doesn't get thrown when i hover over the card. I wrote the following css rule and i don't know if i got it right, because it clearly is NOT working on everything i applied it on:
:root {
--brand: #b33030;
--body: #606060;
--dark: #19282f;
--border-radius: 4px;
--shadow: 0px 4px 60px rgba(0, 0, 0, 0.14);
}
/* reset & helpers */
body {
font-family: "Source Sans Pro", sans-serif;
line-height: 1.7;
color: var(--body);
}
h1,
h2,
h3,
h4,
h5,
h6 {
font-weight: 700;
color: var(--dark);
font-family: "Domine", sans-serif;
}
a {
color: var(--dark);
text-decoration: none;
transition: all 0.4s linear;
}
a:hover {
color: var(--brand);
}
a.custom-link {
text-transform: uppercase;
font-weight: 700;
font-size: 14px;
}
img {
width: 100%;
}
section {
padding-top: 100px;
padding-bottom: 100px;
}
.section-intro {
margin-bottom: 33px;
text-align: center;
}
.section-intro p {
margin: auto;
max-width: 500px;
}
.custom-card {
transition: all 0.4s ease;
background-color: white;
border-radius: var(--border-radius);
}
.custom-card:hover {
box-shadow: var(--shadow);
transform: translateY(-5px);
}
/* Hero */
#hero {
min-height: 100vh;
background: linear-gradient(rgba(0, 0, 0, 0.6), rgba(0, 0, 0, 0.6)), url(../../../assets/images/hero_bg_img.jpg);
background-size: cover;
background-position: center;
text-align: center;
display: flex;
align-items: center;
background-attachment: fixed;
}
#hero h1 {
font-weight: 700;
}
#hero h1,
#hero p {
color: white;
}
#hero p {
max-width: 500px;
margin: 12px auto 24px auto;
}
#hero button {
padding: 12px 28px;
background-color: rgba(255, 255, 255, 0.3);
border: none;
color: white;
width: 40%;
}
#hero button:focus {
box-shadow: 1px;
}
/* button */
.btn {
padding: 12px 28px;
font-size: 16px;
text-transform: uppercase;
border-radius: var(--border-radius);
font-weight: 700;
border-radius: var(--border-radius);
transition: all 0.4s ease;
}
.btn:hover {
transform: translateY(-3px);
}
.btn-brand {
background-color: var(--brand);
color: white;
}
.btn-brand:hover {
color: white;
}
/* Navbar */
.navbar.bg-white {
border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}
.navbar .navbar-nav .nav-link {
font-size: 14px;
font-weight: 700;
text-transform: uppercase;
}
.navbar .navbar-nav .nav-link:hover .navbar .navbar-nav .nav-link.active {
color: var(--brand);
}
/* Features */
.features {
padding: 44px 24px;
text-align: center;
}
.icon-box {
width: 80px;
height: 80px;
background-color: var(--brand);
color: white;
border-radius: var(--border-radius);
font-size: 34px;
display: flex;
align-items: center;
justify-content: center;
margin: auto;
}
.features h5 {
margin-top: 28px;
margin-bottom: 12px;
}
.features p {
font-size: 14px;
}
<!-- NAV -->
<nav class="navbar navbar-expand-lg navbar-light bg-white sticky-top">
<div class="container-fluid">
<a class="navbar-brand" href="#">Navbar</a>
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbarNav" aria-controls="navbarNav" aria-expanded="false" aria-label="Toggle navigation">
<span class="navbar-toggler-icon"></span>
</button>
<div class="collapse navbar-collapse" id="navbarNav">
<ul class="navbar-nav ms-auto">
<li class="nav-item">
<a class="nav-link active" aria-current="page" href="#home">Home</a>
</li>
<li class="nav-item">
<a class="nav-link" href="#about">About Us</a>
</li>
<li class="nav-item">
<a class="nav-link" href="#testimonials">Testimonials</a>
</li>
<li class="nav-item">
<a class="nav-link" href="#contact">Contact Us</a>
</li>
<li class="nav-item">
<a class="nav-link" href="#login">Login</a>
</li>
</ul>
</div>
</div>
</nav>
<!-- END OF NAV-->
<!-- HERO -->
<section id="hero">
<div class="container">
<div class="row">
<div class="col-12">
<h1 class="display-3">Brighter Brain</h1>
<p>
Creating a pathway to make access to education easier, flexible and profound.
</p>
</div>
</div>
<div class="row">
<p>
<button class="btn btn-brand" type="button" id="button">
Get started.
</button>
</p>
</div>
</div>
</section>
<!-- END OF HERO-->
<!-- FEATURES -->
<section id="features">
<div class="container">
<div class="row">
<div class="col-12 section-intro">
<h1>Our Features</h1>
<p>
We have a very significant number of features which will help make educational life easily.
</p>
</div>
</div>
<div class="row">
<div class="col-lg-4 col-md-6">
<div class="features custom-card">
<div class="icon-box">
<i class="ri-live-fill"></i>
</div>
<h5>Features Title</h5>
<p>
Integrated administrative design and monitoring of teaching manuals, digital class and examinations deployable anywhere and anytime.
</p>
Read more
</div>
</div>
</div>
</div>
</section>
<!-- END OF FEATURES -->
The root rule in the CSS is suppose to handle all color applications, hovers et al BUT it is not working. Am i doing this right?
Thanks in advance.
I just threw your code into a runnable snippet and the shadow on hover seems to be working for me.
I darkened it to 0.5 opacity so it's more obvious.
:root {
--brand: #b33030;
--body: #606060;
--dark: #19282f;
--border-radius: 4px;
--shadow: 0px 4px 60px rgba(0, 0, 0, 0.5);
}
/* reset & helpers */
body {
font-family: "Source Sans Pro", sans-serif;
line-height: 1.7;
color: var(--body);
}
h1,
h2,
h3,
h4,
h5,
h6 {
font-weight: 700;
color: var(--dark);
font-family: "Domine", sans-serif;
}
a {
color: var(--dark);
text-decoration: none;
transition: all 0.4s linear;
}
a:hover {
color: var(--brand);
}
a.custom-link {
text-transform: uppercase;
font-weight: 700;
font-size: 14px;
}
img {
width: 100%;
}
section {
padding-top: 100px;
padding-bottom: 100px;
}
.section-intro {
margin-bottom: 33px;
text-align: center;
}
.section-intro p {
margin: auto;
max-width: 500px;
}
.custom-card {
transition: all 0.4s ease;
background-color: white;
border-radius: var(--border-radius);
}
.custom-card:hover {
box-shadow: var(--shadow);
transform: translateY(-5px);
}
/* Hero */
#hero {
min-height: 100vh;
background: linear-gradient(rgba(0, 0, 0, 0.6), rgba(0, 0, 0, 0.6)),
url(../../../assets/images/hero_bg_img.jpg);
background-size: cover;
background-position: center;
text-align: center;
display: flex;
align-items: center;
background-attachment: fixed;
}
#hero h1 {
font-weight: 700;
}
#hero h1,
#hero p {
color: white;
}
#hero p {
max-width: 500px;
margin: 12px auto 24px auto;
}
#hero button {
padding: 12px 28px;
background-color: rgba(255, 255, 255, 0.3);
border: none;
color: white;
width: 40%;
}
#hero button:focus {
box-shadow: 1px;
}
/* button */
.btn {
padding: 12px 28px;
font-size: 16px;
text-transform: uppercase;
border-radius: var(--border-radius);
font-weight: 700;
border-radius: var(--border-radius);
transition: all 0.4s ease;
}
.btn:hover {
transform: translateY(-3px);
}
.btn-brand {
background-color: var(--brand);
color: white;
}
.btn-brand:hover {
color: white;
}
/* Navbar */
.navbar.bg-white {
border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}
.navbar .navbar-nav .nav-link {
font-size: 14px;
font-weight: 700;
text-transform: uppercase;
}
.navbar .navbar-nav .nav-link:hover .navbar .navbar-nav .nav-link.active {
color: var(--brand);
}
/* Features */
.features {
padding: 44px 24px;
text-align: center;
}
.icon-box {
width: 80px;
height: 80px;
background-color: var(--brand);
color: white;
border-radius: var(--border-radius);
font-size: 34px;
display: flex;
align-items: center;
justify-content: center;
margin: auto;
}
.features h5 {
margin-top: 28px;
margin-bottom: 12px;
}
.features p {
font-size: 14px;
}
<!-- NAV -->
<nav class="navbar navbar-expand-lg navbar-light bg-white sticky-top">
<div class="container-fluid">
<a class="navbar-brand" href="#">Navbar</a>
<button
class="navbar-toggler"
type="button"
data-bs-toggle="collapse"
data-bs-target="#navbarNav"
aria-controls="navbarNav"
aria-expanded="false"
aria-label="Toggle navigation"
>
<span class="navbar-toggler-icon"></span>
</button>
<div class="collapse navbar-collapse" id="navbarNav">
<ul class="navbar-nav ms-auto">
<li class="nav-item">
<a class="nav-link active" aria-current="page" href="#home">Home</a>
</li>
<li class="nav-item">
<a class="nav-link" href="#about">About Us</a>
</li>
<li class="nav-item">
<a class="nav-link" href="#testimonials">Testimonials</a>
</li>
<li class="nav-item">
<a class="nav-link" href="#contact">Contact Us</a>
</li>
<li class="nav-item">
<a class="nav-link" href="#login">Login</a>
</li>
</ul>
</div>
</div>
</nav>
<!-- END OF NAV-->
<!-- HERO -->
<section id="hero">
<div class="container">
<div class="row">
<div class="col-12">
<h1 class="display-3">Brighter Brain</h1>
<p>
Creating a pathway to make access to education easier, flexible and
profound.
</p>
</div>
</div>
<div class="row">
<p>
<button class="btn btn-brand" type="button" id="button">
Get started.
</button>
</p>
</div>
</div>
</section>
<!-- END OF HERO-->
<!-- FEATURES -->
<section id="features">
<div class="container">
<div class="row">
<div class="col-12 section-intro">
<h1>Our Features</h1>
<p>
We have a very significant number of features which will help make
educational life easily.
</p>
</div>
</div>
<div class="row">
<div class="col-lg-4 col-md-6">
<div class="features custom-card">
<div class="icon-box">
<i class="ri-live-fill"></i>
</div>
<h5>Features Title</h5>
<p>
Integrated administrative design and monitoring of teaching manuals,
digital class and examinations deployable anywhere and anytime.
</p>
Read more
</div>
</div>
</div>
</div>
</section>
<!-- END OF FEATURES -->

The background color isn't stretching the entire width of screen

I am in the middle of making an about section for my website then I encountered an issue where the section isn't covering the entire width of the page and nothing I found on other posts is working for me. I am using bootstrap5 if that helps.
* {
margin:0px;
padding:0px;
}
.navbar {
background: #131313;
padding: 1rem 8rem;
z-index: 1000;
}
.navbar-nav {
padding-right: 9%;
}
.navbar .navbar-brand {
font-size: 1.4rem;
font-weight: 700;
}
#navbarSupportedContent > ul > li:nth-child(n) > a {
color: #fff;
font-size: 1.1rem;
padding: 0 0.8rem;
}
#navbarSupportedContent > ul > li:nth-child(n) > a:hover {
color: grey;
}
#navbarSupportedContent > button {
outline: none;
background: rgb(197, 190, 190);;
font-weight: 600;
padding: 0.4rem 1.4rem;
border-radius: 30px;
}
#navbarSupportedContent > button:hover {
background: grey;
}
.mid {
height: 80vh;
width: 100%;
overflow: hidden;
display: flex;
flex-direction: column;
justify-content: center;
align-content: center;
text-align: center;
}
.mid video {
width: 100%;
height: 100%;
pointer-events: none;
object-fit: cover;
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
}
.hero {
position: relative;
}
.hero h2 {
font-weight: bold;
}
.mid .hero p {
width: 55%;
font-size: 1.1rem;
letter-spacing: 0.2px;
padding: 1.1rem;
}
.mid .hero a {
background: rgb(197, 190, 190);;
font-weight: 600;
padding: 1rem 2rem;
border-radius: 30px;
text-decoration: none;
}
.mid .hero a:hover {
background: grey;
}
.about {
background:#000;
}
.about .text {
display: flex;
flex-direction: column;
justify-content: flex-start;
align-items: flex-start;
margin: auto;
}
.about .text h2 {
color: #F7F5F4;
font-weight: 700;
font-size: 2.7rem;
letter-spacing: 2px;
}
.about .text p {
color: #F7F5F4;
font-weight: 400;
font-size: 1.1rem;
letter-spacing: 0.5px;
}
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Talk Tech Teen Tech</title>
<link href="https://cdn.jsdelivr.net/npm/bootstrap#5.0.0-beta2/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-BmbxuPwQa2lc/FVzBcNJ7UAyJxM6wuqIj61tLrc4wSX0szH/Ev+nYRRuWlolflfl" crossorigin="anonymous">
<link rel="stylesheet" type="text/css" href="style.css">
</head>
<body>
<header>
<nav class="navbar navbar-expand-lg navbar-dark fixed-top">
<div class="container-fluid">
<a class="navbar-brand" href="#">Talk Tech Teen Tech</a>
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbarSupportedContent" aria-controls="navbarSupportedContent" aria-expanded="false" aria-label="Toggle navigation">
<span class="navbar-toggler-icon"></span>
</button>
<div class="collapse navbar-collapse" id="navbarSupportedContent">
<ul class="navbar-nav mx-auto">
<li class="nav-item">
<a class="nav-link active" aria-current="page" href="#">Home</a>
</li>
<li class="nav-item">
<a class="nav-link" href="#">Listen</a>
</li>
<li class="nav-item">
<a class="nav-link" href="#">Product Specs</a>
</li>
<li class="nav-item">
<a class="nav-link" href="#">Premium Techy</a>
</li>
<li class="nav-item">
<a class="nav-link active" aria-current="page" href="#">Contact</a>
</li>
</ul>
<button class="btn btn-outline text-dark" type="submit">Sign Up</button>
</div>
</div>
</nav>
<div class="mid">
<video autoplay muted loop>
<source src="images/mic.mp4" type="video/mp4"><source>
</video>
<div class="hero text-center">
<h2 class="text-light display-4">Talk Tech Teen Tech</h2>
<p class="text-light mx-auto">This podcast talks about tech but through the eyes of grade school teens to get a different approach on the bleeding-edge of technology</p>
<a class= text-dark href="#">Start Listening</a>
</div>
</div>
</header>
<section class="about container py-5 my-5 mx-auto">
<div class="row align-items-center">
<div class="img col-lg-6 col-md-6 col-12 pt-5 pb-5">
<img class="img-fluid" src="images/mic.png">
</div>
<div class="text col-lg-6 col-md-6 col-12 pt-5 pb-5">
<h2>About Us</h2>
<p>Talk Tech Teen Tech is a podcast created by teens, made for the masses. In this podcast we talk about the bleeding edge of technology but through a teens perspective and what we think tech should be about and how companies handle technology. We talk about products from all sorts of companies (Apple, Samsung, OnePlus, Xiomi, Dell, Microsoft etc.). Our goal was to introduce another prespective of technology into the web and also to influence others that you don't need to be 30 to create a tech podcast, and with minimal gear you can create an amazing podcast!</p>
</div>
</div>
</section>
<script src="https://cdn.jsdelivr.net/npm/#popperjs/core#2.6.0/dist/umd/popper.min.js" integrity="sha384-KsvD1yqQ1/1+IA7gi3P0tyJcT3vR+NdBTt13hSJ2lnve8agRGXTTyNaBYmCR/Nwi" crossorigin="anonymous"></script>
<script src="https://cdn.jsdelivr.net/npm/bootstrap#5.0.0-beta2/dist/js/bootstrap.min.js" integrity="sha384-nsg8ua9HAw1y0W1btsyWgBklPnCUAFLuTMS2G72MMONqmOymq585AcH49TLBQObG" crossorigin="anonymous"></script>
</body>
</html>
This is the Result
Any help would be greatly appreciated!
Wrapping your container with the section will most likely fix the problem.
Instead of writing this;
<section class="about container py-5 my-5 mx-auto">
try this:
<section class="about py-5 my-5">
<div class="container mx-auto">
You probably have a margin set around your container
Also your about styles should be set to width: 100%
It looks like the container class limits the max-width to be less than the full page width, see here: https://getbootstrap.com/docs/5.0/layout/containers/
Try adding width: 100%; to the about section CSS as you did to the CSS of .mid.
If this does not help, you can try width: 100% !important;, width: 100vw; and width: 100vw !important;.
Elements scale to the width of their parent. Is the element you're trying to draw the background on inside a body container that has some padding?

Changing navbar background color while keeping toggle menu (hamburger)

I would like to have a custom color (#5f788a) for my navbar, however, I understand that in order to have the toggle menu in mobile version, the navbar class must be navbar-light or navbar-dark (according to Bootstrap). This, of course, overrides my custom navbar color and it looks like I have to choose between the hamburger menu OR my custom color.
Things I have tried:
1). Using ! important in CSS to override the styling;
2). Styling with the background-color attribute in CSS;
3). Styling body but this affects rest of site colors, not just navbar.
Here is the CSS:
body {
background: #fafafa;
color: #333333;
margin-top: 5rem;
}
h1, h2, h3, h4, h5, h6 {
color: #444444;
}
.bg-steel {
background-color: #5f788a;
}
.site-header .navbar-nav .nav-link {
color: #5f788a;
}
.site-header .navbar-nav .nav-link:hover {
color: #ffffff;
}
.site-header .navbar-nav .nav-link.active {
font-weight: 500;
}
.content-section {
background: #ffffff;
padding: 10px 20px;
border: 1px solid #dddddd;
border-radius: 3px;
margin-bottom: 20px;
}
.article-title {
color: #444444;
}
a.article-title:hover {
color: #428bca;
text-decoration: none;
}
.article-content {
white-space: pre-line;
}
.article-img {
height: 65px;
width: 65px;
margin-right: 16px;
}
.article-metadata {
padding-bottom: 1px;
margin-bottom: 4px;
border-bottom: 1px solid #e3e3e3
}
.article-metadata a:hover {
color: #333;
text-decoration: none;
}
#parent {
list-style: none;
width: 100%;
height: 90px;
margin: 0;
padding: 0;
white-space: nowrap;
overflow-x: auto;
overflow-y: hidden;
}
.article-svg {
width: 25px;
height: 25px;
vertical-align: middle;
}
.account-img {
height: 125px;
width: 125px;
margin-right: 20px;
margin-bottom: 16px;
}
.account-heading {
font-size: 2.5rem;
}
#import url("//netdna.bootstrapcdn.com/bootstrap/3.0.0/css/bootstrap-glyphicons.css");
And the of the site:
<body>
<header class="site-header">
<nav class="navbar navbar-default navbar-expand-md navbar-light fixed-top">
<div class="container">
<a class="navbar-brand mr-4" href="/">Company Name (v0.01)</a>
<button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarToggle" aria-controls="navbarToggle" aria-expanded="false" aria-label="Toggle navigation">
<span class="navbar-toggler-icon"></span>
</button>
<div class="collapse navbar-collapse" id="navbarToggle">
<div class="navbar-nav mr-auto">
<a class="nav-item nav-link" href="/about">About</a>
</div>
<!-- SEARCH BOX-->
<!-- <form class="form-inline my-2 my-lg-0">-->
<!-- <input class="form-control mr-sm-1" id="search_box" type="search" placeholder="Find some stuff..." aria-label="Search" align="middle">-->
<!-- <button class="btn btn-outline-light my-2 my-sm-0 mr-5" type="submit" align="center">Search</button>-->
<!-- </form>-->
<!-- Navbar Right Side -->
<div class="navbar-nav">
{% if current_user.is_authenticated %}
<a class="nav-item nav-link" href="/post/new">New Post</a>
<a class="nav-item nav-link" href="/send_invites">Invite</a>
<a class="nav-item nav-link" href="/account">My Account</a>
<a class="nav-item nav-link" href="/logout"><span class="glyphicon glyphicon-log-in"></span> Logout</a>
{% else %}
<a class="nav-item nav-link" href="/login"><span class="glyphicon glyphicon-log-in"></span> Login</a>
<a class="nav-item nav-link" href="/register"><span class="glyphicon glyphicon-user"></span> Register</a>
{% endif %}
</div>
</div>
</div>
</nav>
</header>
Could it be that I should be trying to style the body? If so, wont that affect the rest of the site, not just the navbar? Thanks for your help
navbar-light and navbar-dark are helper classes, what they do is change the colour of the text from white (if navbar-dark) to black (if navbar-light), so that the text colour on your navbar doesn't conflict with the navbar colours
you can do this:
.navbar {background-color: #5f788a;}
and add the class "navbar-dark" to your nav element.
This is assuming you're using the latest version of bootstrap, 4.3
Bootstrap 4.0.0 Demo below:
body {
background: #fafafa;
color: #333333;
margin-top: 5rem;
}
h1,
h2,
h3,
h4,
h5,
h6 {
color: #444444;
}
.bg-steel {
background-color: #5f788a;
}
.site-header .navbar-nav .nav-link {
color: #5f788a;
}
.site-header .navbar-nav .nav-link:hover {
color: #ffffff;
}
.site-header .navbar-nav .nav-link.active {
font-weight: 500;
}
.content-section {
background: #ffffff;
padding: 10px 20px;
border: 1px solid #dddddd;
border-radius: 3px;
margin-bottom: 20px;
}
.article-title {
color: #444444;
}
a.article-title:hover {
color: #428bca;
text-decoration: none;
}
.article-content {
white-space: pre-line;
}
.article-img {
height: 65px;
width: 65px;
margin-right: 16px;
}
.article-metadata {
padding-bottom: 1px;
margin-bottom: 4px;
border-bottom: 1px solid #e3e3e3
}
.article-metadata a:hover {
color: #333;
text-decoration: none;
}
#parent {
list-style: none;
width: 100%;
height: 90px;
margin: 0;
padding: 0;
white-space: nowrap;
overflow-x: auto;
overflow-y: hidden;
}
.article-svg {
width: 25px;
height: 25px;
vertical-align: middle;
}
.account-img {
height: 125px;
width: 125px;
margin-right: 20px;
margin-bottom: 16px;
}
.account-heading {
font-size: 2.5rem;
}
#import url("//netdna.bootstrapcdn.com/bootstrap/3.0.0/css/bootstrap-glyphicons.css");
<!DOCTYPE html>
<!-- saved from url=(0044)https://stack.fleeksite.com/bootstrap-navbar -->
<html lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>TurboTobias</title>
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/css/bootstrap.min.css" integrity="sha384-Gn5384xqQ1aoWXA+058RXPxPg6fy4IWvTNh0E263XmFcJlSAwiGgFAW/dAiS6JXm" crossorigin="anonymous">
</head>
<body>
<header class="site-header">
<nav class="navbar navbar-default navbar-expand-md navbar-dark fixed-top" style="background-color: rebeccapurple;">
<div class="container">
<a class="navbar-brand mr-4" href="https://stack.fleeksite.com/">Bench of Thoughts (v0.01)</a>
<button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarToggle" aria-controls="navbarToggle" aria-expanded="false" aria-label="Toggle navigation">
<span class="navbar-toggler-icon"></span>
</button>
<div class="collapse navbar-collapse" id="navbarToggle">
<div class="navbar-nav mr-auto">
<a class="nav-item nav-link" href="https://stack.fleeksite.com/about">About</a>
</div>
<!-- Navbar Right Side -->
<div class="navbar-nav">
<a class="nav-item nav-link" href="https://stack.fleeksite.com/login"><span class="glyphicon glyphicon-log-in"></span> Login</a>
<a class="nav-item nav-link" href="https://stack.fleeksite.com/register"><span class="glyphicon glyphicon-user"></span> Register</a>
</div>
</div>
</div>
</nav>
</header>
</body>
</html>
you can just add:-
<nav class="navbar navbar-expand-lg navbar-dark bg-dark">
Instead of what you wrote earlier