Closed. This question is not reproducible or was caused by typos. It is not currently accepting answers.
This question was caused by a typo or a problem that can no longer be reproduced. While similar questions may be on-topic here, this one was resolved in a way less likely to help future readers.
Closed 4 years ago.
Improve this question
I am trying to make it so that when I scroll down a page, my navbar is fixed at the top, I have tried so many different things and I'm not sure what I am doing wrong. Please see my code below for the nav.
.navbar {
padding: .8rem;
}
.navbar-nav li {
padding-right: 25px;
}
.nav-link {
font-size: 1.1em;
}
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.1.0/css/bootstrap.min.css">
<!--Navigation-->
<nav class="navbar navbar-expand-md navbar-light bg-light navbar-fixed-top" id="navbar">
<div class="container-fluid">
<a class="navbar-brand" href="index.html"><img src="#"></a>
<button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarResponsive">
<span class="navbar-toggler-icon"></span>
</button>
<div class="collapse navbar-collapse" id="navbarResponsive">
<ul class="nav navbar-nav nav-pills ml-auto">
<li class=nav-item active>
<a class="nav-link" href="#home">Home</a>
</li>
<li class=nav-item>
<a class="nav-link" href="#gallery">Gallery</a>
</li>
</li>
<li class=nav-item>
<a class="nav-link" href="#aboutme">About</a>
</li>
<li class=nav-item>
<a class="nav-link" href="#contact">Contact</a>
</li>
</ul>
</div>
</nav>
.navbar {
padding: .8rem;
}
.navbar-nav li {
padding-right: 25px;
}
.nav-link {
font-size: 1.1em;
}
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.1.0/css/bootstrap.min.css">
<!--Navigation-->
<nav class="navbar sticky-top navbar-expand-md navbar-light bg-light navbar-fixed-top" id="navbar">
<div class="container-fluid">
<a class="navbar-brand" href="index.html"><img src="#"></a>
<button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarResponsive">
<span class="navbar-toggler-icon"></span>
</button>
<div class="collapse navbar-collapse" id="navbarResponsive">
<ul class="nav navbar-nav nav-pills ml-auto">
<li class=nav-item active>
<a class="nav-link" href="#home">Home</a>
</li>
<li class=nav-item>
<a class="nav-link" href="#gallery">Gallery</a>
</li>
</li>
<li class=nav-item>
<a class="nav-link" href="#aboutme">About</a>
</li>
<li class=nav-item>
<a class="nav-link" href="#contact">Contact</a>
</li>
</ul>
</div>
</nav>
<div style="height: 5000px; background-color: red; width: 500px;"></div>
The navbar can have the class .sticky-top added to it in order to easily fix it to the top of the page. Support for this is widespread, with the exclusion of Internet Explorer. As an alternative, fixed-top can be used, but this may cause some overlapping issues if not supplemented by additional CSS.
A solid red div element has been included in order to make the page large enough to scroll through.
I have now developed the following issue, here is my full HTML.
When i scroll i seem to be losing the toolbar when it reaches a certain point in the document?
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<title>Unique Portraits</title>
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/css/bootstrap.min.css">
<link href="styles.css" rel="stylesheet">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/ekko-lightbox/5.3.0/ekko-lightbox.css">
</head>
<body data-spy="scroll" data-target="#navbar" data-offset="50">
<!--Navigation-->
<nav class="navbar sticky-top navbar-expand-md navbar-light bg-light navbar-fixed-top" id="navbar">
<div class="container-fluid">
<a class="navbar-brand" href="index.html"><img src="#"></a>
<button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarResponsive">
<span class="navbar-toggler-icon"></span>
</button>
<div class="collapse navbar-collapse" id="navbarResponsive">
<ul class="nav navbar-nav nav-pills ml-auto">
<li class=nav-item active>
<a class="nav-link" href="#home">Home</a>
</li>
<li class=nav-item>
<a class="nav-link" href="#gallery">Gallery</a>
</li>
</li>
<li class=nav-item>
<a class="nav-link" href="#aboutme">About</a>
</li>
<li class=nav-item>
<a class="nav-link" href="#contact">Contact</a>
</li>
</ul>
</div>
</nav>
<!-- Image SLider & Indicators -->
<div id="slides" class="carousel slide" data-ride="carousel">
<ul class="carousel-indicators">
<li data-target="#slides" data-slide-to="0" class="active"></li>
<li data-target="#slides" data-slide-to="1"></li>
<li data-target="#slides" data-slide-to="2"></li>
</ul>
<div class="carousel-inner" id="home">
<div class="carousel-item active">
<img src="img/warm.jpg" >
</div>
<div class="carousel-item">
<img src="img/landscape2.jpg">
</div>
<div class="carousel-item">
<img src="img/river.jpeg">
</div>
</div>
<div class="carousel-caption">
<h1 class="display-2">ALIAS PHOTOGRAPHY</h1>
<h3>My Journey Through Nature...</h3>
<div class="showcase-buttons">
<!-- <button type="button" class="btn btn-outline-light btn-lg mr-1">VIEW DEMO</button> -->
<button type="button" class="btn btn-primary btn-lg">VIEW GALLERY</button>
</div>
</div>
<!-- Arrows -->
<a class="carousel-control-prev" href="#slides" 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 btn-lg" href="#slides" role="button" data-slide="next">
<span class="carousel-control-next-icon" aria-hidden="true"></span>
<span class="sr-only">Next</span>
</a>
</div>
<!-- Jumbotron -->
<div class="container-fluid">
<div class="row jumbotron">
<div class="col-12 text-center">
<p class="lead ml-5 mr-5">Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has </p>
<button type="button" class="btn btn-outline-secondary btn-lg text-center">Find out more</button>
</div>
</div>
</div>
<!-- Gallery -->
<div class="container gallery" id="gallery">
<div class="row">
<div class="col-md-3 " id="cols">
<img src="img/yellow.jpeg" class="img-fluid rounded">
</div>
<div class="col-md-3 " id="cols">
<img src="img/yellow.jpeg" class="img-fluid rounded">
</div>
<div class="col-md-3 " id="cols">
<img src="img/yellow.jpeg" class="img-fluid rounded">
</div>
<div class="col-md-3 " id="cols">
<img src="img/yellow.jpeg" class="img-fluid rounded">
</div>
</div>
<div class="row">
<div class="col-md-3 " id="cols">
<img src="img/yellow.jpeg" class="img-fluid rounded">
</div>
<div class="col-md-3 " id="cols">
<img src="img/yellow.jpeg" class="img-fluid rounded">
</div>
<div class="col-md-3 " id="cols">
<img src="img/yellow.jpeg" class="img-fluid rounded">
</div>
<div class="col-md-3 " id="cols">
<img src="img/yellow.jpeg" class="img-fluid rounded">
</div>
</div>
</div>
<!-- About -->
<div class="container-fluid about" id="aboutme">
<div class=row padding>
<div class="col-xs-12 col-sm-12 col-md-6 col-lg-9 col-xl-9 text-light text-center ">
<h2 class="display-3 mt-4">A bit about me</h2>
<p class="lead ml-5 mr-5">Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has</p>
<button type="button" class="btn btn-outline-primary btn-lg m-1 mb-4">Why not get in touch?</button>
<br>
</div>
<div class="col-xs-12 col-sm-12 col-md-6 col-lg-3 col-xl-3 aboutimg">
<img src="img/landscapeold.jpeg">
</div>
</div>
</div>
<!-- Connect -->
<div class="container-fluid">
<div class="row jumbotron text-center m-0">
<div class="col-12">
<h2 class="display-3">Connect</h1>
</div>
<div class="col-12 social padding">
<i class="fab fa-facebook"></i>
<i class="fab fa-twitter"></i>
<i class="fab fa-google-plus-g"></i>
<i class="fab fa-instagram"></i>
<i class="fab fa-youtube"></i>
</div>
</div>
</div>
<!-- Footer -->
<footer>
<div class="container-fluid padding text-center" id="contact">
<div class="row text-light pt-4">
<div class="col-6 addresscol">
<hr class="light">
<div>
<p><i class="fa fa-envelope mr-3 mt-3 icon offset-4"></i>email#emaildomain.com </p>
<p><i class="fa fa-phone mr-3 icon offset-4"></i>+12 34567 891</p>
<p><i class="fa fa-map-marker mr-4 icon offset-4"></i>123 Same Street</p>
<div>
<p><i class="offset-4 mr-5"></i>County</p>
<p><i class="offset-4 mr-5"></i>Town</p>
<p class="pml"><i class="offset-4 mr-5 mb-1"></i>Postcode</p>
</div>
</div>
<button type="button" class="btn btn-outline-light btn-lg mt-4 offset-">Download Résumé</button>
</div>
<!-- Start of Form -->
<div class="col-6">
<h2 class="pb-3 align-centre display-4"><i class="fas fa-envelope mr-2"></i>
Drop a Line
</h2>
<div>
<h4 class="display-5 formpadding">
Dont hesitate to get in touch
</h4>
</div>
<div data-form-type="form">
<div class="row">
<div class="col-md-6 formpadding">
<input type="text" class="form-control input formfirst" name="name" data-form-field="Name" placeholder="Your Name">
</div>
<div class="col-md-6 formpadding">
<input type="text" class="form-control input formphone" name="phone" data-form-field="Phone" placeholder="Phone">
</div>
<div class="col-md-12 formpadding" data-for="email">
<input type="text" class="form-control input" name="email" data-form-field="Email" placeholder="Email">
</div>
<div class="col-md-12 formpadding" data-for="message">
<textarea class="form-control input" name="message" rows="3" data-form-field="Message" placeholder="Message"></textarea>
</div>
<div class="input-group-btn col-md-12" style="margin-top: 10px;">
<button href="" type="submit" class="btn btn-primary btn-form">SEND MESSAGE</button>
</div>
</div>
</form>
</div>
</div>
<!-- End of Form -->
</div>
</div>
</div>
<!-- Copyright -->
<div class="container-fluid copyright">
<hr class="bg-light">
<p class="lead">© domainname.com</p>
</div>
</footer>
<!-- JavaScript's -->
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.12.9/umd/popper.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/js/bootstrap.min.js"></script>
<script src="https://use.fontawesome.com/releases/v5.0.8/js/all.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/ekko-lightbox/5.3.0/ekko-lightbox.js"></script>
<script src="bootstrap-lightbox.js"></script>
</body>
</html>
Related
I am using Bootstrap 5, trying to make responsive card ads. left card. For some reason, the sticky-top won't work.
I'm trying to create a sticky sidebar on the left. The sidebar menu is inside a grid column. I'm using the sticky-top class as shown in this question, but it still doesn't work.
Here is my code:Here is my code; I am not aware of any possible collisions with sticky-top.
<!Docktype html>
<html dir="ltr">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/bootstrap/5.2.3/css/bootstrap.min.css">
<title>Selda</title>
</head>
<body class="bg-light d-flex flex-column min-vh-100" data-new-gr-c-s-check-loaded="8.904.0" data-gr-ext-installed="">
<nav class="navbar navbar-expand-lg bg-body-tertiary">
<div class="container">
<a class="navbar-brand" href="#">Selda</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 me-auto mb-2 mb-lg-0">
<li class="nav-item">
<a class="nav-link" href="">Home</a>
</li>
<li class="nav-item">
<a class="nav-link" href="">Products</a>
</li>
<li class="nav-item">
<a class="nav-link" href="">Counselings</a>
</li>
<li class="nav-item">
<a class="nav-link" href="#">Learning</a>
</li>
<li class="nav-item">
<a class="nav-link" href="">About-US</a>
</li>
<li class="nav-item">
<a class="nav-link" href="">Contact-US</a>
</li>
</ul>
<ul class="navbar-nav mb-2 mb-lg-0">
<li class="nav-item">
<a class="nav-link" href="#">Login</a>
</li>
<li class="nav-item">
<a class="nav-link" href="#">Register</a>
</li>
</ul>
</div>
</div>
</nav>
<div class="container min-vh-100">
<div class="row">
<div class="col-lg-8 mb-3">
<div class="card">
<div class="card-header" style="height: 90px"></div>
<div class="card-body">
<div class="d-block d-md-flex mb-3">
<div style="width:115px; margin-top:-75px">
<img src="https://i.stack.imgur.com/vRDsY.png" class="rounded-circle img-thumbnail">
<div class="text-center">
<span class="badge bg-success">Online</span>
</div>
</div>
<h1 class="h5">
<i class="fa-solid fa-circle-check text-success"></i>
John Sina
</h1>
</div>
</div>
</div>
</div>
<div class="col-lg-4 mb-3">
<div class="menu sticky-top">
<div class="card">
<div class="card-body">
<h6 class="card-title">Plan</h6>
</div>
<ul class="list-group">
<li class="list-group-item p-0 align-items-center">
<a class="d-flex justify-content-between list-group-item list-group-item-action border-0" href="#">
<div>
<i class="fa-solid fa-file-pdf"></i>
<span>Download PDF</span>
</div>
<span class="badge bg-primary rounded-pill">Free</span>
</a>
</li>
<li class="list-group-item p-0 align-items-center">
<a class="d-flex justify-content-between list-group-item list-group-item-action border-0" href="#">
<div>
<i class="fa-solid fa-photo-film"></i>
<span>Download Video</span>
</div>
<span class="badge bg-primary rounded-pill">85,000 $</span>
</a>
</li>
<li class="list-group-item p-0 align-items-center">
<a class="d-flex justify-content-between list-group-item list-group-item-action border-0" href="#">
<div>
<i class="fa-solid fa-book"></i>
<span>Download Word</span>
</div>
<span class="badge bg-primary rounded-pill">Free</span>
</a>
</li>
</ul>
<div class="card-body">
<button class="btn btn-success btn-lg w-100">Payment</button>
</div>
</div>
</div>
</div>
</div>
<div class="row">
<div class="col-lg-4 mb-3">
<div class="card">
<div class="card-body">
<h6 class="card-title">About me</h6>
<p>Text</p>
</div>
</div>
</div>
<div class="col-lg-4 mb-3">
<div class="card">
<div class="card-body">
<h6 class="card-title">My Video</h6>
<video poster="https://i.stack.imgur.com/vRDsY.png" controls="" class="w-100" __idm_id__="1286145">
<source src="http://localhost:8000/storage/videos/counselings/1674029169.mp4" type="video/mp4">
</video>
</div>
</div>
</div>
</div>
</div>
<script src="https://cdnjs.cloudflare.com/ajax/libs/bootstrap/5.2.3/js/bootstrap.bundle.min.js "></script>
</body>
</html>
The menu div is the one I'd like to stick to the top as the user scrolls down.
It looks like the issue is that the sticky-top class is not being applied to the correct element. In your code, it is being applied to the navbar element, but it should be applied to the sidebar column that you want to make sticky.
Try adding the sticky-top class to the col-lg-4 element that contains the sidebar menu, like this:
<div class="col-lg-4 mb-3 sticky-top">
Also make sure that the parent element of that sidebar column has a position property set to relative, so that the sticky element can be positioned relatively to it.
<div class="row" style="position:relative">
You may also add a top property to the sticky element for better positioning.
<div class="col-lg-4 mb-3 sticky-top" style="top:50px">
This should make the sidebar menu sticky on the left as you scroll down the page.
The problem is that elements only stick to their parent element, so the menu stays within the column. You should separate your page to two large columns: one for all the other rows/columns and the other for your sidebar that will stay sticked to the top. Try this (although you may have to change some padding/margins due to nested rows):
<div class="container min-vh-100">
<div class="row">
<div class="col-lg-8 mb-3">
<div class="row">
<div class="col-12"></div>
<div class="card">
<div class="card-header" style="height: 90px"></div>
<div class="card-body">
<div class="d-block d-md-flex mb-3">
<div style="width:115px; margin-top:-75px">
<img src="https://i.stack.imgur.com/vRDsY.png" class="rounded-circle img-thumbnail">
<div class="text-center">
<span class="badge bg-success">Online</span>
</div>
</div>
<h1 class="h5">
<i class="fa-solid fa-circle-check text-success"></i>
John Sina
</h1>
</div>
</div>
</div>
</div>
<div class="row">
<div class="col-6">
<div class="card">
<div class="card-body">
<h6 class="card-title">About me</h6>
<p>Text</p>
</div>
</div>
</div>
<div class="col-6">
<div class="card">
<div class="card-body">
<h6 class="card-title">My Video</h6>
<video poster="https://i.stack.imgur.com/vRDsY.png" controls="" class="w-100" __idm_id__="1286145">
<source src="http://localhost:8000/storage/videos/counselings/1674029169.mp4" type="video/mp4">
</video>
</div>
</div>
</div>
</div>
</div>
<div class="col-lg-4 mb-3">
<div class="menu sticky-top">
<div class="card">
<div class="card-body">
<h6 class="card-title">Plan</h6>
</div>
<ul class="list-group">
<li class="list-group-item p-0 align-items-center">
<a class="d-flex justify-content-between list-group-item list-group-item-action border-0" href="#">
<div>
<i class="fa-solid fa-file-pdf"></i>
<span>Download PDF</span>
</div>
<span class="badge bg-primary rounded-pill">Free</span>
</a>
</li>
<li class="list-group-item p-0 align-items-center">
<a class="d-flex justify-content-between list-group-item list-group-item-action border-0" href="#">
<div>
<i class="fa-solid fa-photo-film"></i>
<span>Download Video</span>
</div>
<span class="badge bg-primary rounded-pill">85,000 $</span>
</a>
</li>
<li class="list-group-item p-0 align-items-center">
<a class="d-flex justify-content-between list-group-item list-group-item-action border-0" href="#">
<div>
<i class="fa-solid fa-book"></i>
<span>Download Word</span>
</div>
<span class="badge bg-primary rounded-pill">Free</span>
</a>
</li>
</ul>
<div class="card-body">
<button class="btn btn-success btn-lg w-100">Payment</button>
</div>
</div>
</div>
</div>
</div>
</div>
Basically, I am new to HTML and learning how to make a website and I'd like to put two bootstrap cards side by side on the page with a blank space in the middle to separate the two.
When I put both the cards in they automatically go underneath one another instead of side by side. I tried deleting and adding the column again, I tried tweaking the card sizes but can't think or find anything to solve the issue.
Below is the code for the entire site and a picture of how it appears on the site (It's a bit long sorry).
<!DOCTYPE html>
<html>
<head>
<link href="style.css" rel="stylesheet" type="text/css">
<link href="https://cdn.jsdelivr.net/npm/bootstrap#5.2.0-beta1/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-0evHe/X+R7YkIZDRvuzKMRqM+OrBnVFBL6DOitfPri4tjfHxaWutUpFmBp4vmVor" crossorigin="anonymous">
<title>Form builder</title>
</head>
<body>
<div>
<!-- Script -->
<script src="jquery.min.js" integrity="sha384-pprn3073KE6tl6bjs2QrFaJGz5/SUsLqktiwsUTF55Jfv3qYSDhgCecCxMW52nD2" crossorigin="anonymous"></script>
<script src="bootbox/bootbox.js"></script>
</div>
<!-- Title for page
<div class="container">
<nav class="navbar navbar-expand-lg bg-light">
<div class="container-fluid">
<a class="navbar-brand" href="#">Form Builder</a>
</div>
</nav>
</div> -->
<!-- Navigation Bar -->
<nav class="navbar navbar-expand-lg bg-primary">
<div class="container-fluid">
<a class="navbar-brand" href="#">Site</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 me-auto mb-2 mb-lg-0">
<li class="nav-item">
<a class="nav-link active" aria-current="page" href="#">Kelsey</a>
</li>
<li class="nav-item">
<a class="nav-link" href="#">Site</a>
</li>
<!-- Dropdown Menu -->
<li class="nav-item dropdown">
<a class="nav-link dropdown-toggle col-6" href="#" id="navbarDropdown" role="button" data-bs-toggle="dropdown" aria-expanded="false">
Form Settings</a>
<ul class="dropdown-menu" aria-labelledby="navbarDropdown">
<li><a class="dropdown-item" href="#">yo 2 yo</a></li>
<li><a class="dropdown-item" href="#">Add Section</a></li>
<li>
<hr class="dropdown-divider">
</li>
<li><a class="dropdown-item" href="#">Form Settings</a></li>
</ul>
</li>
<!-- No Clue what this is
<li class="nav-item">
<a class="nav-link disabled">Disabled</a>
</li> -->
</ul>
<!-- Search bar (Not in use)
<form class="d-flex" role="search">
<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>
<!-- End of Nav Bar-->
</nav>
<!-- Tabs -->
<ul class="nav nav-tabs">
<li class="nav-item">
<a class="nav-link active" aria-current="page" href="#">Create Form</a>
</li>
<li class="nav-item">
<a class="nav-link" href="#">Form Settings</a>
</li>
<li class="nav-item">
<a class="nav-link" href="#">Save Form</a>
</li>
<li class="nav-item">
<a class="nav-link">Form Toolbar</a>
</li>
</ul>
<!-- FIRST ROW FIRST PANEL-->
<div id="create-form">
<div class="row" style="padding-top: 20px;"></div>
<div class="row" style="padding-bottom: 20px;">
<div class="col-md-1"></div>
<div class="col-md-4">
<div class="card">
<div class="card-header">
HEADER PANEL
</div>
<ul class="list-group list-group-flush">
<li class="list-group-item"> 1</li>
<li class="list-group-item">0</li>
<li class="list-group-item">8</li>
</ul>
</div>
</div>
<!-- SECOND PANEL -->
<div class="col-md-2"></div>
<div class="col-md-4">
<div class="card">
<div class="card-header">
PANEL
</div>
<ul class="list-group list-group-flush">
<li class="list-group-item">An item</li>
<li class="list-group-item">A second item</li>
<li class="list-group-item">A third item</li>
</ul>
</div>
</div>
</div>
<!-- SECOND ROW 3RD PANEL-->
<div class="card text-bg-primary mb-3 col-md-4">
<div class="card-header">Header</div>
<div class="card-body">
<h5 class="card-title"></h5>
<p class="card-text">Some quick example text to build on the card title and make up the bulk of the card's content.</p>
</div>
</div>
<!-- Experimental card -->
<div class="card text-bg-dark mb-3 col-md-4">
<div class="card-header">SCORING MATRIX</div>
<div class="card-body">
<h5 class="card-title"></h5>
<p class="card-text">This can be used to rate processes and experiences.</p>
</div>
</div>
</div>
<!-- 4TH PANEL -->
<!-- <div class="col-md-2"></div>
<div class="col-md-4">
<div class="card" >
<div class="card-header">
SCORING MATRIX
</div>
<ul class="list-group list-group-flush">
<li class="list-group-item">An item</li>
<li class="list-group-item">A second item</li>
<li class="list-group-item">A third item</li>
</ul>
</div>
</div>
</div>
</div> -->
<!-- <div class="row">
<div class="col">
<input class="form-control">
</div>
<div class="col">
<input type="text" class="form-control">
</div>
</div> -->
<!-- Moola button <button class="btn btn-info">Moola</button> -->
<!-- End of Navigation Bar -->
<!-- Content -->
<!-- <script src="jquery.min.js"></script> -->
<!-- Bootstrap -->
<!-- <div class="container">
<div class="row">
<div class="col">
1 of 3
</div>
<div class="col-6">
2 of 3 (wider)
</div>
<div class="col">
3 of 3
</div>
</div>
<div class="row">
<div class="col">
1 of 3
</div>
<div class="col-5">
2 of 3 (wider)
</div>
<div class="col">
3 of 3
</div></div></div> -->
<!-- Bootstrap Modal -->
<!--<div class="modal" tabindex="-1">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title">1088</h5>
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
</div>
<div class="modal-body">
<p>yo</p>
</div>
<div class="modal-footer">
<button type="button" class="btn-close btn btn-secondary" data-bs-dismiss="modal">Close</button>
<button type="button" class="btn-save btn btn-primary">Save changes</button>
</div>
</div>
</div></div> -->
<!-- Moola button-->
<!-- <button type="button" class="btn btn-dark" id="btn-openmodal">Moola</button> -->
<!-- <script src="https://cdn.jsdelivr.net/npm/bootstrap#5.2.0-beta1/dist/js/bootstrap.bundle.min.js" integrity="sha384-pprn3073KE6tl6bjs2QrFaJGz5/SUsLqktiwsUTF55Jfv3qYSDhgCecCxMW52nD2" crossorigin="anonymous"></script>
<script src="bootbox/bootbox.js"></script>
<script src="script.js"></script> -->
<script src="https://cdn.jsdelivr.net/npm/bootstrap#5.2.0-beta1/dist/js/bootstrap.bundle.min.js" integrity="sha384-pprn3073KE6tl6bjs2QrFaJGz5/SUsLqktiwsUTF55Jfv3qYSDhgCecCxMW52nD2" crossorigin="anonymous"></script>
</body>
</html>
</div>
I think the problem is that you use your col-md-x on your cards.
Maybe try wrapping the cards in a col container like this:
<div class="col-md-4">
<div class="card ...">
...
</div>
</div>
Profile hover is not working properly.
same this is working on the other page but not on the home page I have a share code snippet to check.
and if I remove the bootstrap carousel then the same code is working perfectly.
I have attached code with bootstrap carousel so you can check by removing that.
not working URL : https://pcbmagic.com/
working URL : https://pcbmagic.com/member/dashboard/cart.php
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.5.2/css/bootstrap.min.css">
<link rel="stylesheet" href="https://pcbmagic.com/assets/style.css">
<link rel="stylesheet" href="assets/style.css">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css">
</head>
<body>
<section class="bg-light">
<div class="row pl-4 pr-4 pt-2 pb-2" style="align-items: center; box-shadow: 1px 0.5px 9px 0px rgb(188 193 192);">
<div class="col-md-2" style="align-self: center;">
<img src="https://pcbmagic.com/logo_s.png" style="height:75px;">
</div>
<div class="col-md-7">
<nav class="navbar navbar-light navbar-expand-md nav-bg-custom main-menu-bar">
<!-- Brand -->
<button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#collapsingNavbar3">
<span class="navbar-toggler-icon"></span>
</button>
<div class="navbar-collapse collapse w-100" id="collapsingNavbar3">
<ul class="navbar-nav w-100 justify-content-center">
<li class="nav-item active">
<a class="nav-link" href="/"><!--<i class="fas fa-home"></i> -->Home</a>
</li>
<!--<li class="nav-item dropdown active">
<a class="nav-link dropdown-toggle" href="#" id="navbarDropdown" role="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
<i class="fas fa-calculator"></i> Instant Quote
</a>
<div class="dropdown-menu" aria-labelledby="navbarDropdown">
<a class="dropdown-item" href="pcb-order.php"><i class="fas fa-microchip"></i> PCB Laout</a>
<a class="dropdown-item" href="pcb-fabrication.php"><i class="fas fa-microchip"></i> PCB FABRICATION</a>
<a class="dropdown-item" href="#"><i class="fas fa-microchip"></i> PCB ASSEMBLY</a>
<div class="dropdown-divider"></div>
<a class="dropdown-item" href="stencil.php"><i class="fas fa-microchip"></i> STENCIL FABRICATION</a>
</div>
</li>-->
<li class="nav-item active">
<a class="nav-link" href="https://pcbmagic.com/pcb-quote.php"><!--<i class="fas fa-puzzle-piece"></i> -->PCB Assembly</a>
</li>
<!--<li class="nav-item active">-->
<!-- <a class="nav-link" href="/about-us.php">About us</a>-->
<!--</li>-->
<li class="nav-item active">
<a class="nav-link" href="/contact.php"><!--<i class="fas fa-address-book"></i>--> Contact</a>
</li>
</ul>
</div>
</nav>
</div>
<div class="col-md-3 pr-3" style="align-self: center;">
<div class="float-right header-op">
<a href="https://pcbmagic.com/member/dashboard/cart.php" class="btn btn-sm cart-a" style="z-index: 999999;color: white !important;margin-bottom: 5px;"><img src="https://pcbmagic.com/assets/img/cart.png" class="cart">
<span class="cart-number" id="cart_count">
2 </span>
</a>
<div class="dropdown-log">
<span>Hi,Vishal<i class="pl-2 fas fa-chevron-down"></i></span>
<div class="dropdown-log-content">
<div class="bg-dark py-2 mb-2">
<div class="p-img">
</div>
<h6 class="text-center text-light">Vishal Vishwakarma</h6>
<p class="text-center text-light" style="font-size:12px;">webadmin#championsemi.com</p>
</div>
<p>Dashboard</p>
<p>My Order</p>
<p>Production Status</p>
<p>Help Center</p>
<p>Logout</p>
</div>
</div>
</div>
</div>
</div>
</section>
</body>
</html><!DOCTYPE html>
<html>
<head>
</head>
<body>
<section class="">
<div id="carouselExampleIndicators" class="carousel slide" data-ride="carousel">
<ol class="carousel-indicators">
<li data-target="#carouselExampleIndicators" data-slide-to="0" class="active"></li>
<li data-target="#carouselExampleIndicators" data-slide-to="1"></li>
<!--<li data-target="#carouselExampleIndicators" data-slide-to="2"></li>-->
</ol>
<div class="carousel-inner" style="border: 1px solid #dedede;">
<div class="carousel-item active">
<img class="d-block w-100" src="assets/img/s1.png" alt="First slide">
</div>
<div class="carousel-item">
<img class="d-block w-100" src="assets/img/t2.png" alt="Second slide">
</div>
<!--<div class="carousel-item">
<img class="d-block w-100" src="https://pcbwayfile.s3-us-west-2.amazonaws.com/banner/21/03/25/1808173691783t.jpg" alt="Third slide">
</div>-->
</div>
<a class="carousel-control-prev" href="#carouselExampleIndicators" 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="#carouselExampleIndicators" role="button" data-slide="next">
<span class="carousel-control-next-icon" aria-hidden="true"></span>
<span class="sr-only">Next</span>
</a>
</div>
</section>
</body>
</html>
<style>
#media screen and (max-width: 767px) {
.mobile-space {margin-top:35px;}
.carousel-inner img {height: 135px;}
.dropdown-log-content{z-index:999999;}
}
</style>
<section class="pt-5 ft-text-link" style="background:#1b1b1b;color:white;font-size:14px;box-shadow: 0px -3px 2px #1b1b1b;">
<div class="container-fluid pl-5 pr-5">
<div class="row">
<div class="col-md-3">
<h6>Business</h6>
<ul class="ft-list">
<li class="">Electronics / Semiconductors</li>
<li class="">Industrial Design Services</li>
<li class="">PCB/PCB-A</li>
<li class="">Display and Signage Systems</li>
<li class="">IoT Solutions</li>
<li class="">Medical Electronics</li>
</ul>
</div>
<div class="col-md-3">
<h6>Important Links</h6>
<ul class="ft-list">
<li class="">Careers # ChampionSemi</li>
<li class="">Ecosystem</li>
<li class="">For Investors</li>
<li class="">Legals</li>
<li class="">Contact us</li>
</ul>
</div>
<div class="col-md-3">
</div>
<div class="col-md-3 newsletter">
<p class="text-center">Would you like to know what’s happening at the forefront of semiconductor and electronics at ChampionSemi? Sign up and receive the latest updates.</p>
<div class="mt-2" style="height:36px;">
<center><input class="m-width-100 m-mb-5 w-50" type="text" name="">
<a href="#" class="btn btn-o btn-sm m-width-100 w-50" style="font-size: 12px;
padding: 4px !important;">Subscribe Now</a></center>
</div>
</div>
</div>
<div class="row mobile-space">
<div class="col-md-3">
<p class="mb-1">Payment Methods</p>
<img style="height:23.5px;" src="https://pcbmagic.com/assets/img/payment-mode.png">
</div>
<div class="col-md-3">
<p class="mb-1">Delivery Services</p>
<img style="height:23.5px;" src="https://pcbmagic.com/assets/img/delivery-mode.png">
</div>
<div class="col-md-4">
</div>
</div>
</div>
<div class="container-fluid pl-4 pb-2 pr-4">
<hr style="background:#ffffff21;width:100% !important;margin-top: 10px;">
<div class="row">
<div class="col-md-6">
<!--<center class="m-display" style="display:none;"><img class="m-display-block" src="https://geocon.in/smartnet/logo-ft.png" style="height:27px;"></center> -->
<p class="pl-1 m-text-center"><!--<img class="m-hide" src="https://geocon.in/smartnet/logo-ft.png" style="height:27px;">--> PCBMagic © 2021 | Champion Semiconductor LLP | Terms of use | Privacy Policy </p>
</div>
<div class="col-md-6 ft-fa text-right follow-ft">
<p class="m-text-center">Follow us
<i class="fab fa-facebook"></i>
<i class="fab fa-twitter"></i>
<i class="fab fa-instagram"></i>
</p>
</div>
</div>
</div>
</section>
you have to add z-index property to your .dropdown-log-content class. as below
.dropdown-log-content
{
z-index: 9999999 !important;
}
So my navbar is going to have the search field before the menu items. These are both seperate collabible DIVs so I can have a toggle for each.
The problem at the moment is that there is a large gap between the search bar and the menu items when on desktop view. There seems to be a min-width attribute on it but I'm not sure why or how to get around it.
Can anyone advice how to remove the gap and align both to the left?
<!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">
<title>Bootstrap - Prebuilt Layout</title>
<link href="/css/style.css" rel="stylesheet">
<script src="js/popper.min.js"></script>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.6.0/jquery.min.js"></script>
<!-- Bootstrap JS -->
<script src="https://stackpath.bootstrapcdn.com/bootstrap/4.5.2/js/bootstrap.min.js"></script>
<!-- Bootstrap -->
<link href="https://stackpath.bootstrapcdn.com/bootstrap/4.5.2/css/bootstrap.min.css" rel="stylesheet">
<link href="https://maxcdn.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css" rel="stylesheet">
</head>
<body>
<nav class="navbar navbar-expand-lg navbar-dark bg-dark fixed-top">
<div class="container" id="accordion">
<a class="navbar-brand" href="#">Demo</a>
<div class="navbar-header">
<button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarSearch" data-pa aria-controls="navbarSearch" aria-expanded="false" aria-label="Toggle navigation">
<i class="fa fa-search"></i>
</button>
<button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarContent" aria-controls="navbarContent" aria-expanded="false" aria-label="Toggle navigation">
<span class="navbar-toggler-icon"></span>
</button>
</div>
<div class="collapse navbar-collapse" id="navbarSearch" data-parent="#accordion">
<form class="form-inline my-2 my-lg-0">
<input class="form-control mr-sm-2" type="search" placeholder="Search" aria-label="Search">
<button class="btn btn-outline-success my-2 my-sm-0" type="submit"><i class="fa fa-search"></i></button>
</form>
</div>
<div class="collapse navbar-collapse" id="navbarContent" data-parent="#accordion">
<ul class="navbar-nav">
<li class="nav-item active">
<a class="nav-link" href="#">Home</a>
</li>
<li class="nav-item">
<a class="nav-link" href="#">Link</a>
</li>
<li class="nav-item dropdown">
<a class="nav-link dropdown-toggle" href="#" id="navbarDropdown" role="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
Dropdown
</a>
<div class="dropdown-menu" aria-labelledby="navbarDropdown">
<a class="dropdown-item" href="#">Action</a>
<a class="dropdown-item" href="#">Another action</a>
<div class="dropdown-divider"></div>
<a class="dropdown-item" href="#">Something else here</a>
</div>
</li>
</ul>
</div>
</div>
</nav>
<div class="jumbotron jumbotron-fluid text-center">
<h1 class="display-4">Bootstrap with Dreamweaver</h1>
<p class="lead">Easily build your page using the Bootstrap components from the Insert panel.</p>
<hr class="my-4">
<p>This is a simple hero unit, a simple jumbotron-style component for calling extra attention to featured content or information.</p>
<p class="lead">
<a class="btn btn-primary btn-lg" href="#" role="button">Learn more</a>
</p>
</div>
<div class="container">
<div class="row text-center">
<div class="col-lg-6 offset-lg-3">Click outside the blue container to select this <strong>row</strong>. Columns are always contained within a row. <strong>Rows are indicated by a dashed grey line and rounded corners</strong>. </div>
</div>
<br>
<hr>
<br>
<div class="row">
<div class="col-md-4">
<div class="card">
<img class="card-img-top" src="images/card-img.png" alt="Card image cap">
<div class="card-body">
<h4 class="card-title">Card title</h4>
<p class="card-text">Some quick example text to build on the card title and make up the bulk of the card's content.</p>
<br><br>
Go somewhere
</div>
</div>
</div>
<div class="col-md-4">
<div class="card">
<div class="card-body">
<h5 class="card-title">Card title</h5>
<h6 class="card-subtitle mb-2 text-muted">Card subtitle</h6>
<p class="card-text">Some quick example text to build on the card title and make up the bulk of the card's content.</p>
Card link
Another link
</div>
</div>
<br>
<br/>
<div class="card">
<div class="card-header">
Featured
</div>
<ul class="list-group list-group-flush">
<li class="list-group-item">Cras justo odio</li>
<li class="list-group-item">Dapibus ac facilisis in</li>
<li class="list-group-item">Vestibulum at eros</li>
</ul>
</div>
</div>
<div class="col-md-4">
<div class="card">
<img class="card-img-top" src="images/card-img.png" alt="Card image cap">
<div class="card-body">
<h5 class="card-title">Card title</h5>
<p class="card-text">Some text to build on the card's content.</p>
</div>
<ul class="list-group list-group-flush">
<li class="list-group-item">Cras justo odio</li>
<li class="list-group-item">Dapibus ac facilisis in</li>
</ul>
<div class="card-body">
Card link
Another link
</div>
</div>
</div>
</div>
<br/>
<br/>
<div class="row">
<div class=" col-md-4"> Click here to select this<strong> column.</strong> Always place your content within a column. Columns are indicated by a dashed blue line. </div>
<div class="col-md-4 "> You can <strong>resize a column</strong> using the handle on the right. Drag it to increase or reduce the number of columns.</div>
<div class="col-md-4 "> You can <strong>offset a column</strong> using the handle on the left. Drag it to increase or reduce the offset. </div>
</div>
<br/>
<br/>
<div class="row">
<div class="col-md-6 text-center">
<div class="card">
<div class="card-body">
<h3>Adding <strong>Buttons</strong></h3>
<p>Quickly add buttons to your page by using the button component in the insert panel. </p>
<button type="button" class="btn btn-info btn-md">Info Button</button>
<button type="button" class="btn btn-success btn-md">Success Button</button>
</div>
</div>
</div>
<div class="text-center col-md-6">
<div class="card">
<div class="card-body">
<h3>Adding <strong>Badges</strong></h3>
<p>Using the insert panel, add badge to your page by using the badge component.</p>
<span class="badge badge-info">Info Badge</span> <span class="badge badge-danger">Danger Badge</span>
</div>
</div>
</div>
</div>
<br>
<hr>
<div class="row">
<div class="text-center col-lg-6 offset-lg-3">
<h4>Footer </h4>
<p>Copyright © 2020 · All Rights Reserved · <a href="#" >My Website</a></p>
</div>
</div>
</div>
</body>
</html>
Set your own style.css lower than the bootstrap one in the heading of your html, and then edit it there. HTML reads from top to bottom, so any changes made to elements in your styles.css are losing priority to bootstrap.
<script src="js/popper.min.js"></script>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.6.0/jquery.min.js"></script>
<!-- Bootstrap JS -->
<script src="https://stackpath.bootstrapcdn.com/bootstrap/4.5.2/js/bootstrap.min.js"></script>
<!-- Bootstrap -->
<link href="https://stackpath.bootstrapcdn.com/bootstrap/4.5.2/css/bootstrap.min.css" rel="stylesheet">
<link href="https://maxcdn.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css" rel="stylesheet">
<!-- Your css sheet -->
<link href="/css/style.css" rel="stylesheet">
I have recently gotten a bootstrap 4 theme. I have been changing some files to work with flask. However I'm not able to figure out why my "main-container" div is falling below the nav bar when I change the page size to a more full size desktop browser size?
In the original bootstrap file the index.html file had the nav bar and page content on a single page. For flask I have moved most of this between three files layout.html, index.html and _navbar.html
I would like this to be on the right side of the nav bar when this is stretched to full desktop size but im not able to figure out what to change.
layout.html
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Pipeline Project Management Bootstrap Theme</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="description" content="A project management Bootstrap theme by Medium Rare">
<link href="static/img/favicon.ico" rel="icon" type="image/x-icon">
<link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet">
<link href="https://fonts.googleapis.com/css?family=Gothic+A1" rel="stylesheet">
<link href="static/css/theme.css" rel="stylesheet" type="text/css" media="all" />
</head>
<body>
{%include 'includes/_navbar.html'%}
{%block body%}
{%endblock%}
<script type="text/javascript" src="static/js/jquery.min.js"></script>
<script type="text/javascript" src="static/js/autosize.min.js"></script>
<script type="text/javascript" src="static/js/popper.min.js"></script>
<script type="text/javascript" src="static/js/prism.js"></script>
<script type="text/javascript" src="static/js/draggable.bundle.legacy.js"></script>
<script type="text/javascript" src="static/js/swap-animation.js"></script>
<script type="text/javascript" src="static/js/dropzone.min.js"></script>
<script type="text/javascript" src="static/js/list.min.js"></script>
<script type="text/javascript" src="static/js/bootstrap.js"></script>
<script type="text/javascript" src="static/js/theme.js"></script>
</body>
<footer>
<p><center><small><small>© ME | ©ME </small></small></center></p>
</footer>
</html>
index.html
{%extends 'layout.html'%}
{%block body%}
<div class="main-container">
<div class="container">
<div class="row justify-content-center">
<div class="col-lg-11 col-xl-9">
<section class="py-4 py-lg-5">
<div class="mb-3 d-flex">
<img alt="Pipeline" src="static/img/logo-color.svg" class="avatar avatar-lg mr-1" />
<div>
<span class="badge badge-success">1.0</span>
</div>
</div>
<h1 class="display-4 mb-3">Headline</h1>
<p class="lead">
Headline text
</p>
<div class="d-flex">
<div class="dropdown mr-3">
Explore Pages
<div class="dropdown-menu">
<a class="dropdown-item" href="pages-app.html">App Pages</a>
<a class="dropdown-item" href="pages-utility.html">Utility Pages</a>
</div>
</div>
<div class="dropdown">
View Components
<div class="dropdown-menu">
<a class="dropdown-item" href="components-bootstrap.html">Bootstrap Components</a>
<a class="dropdown-item" href="components-pipeline.html">Pipeline Components</a>
</div>
</div>
</div>
</section>
<section class="py-4 py-lg-5">
<div class="carousel slide carousel-fade mb-5" data-ride="carousel">
<div class="carousel-inner overflow-visible">
<div class="carousel-item shadow-lg active">
<a href="pages-app.html">
<img alt="Image" src="static/img/overview/nav-side-team.png" class="img-fluid rounded border" />
</a>
</div>
<div class="carousel-item shadow-lg ">
<a href="pages-app.html">
<img alt="Image" src="static/img/overview/nav-side-project.png" class="img-fluid rounded border" />
</a>
</div>
<div class="carousel-item shadow-lg ">
<a href="pages-app.html">
<img alt="Image" src="static/img/overview/nav-side-task.png" class="img-fluid rounded border" />
</a>
</div>
<div class="carousel-item shadow-lg ">
<a href="pages-app.html">
<img alt="Image" src="static/img/overview/nav-side-kanban-board.png" class="img-fluid rounded border" />
</a>
</div>
<div class="carousel-item shadow-lg ">
<a href="pages-app.html">
<img alt="Image" src="static/img/overview/nav-side-chat.png" class="img-fluid rounded border" />
</a>
</div>
<div class="carousel-item shadow-lg ">
<a href="pages-app.html">
<img alt="Image" src="static/img/overview/nav-side-user.png" class="img-fluid rounded border" />
</a>
</div>
</div>
</div>
<div class="d-flex align-items-center mb-3">
<i class="material-icons text-primary mr-3 h1">supervised_user_circle</i>
<h2 class="h1 mb-0">Project Management Pages</h2>
</div>
<p class="lead">
Pipeline makes building project management interfaces simple with pages for teams, projects, tasks, kanban boards and more.
</p>
App PagesUtility Pages
</section>
</div>
</div>
</div>
</div>
{%endblock%}
_navbar.html
[![<div class="layout layout-nav-side">
<div class="navbar navbar-expand-lg bg-dark navbar-dark sticky-top">
<a class="navbar-brand" href="index.html">
<img alt="Pipeline" src="static/img/logo.svg" />
</a>
<div class="d-flex align-items-center">
<button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbar-collapse" aria-controls="navbar-collapse" aria-expanded="false" aria-label="Toggle navigation">
<span class="navbar-toggler-icon"></span>
</button>
<div class="d-block d-lg-none ml-2">
<div class="dropdown">
<a href="#" role="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
<img alt="Image" src="static/img/avatar-male-4.jpg" class="avatar" />
</a>
<div class="dropdown-menu dropdown-menu-right">
Profile
Account Settings
Log Out
</div>
</div>
</div>
</div>
<div class="collapse navbar-collapse flex-column" id="navbar-collapse">
<ul class="navbar-nav d-lg-block">
<li class="nav-item">
<a class="nav-link" href="index.html">Overview</a>
</li>
<li class="nav-item">
<a class="nav-link" href="#" data-toggle="collapse" aria-expanded="false" data-target="#submenu-2" aria-controls="submenu-2">Pages</a>
<div id="submenu-2" class="collapse">
<ul class="nav nav-small flex-column">
<li class="nav-item">
<a class="nav-link" href="pages-app.html">App Pages</a>
</li>
<li class="nav-item">
<a class="nav-link" href="pages-utility.html">Utility Pages</a>
</li>
<li class="nav-item">
<a class="nav-link" href="pages-layouts.html">Layouts</a>
</li>
</ul>
</div>
</li>
<li class="nav-item">
<a class="nav-link" href="#" data-toggle="collapse" aria-expanded="false" data-target="#submenu-3" aria-controls="submenu-3">Components</a>
<div id="submenu-3" class="collapse">
<ul class="nav nav-small flex-column">
<li class="nav-item">
<a class="nav-link" href="components-bootstrap.html">Bootstrap</a>
</li>
<li class="nav-item">
<a class="nav-link" href="components-pipeline.html">Pipeline</a>
</li>
</ul>
</div>
</li>
<li class="nav-item">
<a class="nav-link" href="documentation/index.html">Documentation</a>
</li>
<li class="nav-item">
<a class="nav-link" href="documentation/changelog.html">Changelog</a>
</li>
</ul>
<hr>
<div class="d-none d-lg-block w-100">
<span class="text-small text-muted">Quick Links</span>
<ul class="nav nav-small flex-column mt-2">
<li class="nav-item">
Team Overview
</li>
<li class="nav-item">
Project
</li>
<li class="nav-item">
Single Task
</li>
<li class="nav-item">
Kanban Board
</li>
</ul>
<hr>
</div>
<div>
<form>
<div class="input-group input-group-dark input-group-round">
<div class="input-group-prepend">
<span class="input-group-text">
<i class="material-icons">search</i>
</span>
</div>
<input type="search" class="form-control form-control-dark" placeholder="Search" aria-label="Search app" aria-describedby="search-app">
</div>
</form>
<div class="dropdown mt-2">
<button class="btn btn-primary btn-block dropdown-toggle" type="button" id="newContentButton" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
Add New
</button>
<div class="dropdown-menu" aria-labelledby="newContentButton">
<a class="dropdown-item" href="#">Team</a>
<a class="dropdown-item" href="#">Project</a>
<a class="dropdown-item" href="#">Task</a>
</div>
</div>
</div>
</div>
<div class="d-none d-lg-block">
<div class="dropup">
<a href="#" role="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
<img alt="Image" src="static/img/avatar-male-4.jpg" class="avatar" />
</a>
<div class="dropdown-menu">
Profile
Account Settings
Log Out
</div>
</div>
</div>
</div>
</div>
Divs by default have display: block which makes them positioned on top of one another.
In order to position them properly you could either:
Wrap them in a container div and use flexbox for positioning (Bootstrap row and columns),
Use floats (Bootstrap float classes)
Below is an example of using floats to position divs.
.container {
width: 500px;
}
.nav {
float: left;
width: 30%;
height: 200px;
background-color: red;
}
.content {
float: left;
width: 70%;
height: 200px;
background-color: blue;
}
.clear {
clear: both;
}
<div class="container">
<div class="nav">
</div>
<div class="content">
</div>
<div class="clear">
</div>
</div>