Scrollable sidebar div issue - html

I have a main content part of a sidebar that is supposed to be scrollable if it overflows. The problem is that it makes the whole page scroll instead of just the sidebar. The other problem is that it's supposed to scroll inside of it's container instead of making the whole sidebar scroll.
How do I fix this?
it's supposed to look like this:
___
header
___
nav pill 1
nav pill 2
___
a href image
a href image
...
...
___
button
text
___
const tooltipTriggerList = document.querySelectorAll('[data-bs-toggle="tooltip"]')
const tooltipList = [...tooltipTriggerList].map(tooltipTriggerEl => new bootstrap.Tooltip(tooltipTriggerEl))
window.onload = (event) => {
const tooltip = bootstrap.Tooltip.getInstance('#add_bot_button') // Returns a Bootstrap tooltip instance
tooltip.show();
};
document.getElementById('server_wide_button').addEventListener('click', () => {
document.getElementById('channel_specific_button').classList.remove('active');
document.getElementById('server_wide_button').classList.add('active');
});
document.getElementById('channel_specific_button').addEventListener('click', () => {
document.getElementById('server_wide_button').classList.remove('active');
document.getElementById('channel_specific_button').classList.add('active');
});
document.getElementById('add_bot_button').addEventListener('click', () => {
console.log('adding bot to guild');
});
#sidebar_header {
top: 0;
text-align: center;
position: fixed;
width: inherit;
}
#sidebar_sub_header {
/* top: 0; */
/* position: fixed;
width: inherit; */
}
#sidebar_main_content {
overflow-y: scroll;
}
#sidebar_footer {
position: fixed;
bottom: 0;
width: inherit;
}
#sidebar {
width: 250px;
min-height: 100vh;
max-height: 100vh;
}
/* #sidebar_main_content::-webkit-scrollbar {
width: 0;
height: 0;
} */
#dropdown {
align-items: center;
text-align: center;
}
<link href="https://cdn.jsdelivr.net/npm/bootstrap#5.3.0-alpha1/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-GLhlTQ8iRABdZLl6O3oVMWSktQOp6b7In1Zl3/Jr59b6EGGoI1aFkw7cmDA6j6gD" crossorigin="anonymous">
<script src="https://cdn.jsdelivr.net/npm/bootstrap#5.3.0-alpha1/dist/js/bootstrap.bundle.min.js" integrity="sha384-w76AqPfDkMBDXo30jS1Sgez6pr3x5MlQ1ZAGC+nuZB+EYdgRZgiwxhTBTkF7CXvN" crossorigin="anonymous"></script>
<div class="container-fluid">
<div class="row">
<!-- <div class="col align-items-start bg-dark text-white"> -->
<div class="align-items-start text-center p-0 bg-dark text-white" id="sidebar">
<div class="p-3 bg-dark text-white" id="sidebar_header">
<span class="fs-4">
Header
</span>
<hr>
<div class="p-3" id="sidebar_sub_header bg-secondary">
<ul class="nav nav-pills flex-column mb-auto">
<li class="nav-item">
<a href="#" class="nav-link text-white active" aria-current="page" id="server_wide_button">
Test 1
</a>
</li>
<li>
<a href="#" class="nav-link text-white" id="channel_specific_button">
Test 2
</a>
</li>
</ul>
</div>
</div>
<!-- <div class="p-3" id="sidebar_sub_header bg-secondary">
<ul class="nav nav-pills flex-column mb-auto">
<li class="nav-item">
<a href="#" class="nav-link text-white active" aria-current="page" id="server_wide_button">
Test 1
</a>
</li>
<li>
<a href="#" class="nav-link text-white" id="channel_specific_button">
Test 2
</a>
</li>
</ul>
</div> -->
<div class="mb-auto p-3 bg-danger flex-fill" id="sidebar_main_content">
<!-- main content - scrollable -->
<ul class="nav flex-column mb-auto align-items-center">
<li class="nav-item">
<a href="#" data-bs-toggle="tooltip" data-bs-placement="right" data-bs-title="test tooltip">
<img src="https://cdn.pixabay.com/photo/2020/02/10/11/12/smiley-4836191_1280.png" class="rounded-circle" style="height:100px;width:100px">
</a>
</li>
<br>
<li class="nav-item">
<a href="#" data-bs-toggle="tooltip" data-bs-placement="right" data-bs-title="test tooltip">
<img src="https://cdn.pixabay.com/photo/2020/02/10/11/12/smiley-4836191_1280.png" class="rounded-circle" style="height:100px;width:100px">
</a>
</li>
<br>
<li class="nav-item">
<a href="#" data-bs-toggle="tooltip" data-bs-placement="right" data-bs-title="test tooltip">
<img src="https://cdn.pixabay.com/photo/2020/02/10/11/12/smiley-4836191_1280.png" class="rounded-circle" style="height:100px;width:100px">
</a>
</li>
<br>
<li class="nav-item">
<a href="#" data-bs-toggle="tooltip" data-bs-placement="right" data-bs-title="test tooltip">
<img src="https://cdn.pixabay.com/photo/2020/02/10/11/12/smiley-4836191_1280.png" class="rounded-circle" style="height:100px;width:100px">
</a>
</li>
<br>
<li class="nav-item">
<a href="#" data-bs-toggle="tooltip" data-bs-placement="right" data-bs-title="test tooltip">
<img src="https://cdn.pixabay.com/photo/2020/02/10/11/12/smiley-4836191_1280.png" class="rounded-circle" style="height:100px;width:100px">
</a>
</li>
<br>
<li class="nav-item">
<a href="#" data-bs-toggle="tooltip" data-bs-placement="right" data-bs-title="test tooltip">
<img src="https://cdn.pixabay.com/photo/2020/02/10/11/12/smiley-4836191_1280.png" class="rounded-circle" style="height:100px;width:100px">
</a>
</li>
<br>
<li class="nav-item">
<a href="#" data-bs-toggle="tooltip" data-bs-placement="right" data-bs-title="test tooltip">
<img src="https://cdn.pixabay.com/photo/2020/02/10/11/12/smiley-4836191_1280.png" class="rounded-circle" style="height:100px;width:100px">
</a>
</li>
<br>
<li class="nav-item">
<a href="#" data-bs-toggle="tooltip" data-bs-placement="right" data-bs-title="test tooltip">
<img src="https://cdn.pixabay.com/photo/2020/02/10/11/12/smiley-4836191_1280.png" class="rounded-circle" style="height:100px;width:100px">
</a>
</li>
<br>
<li class="nav-item">
<a href="#" data-bs-toggle="tooltip" data-bs-placement="right" data-bs-title="test tooltip">
<img src="https://cdn.pixabay.com/photo/2020/02/10/11/12/smiley-4836191_1280.png" class="rounded-circle" style="height:100px;width:100px">
</a>
</li>
<br>
<li class="nav-item">
<a href="#" data-bs-toggle="tooltip" data-bs-placement="right" data-bs-title="test tooltip">
<img src="https://cdn.pixabay.com/photo/2020/02/10/11/12/smiley-4836191_1280.png" class="rounded-circle" style="height:100px;width:100px">
</a>
</li>
<br>
<li class="nav-item">
<a href="#" data-bs-toggle="tooltip" data-bs-placement="right" data-bs-title="test tooltip">
<img src="https://cdn.pixabay.com/photo/2020/02/10/11/12/smiley-4836191_1280.png" class="rounded-circle" style="height:100px;width:100px">
</a>
</li>
<br>
</ul>
</div>
<div class="p-3 bg-dark text-white" id="sidebar_footer">
<a href="#" class="btn btn-primary" id="add_bot_button" role="button" data-bs-toggle="tooltip" data-bs-placement="top" data-bs-title="Test tooltip">
Test Button
</a>
<br><br>
<div class="dropup-center dropup">
<a href="#" class="align-items-center text-white text-decoration-none dropdown-toggle" id="dropdownUser1" data-bs-toggle="dropdown" aria-expanded="false">
{{ wallet_address }}
</a>
<ul class="dropdown-menu dropdown-menu-dark text-small shadow" aria-labelledby="dropdownUser1">
<li><a class="dropdown-item" href="#">Delete User Info</a></li>
<li><a class="dropdown-item" href="#">Logout</a></li>
</ul>
</div>
</div>
</div>
<div class="col bg-secondary text-white" id="main_content">
One of three columns
</div>
</div>
</div>
Using bootstrap 5.3.0 alpha1
Also - is what I have right so far? Each element is supposed to be fixed in the sidebar. not sure if i need position: fixed for each element or just for the sidebar. any help would be appreciated
edit:
also where test text here 0000000000000000000000000 is, how do i shrink that or confine it inside the div?
edit2: edited code to show some updates

Set different overflow behaviours for the 3 containers
You want the outer container not to scroll. That is important, because if you don't specifically block scrolling of the outer container, it will scroll. That was the cause of your problem.
Then you want the sidebar itself to scroll, and the main content to (separately) scroll.
I have added to your code 3 style attributes, one for each of the 3 containers. I see you are carefully using classes, which is excellent: just put those styles into the relevant classes (I couldn't find the class for the main body text).
#sidebar_header {
top: 0;
text-align: center;
}
#sidebar_sub_header {
/* position: fixed; */
/* width: inherit; */
}
#sidebar_main_content {
overflow-y: scroll;
}
#sidebar_footer {
position: fixed;
bottom: 0;
width: inherit;
}
#sidebar {
width: 250px;
min-height: 100vh;
max-height: 100vh;
}
<link href="https://cdn.jsdelivr.net/npm/bootstrap#5.3.0-alpha1/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-GLhlTQ8iRABdZLl6O3oVMWSktQOp6b7In1Zl3/Jr59b6EGGoI1aFkw7cmDA6j6gD" crossorigin="anonymous">
<link rel="stylesheet" href="{{ url_for('static', filename='css/dashboard_test.css') }}" />
<div class="container-fluid" style="height:100%; overflow:hidden;">
<div class="row">
<div class="align-items-start text-center p-0 bg-dark text-white" id="sidebar" >
<div class="p-3">
<span class="fs-4" id="sidebar_heading">
Header
</span>
</div>
<hr>
<div class="p-3" id="sidebar_sub_header">
<ul class="nav nav-pills flex-column mb-auto">
<li class="nav-item">
<a href="#" class="nav-link active" aria-current="page">
Test 1
</a>
</li>
<li>
<a href="#" class="nav-link text-white">
Test 2
</a>
</li>
</ul>
</div>
<hr>
<div class="mb-auto p-3 bg-danger flex-fill" id="sidebar_main_content" style="height:100%; overflow-y: scroll;">
<!-- main content - scrollable -->
<ul class="nav flex-column mb-auto align-items-center">
<li class="nav-item">
<a href="#" data-bs-toggle="tooltip" data-bs-placement="right" data-bs-title="test tooltip">
<img src="https://cdn.pixabay.com/photo/2020/02/10/11/12/smiley-4836191_1280.png" class="rounded-circle" style="height:100px;width:100px">
</a>
</li>
<br>
<li class="nav-item">
<a href="#" data-bs-toggle="tooltip" data-bs-placement="right" data-bs-title="test tooltip">
<img src="https://cdn.pixabay.com/photo/2020/02/10/11/12/smiley-4836191_1280.png" class="rounded-circle" style="height:100px;width:100px">
</a>
</li>
<br>
<li class="nav-item">
<a href="#" data-bs-toggle="tooltip" data-bs-placement="right" data-bs-title="test tooltip">
<img src="https://cdn.pixabay.com/photo/2020/02/10/11/12/smiley-4836191_1280.png" class="rounded-circle" style="height:100px;width:100px">
</a>
</li>
<br>
<li class="nav-item">
<a href="#" data-bs-toggle="tooltip" data-bs-placement="right" data-bs-title="test tooltip">
<img src="https://cdn.pixabay.com/photo/2020/02/10/11/12/smiley-4836191_1280.png" class="rounded-circle" style="height:100px;width:100px">
</a>
</li>
<br>
<li class="nav-item">
<a href="#" data-bs-toggle="tooltip" data-bs-placement="right" data-bs-title="test tooltip">
<img src="https://cdn.pixabay.com/photo/2020/02/10/11/12/smiley-4836191_1280.png" class="rounded-circle" style="height:100px;width:100px">
</a>
</li>
<br>
<li class="nav-item">
<a href="#" data-bs-toggle="tooltip" data-bs-placement="right" data-bs-title="test tooltip">
<img src="https://cdn.pixabay.com/photo/2020/02/10/11/12/smiley-4836191_1280.png" class="rounded-circle" style="height:100px;width:100px">
</a>
</li>
<br>
<li class="nav-item">
<a href="#" data-bs-toggle="tooltip" data-bs-placement="right" data-bs-title="test tooltip">
<img src="https://cdn.pixabay.com/photo/2020/02/10/11/12/smiley-4836191_1280.png" class="rounded-circle" style="height:100px;width:100px">
</a>
</li>
<br>
<li class="nav-item">
<a href="#" data-bs-toggle="tooltip" data-bs-placement="right" data-bs-title="test tooltip">
<img src="https://cdn.pixabay.com/photo/2020/02/10/11/12/smiley-4836191_1280.png" class="rounded-circle" style="height:100px;width:100px">
</a>
</li>
<br>
<li class="nav-item">
<a href="#" data-bs-toggle="tooltip" data-bs-placement="right" data-bs-title="test tooltip">
<img src="https://cdn.pixabay.com/photo/2020/02/10/11/12/smiley-4836191_1280.png" class="rounded-circle" style="height:100px;width:100px">
</a>
</li>
<br>
<li class="nav-item">
<a href="#" data-bs-toggle="tooltip" data-bs-placement="right" data-bs-title="test tooltip">
<img src="https://cdn.pixabay.com/photo/2020/02/10/11/12/smiley-4836191_1280.png" class="rounded-circle" style="height:100px;width:100px">
</a>
</li>
<br>
</ul>
</div>
<div class="p-3" id="sidebar_footer">
<a href="#" class="btn btn-primary" id="add_bot_button" role="button" data-bs-toggle="tooltip" data-bs-placement="top" data-bs-title="Test tooltip">
Test Button
</a>
<br><br>
<div class="dropup-center dropup">
<a href="#" class="d-flex align-items-center text-white text-decoration-none dropdown-toggle" id="dropdownUser1" data-bs-toggle="dropdown" aria-expanded="false">
test text here 0000000000000000000000000
</a>
<ul class="dropdown-menu dropdown-menu-dark text-small shadow" aria-labelledby="dropdownUser1">
<li><a class="dropdown-item" href="#">Delete User Info</a></li>
<li><a class="dropdown-item" href="#">Logout</a></li>
</ul>
</div>
</div>
</div>
<div class="col bg-secondary text-white" id="main_content">
One of three columns
</div>
</div>
</div>
<script src="https://cdn.jsdelivr.net/npm/bootstrap#5.3.0-alpha1/dist/js/bootstrap.bundle.min.js" integrity="sha384-w76AqPfDkMBDXo30jS1Sgez6pr3x5MlQ1ZAGC+nuZB+EYdgRZgiwxhTBTkF7CXvN" crossorigin="anonymous"></script>

Related

How do I position my footer to absolutely bottom of screen

I have the following screen which uses a layout page. This view displays a card and apply the Layout page. How do I position the tags About, Services and Our Work to the bottom of the screen.
What I have tried:
<footer class="container space-1">
<div class="row align-items-md-center text-center">
#*<div class="col-md-3 mb-4 mb-md-0">
<a href="#" aria-label="Front">
<img class="brand" src="https://template.tritonexpress.co.za/Images/Triton.png" alt="logo" width="120" />
</a>
</div>*#
<div class="col-sm-10 col-md-6 mb-4 mb-sm-0">
<!-- Nav List -->
<ul class="nav nav-sm nav-x-0 justify-content-center text-md-center">
<li class="nav-item px-3">
<a class="nav-link" href="#">About</a>
</li>
<li class="nav-item px-3">
<a class="nav-link" href="#">Services</a>
</li>
<li class="nav-item px-3">
<a class="nav-link" href="#">Our work</a>
</li>
</ul>
<!-- End Nav List -->
</div>
<div class="col-sm-5 col-md-3 text-sm-right">
<!-- Social Networks -->
<ul class="list-inline mb-0">
<li class="list-inline-item">
<a class="btn btn-xs btn-icon btn-soft-secondary rounded-circle" href="#">
<i class="fab fa-facebook-f"></i>
</a>
</li>
<li class="list-inline-item">
<a class="btn btn-xs btn-icon btn-soft-secondary rounded-circle" href="#">
<i class="fab fa-google"></i>
</a>
</li>
<li class="list-inline-item">
<a class="btn btn-xs btn-icon btn-soft-secondary rounded-circle" href="#">
<i class="fab fa-twitter"></i>
</a>
</li>
<li class="list-inline-item">
<a class="btn btn-xs btn-icon btn-soft-secondary rounded-circle" href="#">
<i class="fab fa-github"></i>
</a>
</li>
</ul>
<!-- End Social Networks -->
</div>
</div>
</footer>
Try adding this :
<div class="footer fixed-bottom"></div>

Bootstrap navbar and gallery shortened width when in mobile view

So I have this weird problem with bootstrap navbar and gallery that it shows shorter on mobile view and not stretched to mobile view. On desktop version is ok and I dont have any of these problems. I have attached a screenshot and also put the code of the navbar and gallery slider down below. Ty !
Navbar :
<nav class="navbar navbar-custom navbar-expand-lg" style="height:60px !important;">
<a class="navbar-brand pull-bs-canvas-left " href="#"><i class="fa fa-bars"></i></a>
<div class="collapse navbar-collapse" id="navbarSupportedContent">
<ul class="navbar-nav mr-auto">
<li class="nav-item active">
<a class="navbar-brand" href="#"><img src="img/amazon.png"></a>
</li>
</ul>
<div style="width:88%; position:relative; right: 15px;">
<div class="input-group">
<div class="input-group-btn search-panel">
<button type="button" class="btn btn-default dropdown-toggle" data-toggle="dropdown" style="background-color:rgb(218, 218, 218);">
<span id="search_concept">All</span> <span class="caret"></span>
</button>
<ul class="dropdown-menu scrollable-dropdown" role="menu">
<li>Automotive Accesories</li>
<li>Cell Phone Accesories</li>
<li>Computer Accesories</li>
<li>Health and Personal Care</li>
<li>Automotive Accesories</li>
<li>Cell Phone Accesories</li>
<li>Computer Accesories</li>
<li>Health and Personal Care</li>
<li>Automotive Accesories</li>
<li>Cell Phone Accesories</li>
<li>Computer Accesories</li>
<li>Health and Personal Care</li>
<li>Automotive Accesories</li>
<li>Cell Phone Accesories</li>
<li>Computer Accesories</li>
<li>Health and Personal Care</li>
</ul>
</div>
<input type="hidden" name="search_param" value="all" id="search_param">
<input type="text" class="form-control" name="x" id="search" placeholder="Search">
<span class="input-group-btn">
<button class="btn btn-default" type="button" style="background-color: #F3A847;">
<i class="fas fa-search" style="color: black;"></i>
</button>
</span>
</div>
</div>
</div>
<ul class="navbar-nav ml-auto" style="margin-top:10px;">
<li class="nav-item dropdown nav-itemspan">
<a class="nav-link dropdown-toggle" href="#" id="navbarDropdown" role="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
<span>EN</span><i style="font-size:0.903em" class="fal fa-globe"></i>
</a>
<div class="dropdown-menu" aria-labelledby="navbarDropdown">
<a class="dropdown-item" href="#">English</a>
<a class="dropdown-item" href="#">Hindi</a>
</div>
</li>
<li class="nav-item nav-itemspan">
<a class="nav-link" href="sign_in.html"><span style="">Hello. Sign in</span><p style="font-size:14px; margin-top:0px;"><b>Accounts & Lists</b></p></a>
</li>
<li class="nav-item nav-itemspan">
<a class="nav-link" href="#"><span style="">Returns</span><p style="font-size:14px; margin-top:0px;"><b>& Orders</b></p></a>
</li>
<li class="nav-item nav-itemspan">
<a class="nav-link" href="#"><span style="">Try</span><p style="font-size:14px; margin-top:0px;"><b>Prime</b></p></a>
</li>
<li class="nav-item">
<a class="nav-link" href="#"><img src="img/cart_0.png" style="margin-top:2px;"></a>
</li>
</ul>
</nav>
<nav class="navbar navbar-custom navbar-expand-lg" style="position:relative; bottom:10px; height: 50px;">
<div class="collapse navbar-collapse" id="navbarSupportedContent">
<ul class="navbar-nav mr-auto" style="margin-top:30px;">
<li class="nav-item">
<i class="fal fa-map-marker-alt fa-lg" style="color:white; margin-top:18px;"></i>
</li>
<li class="nav-item nav-itemspan", style="">
<a class="nav-link" href="#"><span style="font-weight:bold; color:white !important;">Hello</span><p style="font-size:14px; position:relative; bottom:6px;"><b>Select your address</b></p></a>
</li>
<li class="nav-item nav-itemspan" style="margin-left:24px;">
<a class="nav-link" href="sale_page.html"><p style="font-size:14px; margin-top:0px; color: #bfbfbf;">Amazon Pay</p></a>
</li>
<li class="nav-item nav-itemspan">
<a class="nav-link" href="#"><p style="font-size:14px; margin-top:0px; color: #bfbfbf;">Today's deals</p></a>
</li>
<li class="nav-item nav-itemspan">
<a class="nav-link" href="#"><p style="font-size:14px; margin-top:0px; color: #bfbfbf;">Best sellers</p></a>
</li>
<li class="nav-item nav-itemspan">
<a class="nav-link" href="#"><p style="font-size:14px; margin-top:0px; color: #bfbfbf;">Mobiles</p></a>
</li>
<li class="nav-item nav-itemspan">
<a class="nav-link" href="#"><p style="font-size:14px; margin-top:0px; color: #bfbfbf;">Today's deals</p></a>
</li>
<li class="nav-item nav-itemspan">
<a class="nav-link" href="#"><p style="font-size:14px; margin-top:0px; color: #bfbfbf;">Best sellers</p></a>
</li>
<li class="nav-item nav-itemspan">
<a class="nav-link" href="#"><p style="font-size:14px; margin-top:0px; color: #bfbfbf;">Mobiles</p></a>
</li>
<li class="nav-item nav-itemspan">
<a class="nav-link" href="#"><p style="font-size:14px; margin-top:0px; color: #bfbfbf;">Today's deals</p></a>
</li>
<li class="nav-item nav-itemspan">
<a class="nav-link" href="#"><p style="font-size:14px; margin-top:0px; color: #bfbfbf;">Best sellers</p></a>
</li>
<li class="nav-item nav-itemspan">
<a class="nav-link" href="#"><p style="font-size:14px; margin-top:0px; color: #bfbfbf;">Mobiles</p></a>
</li>
<li class="nav-item nav-itemspan">
<a class="nav-link" href="#"><p style="font-size:14px; margin-top:0px; color: #bfbfbf;">Today's deals</p></a>
</li>
<li class="nav-item nav-itemspan">
<a class="nav-link" href="#"><p style="font-size:14px; margin-top:0px; color: #bfbfbf;">Best sellers</p></a>
</li>
</ul>
<ul class="navbar-nav ml-auto">
<img src="img/jackpot.jpg" style="position:relative; left:35px;">
</ul>
</div>
</nav>
Carousel :
<div id="carouselExampleControls" class="carousel slide" data-ride="carousel">
<div class="carousel-inner" style="position:relative; bottom:10px;">
<div class="carousel-item active">
<img src="https://via.placeholder.com/1500x690" class="d-block w-690" alt="...">
</div>
<div class="carousel-item">
<img src="https://via.placeholder.com/1500x690" class="d-block w-690" alt="...">
</div>
<div class="carousel-item">
<img src="https://via.placeholder.com/1500x690" class="d-block w-690" alt="...">
</div>
</div>
<a class="carousel-control-prev" href="#carouselExampleControls" role="button" data-slide="prev">
<span class="carousel-control-prev-icon" aria-hidden="true"></span>
<span class="sr-only">Previous</span>
</a>
<a class="carousel-control-next" href="#carouselExampleControls" role="button" data-slide="next">
<span class="carousel-control-next-icon" aria-hidden="true"></span>
<span class="sr-only">Next</span>
</a>
</div>
Also, custom carousel css :
.carousel-inner img {
margin: auto;
}
.carousel-control-prev {
margin-left: 80px;
}
.carousel-control-next {
margin-right: 80px;
}
I have found the solution. Its a bit of a faster one which I dont highly recommend but if you are in a pinch like me you should use it. Use width: and the size that you need for your responsive view and after the size put !important;

Positioning images within grid

I'm trying to get the flag icons in the header closer together (I've attached a picture of the relevant section). I've switched around CSS values, but so far no success. I'm using Bootstrap as well.
Here is the relevant code:
.flag {
height: 25px;
width: 25px;
padding: 0px;
}
<nav class="navbar navbar-expand-sm navbar-light bg-light mb-3">
<div class="container">
<a class="navbar-brand" href="#">
<img src="./images/logo/LOGO DARKGLOBE.png" height="100px" width="150px">
</a>
<ul class="navbar-nav align-items-center">
<li class="nav-item">
<a class="nav-link" href="./home.html">Home</a>
</li>
<li class="nav-item dropdown">
<a class="nav-link dropdown-toggle active" data-toggle=dropdown href="#">Empresa</a>
<div class="dropdown-menu">
Quem somos
Missao & Valores
Ambiente & Sustentabilidade
Higiene, Seguranc & Saude
Emprego & Igualdade de Oportunidades
</div>
</li>
<li class="nav-item">
<a class="nav-link" href="#">Portfolio</a>
</li>
<li class="nav-item">
<a class="nav-link" href="#">Projectos em Curso</a>
</li>
<li class="nav-item">
<a class="nav-link" href="./contactos.html">Contacto</a>
</li>
<li class="nav-item">
<div class="row">
<div class="col">
<a href="#">
<img class="flag" src="./images/flags/portugal-flag-button-round-icon-256.png">
</a>
</div>
<div class="col">
<a href="#">
<img class="flag" src="./images/flags/spain-flag-button-round-icon-256.png">
</a>
</div>
</div>
<div class="row">
<div class="col">
<a href="#">
<img class="flag" src="./images/flags/france-flag-button-round-icon-256.png">
</a>
</div>
<div class="col">
<a href="#">
<img class="flag" src="./images/flags/united-kingdom-flag-button-round-icon-256.png">
</a>
</div>
</div>
</li>
</ul>
</div>
</nav>
I'm guessing this is a fairly straightforward fix, but this is the first time I'm creating a website from scratch. The little I know about web design I've gleamed from reading here and there. Thanks in advance!
Header

Bootstrap 4 navbar justify-content-end not working in IE10

I'm having trouble with Bootstrap 4 in IE10; I made a navbar with a phone number/linked-in link on the right using justify-content-end which works perfectly until I checked it in IE10, the website is required to work on IE10 specifically so it is a problem. The code is as follows:
<nav class="navbar navbar-expand-md navbar justify-content-center bigText blueBG">
<!-- Dropdown toggler for small devices -->
<button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbar">
<span class="fas fa-bars text-white"></span>
</button>
<!-- Links -->
<div class="navbar-collapse collapse w-100 justify-content-center ml-5" id="navbar">
<a class="nav-item nav-link text-white link" href="home">Home</a>
<a class="nav-item nav-link text-white link" href="#">#</a>
<a class="nav-item nav-link text-white link" href="tool">Tool</a>
<a class="nav-item nav-link text-white link" href="contact">Contact</a>
<a class="nav-item nav-link text-white link" id="finalLink" href="documentatie">Documentatie</a>
</div>
<div class="navbar-collapse collapse justify-content-end">
<a href="tel:+0123456789">
<i class="fas fa-phone text-white"></i>
</a>
<a href="https://www.linkedin.com/">
<i class="fab fa-linkedin text-white ml-2"></i>
</a>
</div>
The problem is that the navbar just cuts off near the right end of the page, after that it's just the white background and a blue square.
Fixed it! I omitted the w-100 class and changed the justify-content-center to justify-content-end:
<nav class="navbar navbar-expand-md navbar bigText blueBG">
<!-- Dropdown toggler for small devices -->
<button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbar">
<span class="fas fa-bars text-white"></span>
</button>
<!-- Links -->
<div class="navbar-collapse collapse justify-content-end ml-5" id="navbar">
<a class="nav-item nav-link text-white link" href="home">Home</a>
<a class="nav-item nav-link text-white link" href="#">#</a>
<a class="nav-item nav-link text-white link" href="tool">Tool</a>
<a class="nav-item nav-link text-white link" href="contact">Contact</a>
<a class="nav-item nav-link text-white link" id="finalLink" href="documentatie">Documentatie</a>
</div>
<div class="navbar-collapse collapse justify-content-end">
<a href="tel:+0123456789">
<i class="fas fa-phone text-white"></i>
</a>
<a href="https://www.linkedin.com">
<i class="fab fa-linkedin text-white ml-2"></i>
</a>
</div>
Bootstrap 4 only partially supports IE 10/11. Your problem here could be the "justify-content" classes which, according to this Can I Use... isn't supported properly. Try removing them and see if that works for your overflow problem. If not, please inform us of what changed.
I hope this will helpful for you,
/*!
* IE10 viewport hack for Surface/desktop Windows 8 bug
* Copyright 2014-2017 The Bootstrap Authors
* Copyright 2014-2017 Twitter, Inc.
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
*/
// See the Getting Started docs for more information:
// https://getbootstrap.com/getting-started/#support-ie10-width
(function () {
'use strict'
if (navigator.userAgent.match(/IEMobile\/10\.0/)) {
var msViewportStyle = document.createElement('style')
msViewportStyle.appendChild(
document.createTextNode(
'#-ms-viewport{width:auto!important}'
)
)
document.head.appendChild(msViewportStyle)
}
}())
body {
padding-top: 2rem;
}
.container {
padding-bottom: 1.5rem;
}
.bd-example {
padding: 1.5rem;
margin-right: 0;
margin-bottom: 0;
margin-left: 0;
border-width: .2rem;
margin: 1rem -15px;
border: solid #f7f7f9;
}
<div class="container">
<div class="row">
<div class="col-12">
<h2 class="text-center">Horizontal: Base Nav</h2>
<div class="bd-example">
<ul class="nav">
<li class="nav-item">
<a class="nav-link active" href="#">Active</a>
</li>
<li class="nav-item">
<a class="nav-link" href="#">Link</a>
</li>
<li class="nav-item">
<a class="nav-link" href="#">Link</a>
</li>
<li class="nav-item">
<a class="nav-link disabled" href="#">Disabled</a>
</li>
</ul>
</div>
</div>
</div>
</div>
<div class="container">
<div class="row">
<div class="col-12">
<h2 class="text-center">Horizontal: Justify Content Center</h2>
<div class="bd-example">
<ul class="nav justify-content-center">
<li class="nav-item">
<a class="nav-link active" href="#">Active</a>
</li>
<li class="nav-item">
<a class="nav-link" href="#">Link</a>
</li>
<li class="nav-item">
<a class="nav-link" href="#">Link</a>
</li>
<li class="nav-item">
<a class="nav-link disabled" href="#">Disabled</a>
</li>
</ul>
</div>
</div>
</div>
</div>
<div class="container">
<div class="row">
<div class="col-12">
<h2 class="text-center">Horizontal: Justify Content End</h2>
<div class="bd-example">
<ul class="nav justify-content-end">
<li class="nav-item">
<a class="nav-link active" href="#">Active</a>
</li>
<li class="nav-item">
<a class="nav-link" href="#">Link</a>
</li>
<li class="nav-item">
<a class="nav-link" href="#">Link</a>
</li>
<li class="nav-item">
<a class="nav-link disabled" href="#">Disabled</a>
</li>
</ul>
</div>
</div>
</div>
</div>
<div class="container">
<div class="row">
<div class="col-12">
<h2 class="text-center">Vertical: Flex Column</h2>
<div class="bd-example">
<ul class="nav flex-column">
<li class="nav-item">
<a class="nav-link active" href="#">Active</a>
</li>
<li class="nav-item">
<a class="nav-link" href="#">Link</a>
</li>
<li class="nav-item">
<a class="nav-link" href="#">Link</a>
</li>
<li class="nav-item">
<a class="nav-link disabled" href="#">Disabled</a>
</li>
</ul>
</div>
</div>
</div>
</div>
<div class="container">
<div class="row">
<div class="col-12">
<h2 class="text-center">Base Nav: Tabs</h2>
<div class="bd-example">
<ul class="nav nav-tabs">
<li class="nav-item">
<a class="nav-link active" href="#">Active</a>
</li>
<li class="nav-item">
<a class="nav-link" href="#">Link</a>
</li>
<li class="nav-item">
<a class="nav-link" href="#">Link</a>
</li>
<li class="nav-item">
<a class="nav-link disabled" href="#">Disabled</a>
</li>
</ul>
</div>
</div>
</div>
</div>
<div class="container">
<div class="row">
<div class="col-12">
<h2 class="text-center">Base Nav: Pills</h2>
<div class="bd-example">
<ul class="nav nav-pills">
<li class="nav-item">
<a class="nav-link active" href="#">Active</a>
</li>
<li class="nav-item">
<a class="nav-link" href="#">Link</a>
</li>
<li class="nav-item">
<a class="nav-link" href="#">Link</a>
</li>
<li class="nav-item">
<a class="nav-link disabled" href="#">Disabled</a>
</li>
</ul>
</div>
</div>
</div>
</div>
<div class="container">
<div class="row">
<div class="col-12">
<h2 class="text-center">Base Nav: Fill and justify</h2>
<div class="bd-example">
<ul class="nav nav-pills nav-fill">
<li class="nav-item">
<a class="nav-link active" href="#">Active</a>
</li>
<li class="nav-item">
<a class="nav-link" href="#">Link</a>
</li>
<li class="nav-item">
<a class="nav-link" href="#">Link</a>
</li>
<li class="nav-item">
<a class="nav-link disabled" href="#">Disabled</a>
</li>
</ul>
</div>
</div>
</div>
</div>
Just remove "mr-auto" or "m-auto" from the div just above .
<div class="collapse navbar-collapse justify-content-end" id="navbarSupportedContent" >
<ul class="navbar-nav">
<li class="nav-item active">
<a class="nav-link" href="#">Home <span class="sr-only">(current)</span></a>
</li>
<li class="nav-item">
<a class="nav-link" href="#">Link</a>
</li>
</ul>
</div>
</nav>

How can I add black navbar to the existing transparent navbar?

Does anyone have an idea how can I add black navbar below "some text" in navbar shown below? It doesn't matter how this navbar will look like I would like to have it just across the entire width of the screen below the string Some text. Any ideas?
<nav class="navbar navbar-expand-lg fixed-top navbar-transparent" color-on-scroll="500">
<div class="container">
<div class="navbar-translate">
<button class="navbar-toggler navbar-burger" type="button" data-toggle="collapse" data-target="#navbarToggler"
aria-controls="navbarTogglerDemo02" aria-expanded="false" aria-label="Toggle navigation"
(click)="sidebarToggle()">
<span class="navbar-toggler-bar"></span>
<span class="navbar-toggler-bar"></span>
<span class="navbar-toggler-bar"></span>
</button>
</div>
<div class="collapse navbar-collapse" id="navbarToggler">
<div class="outer">
<div class="middle">
<div class="inner">
<br><br><br>
<h6 align="center">Some text</h6>
<div class="black-bar" style="width: 100vw; height: 80px; background-color: white"></div>
</div>
</div>
</div>
<ul class="navbar-nav ml-auto">
<li class="nav-item" *ngIf="!isDocumentation() && !isMain()">
<a class="nav-link" rel="tooltip" title="Follow us on Twitter" data-placement="bottom"
href="https://twitter.com/CreativeTim" target="_blank">
<i class="fa fa-twitter"></i>
<p class="d-lg-none">Twitter</p>
</a>
</li>
<li class="nav-item" *ngIf="!isDocumentation() && !isMain()">
<a class="nav-link" rel="tooltip" title="Like us on Facebook" data-placement="bottom"
href="https://www.facebook.com/CreativeTim" target="_blank">
<i class="fa fa-facebook-square"></i>
<p class="d-lg-none">Facebook</p>
</a>
</li>
<li class="nav-item" *ngIf="!isDocumentation() && !isMain()">
<a class="nav-link" rel="tooltip" title="Follow us on Instagram" data-placement="bottom"
href="https://www.instagram.com/CreativeTimOfficial" target="_blank">
<i class="fa fa-instagram"></i>
<p class="d-lg-none">Instagram</p>
</a>
</li>
<li class="nav-item" *ngIf="!isDocumentation() && !isMain()">
<a class="nav-link" rel="tooltip" title="Star on GitHub" data-placement="bottom"
href="https://www.github.com/CreativeTimOfficial/pk2-angular" target="_blank">
<i class="fa fa-github"></i>
<p class="d-lg-none">GitHub</p>
</a>
</li>
<li class="nav-item" *ngIf="!isDocumentation()">
<a href="http://pk2-angular.creative-tim.com/documentation/tutorial" class="nav-link" target="_blank"><i
class="nc-icon nc-book-bookmark"></i> Documentation</a>
</li>
<li class="nav-item" *ngIf="!isHome()">
<a [routerLink]="['/home']" *ngIf="!isDocumentation()" class="nav-link"><i class="nc-icon nc-layout-11"></i>Components</a>
<a [routerLink]="['/home']" *ngIf="isDocumentation()" class="nav-link">Back to Kit</a>
</li>
<li class="nav-item" *ngIf="isDocumentation()">
<a href="https://github.com/creativetimofficial/pk-free-angular/issues?ref=pk2-free-local" target="_blank"
class="nav-link">Have an issue</a>
</li>
</ul>
</div>
</div>
</nav>
It looks in this way after adding <div class="black-bar" style="width: 100vw; height: 80px; background-color: white"></div> after h6:
You could put a div underneath the < h6 > tag. Something like this..
<div class="black-bar" style="height:100px; background-color: black; position:absolute; left:0; right:0;"></div>
Hope this works for you!
If you're just needing a black line under the "some text", why not do something like:
h6 {
width: 100%;
text-align: center;
border-bottom: solid 80px black;
}