Make Bootstrap Column take full page width (or at least 90%) - html

I am working on a final project for a class, and am just learning how to use bootstrap. While I have some working knowledge of HTML and the like (or know where to go if I get stuck), the one thing I cannot figure out for the life of me is how to make the bootstrap columns take up more of the screen. I've copied and pasted the relevant code below, hopefully someone can tell me what I am doing wrong or if this can even be resolved!
I have been looking at other slack posts (I forgot to copy the link, sorry!) and the w3schools website, but am still having the same problem.
<nav class="navbar navbar-expand-sm bg-white navbar-light">
<a class="navbar-brand" href="#">Navbar</a>
<button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#collapsibleNavbar">
<span class="navbar-toggler-icon"></span>
</button>
<div class="collapse navbar-collapse" id="collapsibleNavbar">
<ul class="navbar-nav">
<li class="nav-item">
<a class="nav-link" href="#">Awards</a>
</li>
<li class="nav-item">
<a class="nav-link" href="#">Resume</a>
</li>
<li class="nav-item">
<a class="nav-link" href="#">Papers</a>
</li>
</ul>
</div>
</nav>
<div class="container">
<div class="row">
<! –– The columns still aren't taking up 100% of the screen width. ––>
<div class="col-sm-2">
<! –– Ideally more to the left ––>
Welcome the user to the website here
</div>
<div class="col-sm-4">
Brief bit of information about me
</div>
<div class="col-sm-6">
Image carosel (idk how to spell) with images of me, my friends & family
</div>
</div>
</div>

When you use container class its by default takes 80% of window width along with margin right and left auto. For 90% of window you need to use container-fluid class so it cover full width of window. Then you col-4 col-2 and col-5 to achieve 90%.
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.5.0/css/bootstrap.min.css">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.16.0/umd/popper.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.5.0/js/bootstrap.min.js"></script>
<nav class="navbar navbar-expand-sm bg-white navbar-light">
<a class="navbar-brand" href="#">Navbar</a>
<button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#collapsibleNavbar">
<span class="navbar-toggler-icon"></span>
</button>
<div class="collapse navbar-collapse" id="collapsibleNavbar">
<ul class="navbar-nav">
<li class="nav-item">
<a class="nav-link" href="#">Awards</a>
</li>
<li class="nav-item">
<a class="nav-link" href="#">Resume</a>
</li>
<li class="nav-item">
<a class="nav-link" href="#">Papers</a>
</li>
</ul>
</div>
</nav>
<div class="container-fluid">
<div class="row">
<! –– The columns still aren't taking up 100% of the screen width. ––>
<div class="col-sm-2">
<! –– Ideally more to the left ––>
Welcome the user to the website here
</div>
<div class="col-sm-4">
Brief bit of information about me
</div>
<div class="col-sm-5">
Image carosel (idk how to spell) with images of me, my friends & family
</div>
</div>
</div>
Use this :
<div class="container-fluid">
<div class="row">
<! –– The columns still aren't taking up 100% of the screen width. ––>
<div class="col-sm-2">
<! –– Ideally more to the left ––>
Welcome the user to the website here
</div>
<div class="col-sm-4">
Brief bit of information about me
</div>
<div class="col-sm-5">
Image carosel (idk how to spell) with images of me, my friends & family
</div>
</div>
</div>

Related

how to make my content area to the right of my menu?

Hello im trying to put my content area to the right of my vertical nav bar using bootstrap 4. in my current code the content area is under the menu. any suggestions on how to fix it so its next to the menu on the right side.
Thank you
<div class="container-fluid">
<div class="col-3">
<nav class="navbar navbar-expand-sm bg-dark navbar-dark">
<button class="navbar-toggler" type="button" data-toggle="collapse" data-
target="#collapsibleNavbar" aria-expanded="true">
<span class="navbar-toggler-icon"></span>
</button>
<div class="navbar-collapse collapse show" id="collapsibleNavbar" style>
<ul class="navbar.flex-column">
<li class="nav-item">
<a class="nav-link" href="index.html">Index</a>
</li>
</ul>
</div>
</nav>
</div>
</div>
<div class="container-fluid">
<div class="col-9">
<p>Main Content area</p>
</div>
</div>
Copy the col-9 div and place it after the col-3 div ends. Add d-flex flex-row classes with container-fluid class.

How to fix padding problem in Bootstrap 5?

The top down padding is set to 3% but left right padding of 15% doesn't work. Can someone explain what is wrong here? I want to set the top-down padding of 3% and left-right padding of 15% with respective to fluid container. But it seems that left-right padding is not working. I debugged it using chrome developer tools. But the left- right padding were crossed out.
<div class="container-fluid">
<div class="navbar navbar-expand-lg navbar-dark">
<a class="navbar-brand" href="">Tindog</a>
<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">
<ul class="navbar-nav ms-auto">
<li class ="nav-item">
<a class="nav-link" href="">Contact</a>
</li>
<li class ="nav-item">
<a class="nav-link" href="">Pricing</a>
</li>
<li class ="nav-item">
<a class="nav-link" href="">Download</a>
</li>
</ul>
</div>
</div>
<!-- Title -->
<div class="row">
<div class="col-lg-6 col-md-6">
<h1>Meet new and interesting dogs nearby.</h1>
<button type="button">Download</button>
<button type="button">Download</button>
</div>
<div class="col-lg-6 col-md-6">
<img src="images/iphone6.png" alt="iphone-mockup">
</div>
</div>
</div>
CSS FILE
.container-fluid{
padding: 3% 15%;}
Put " <link rel="stylesheet" " at the bottom of head so i'ts bellow the bootstrap link :) Top to bottom priority!
Bootstrap containers have horizontal padding already set. You can limit the width like this <div class="container-fluid" style="max-width: calc( 100% - (15% * 2) )">...</div>
From my experience, bootstrap has default dimensions for its margin and padding. Setting custom dimensions may not work.
container-fluid is a custom bootstrap class. You cannot override it. You'd need to add another class if you want to customize the padding.
or customise according to the docs: https://getbootstrap.com/docs/5.2/layout/containers/#how-they-work

Why is my bootstrap navbar-expand-sm navigation covering content?

We are having trouble with our responsive navigation covering content.
When the user toggles the navigation button, we want it to push the H1 and down the screen. I am thinking that our css for the body is effecting this. I cannot think of a decent solution for this, but I have considered having the navigation have a background, but it will still cover our "Denver Moving and Storage" content.
We're still learning how to use stackoverflow and we're thankful for any help you guys may be able to offer.
html,body
{
width: 100%;
height: 100%;
margin: 0px;
padding: 0px;
overflow-x: hidden;
}
This is our code:
<!-- container with bg img -->
<div class="cover">
<div class="container">
<!-- NAV Here -->
<nav class="navbar navbar-expand-sm navbar-dark d-flex" aria-label="responsive navbar">
<a class="navbar-brand" href="index.html"><img src="img/the-other-side-moving-storage-color-white.png" width="75%" height="75%"></a>
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#responsive-navbar" aria-controls="responsive-navbar" aria-expanded="false" aria-label="Toggle navigation">
<span class="navbar-toggler-icon"></span>
</button>
<div class="collapse navbar-collapse" id="responsive-navbar">
<ul class="navbar-nav me-auto mb-2 mb-sm-0">
<li class="nav-item">
<a class="nav-link" href="denver-moving-services.html">Moving</a>
</li>
<li class="nav-item">
<a class="nav-link" href="denver-storage-company.html">Storage</a>
</li>
<li class="nav-item">
<a class="nav-link" href="receiving-and-delivery.html">Furniture Delivery</a>
</li>
<li class="nav-item">
<a class="nav-link" href="about-us.html">About</a>
</li>
<li class="nav-item">
<button class="btn btn-tosa" type="submit">Free Estimate</button>
</li>
</ul>
</div>
</nav>
<!-- Nav end -->
</div>
<!-- FS Hero -->
<div class="container-xl mb-4">
<div class="row text-center">
<div class="col-12">
<h1 class="py-5">Denver Moving and Storage</h1>
<button type="button" class="btn btn-tosa mx-3">Free Estimate</button>
<button type="button" class="btn btn-outline-tosa mx-3">Our Story</button>
</div>
</div>
</div>
<!-- End FS Hero -->
</div>
<!-- End Cover -->
I don't know if your body CSS is affecting it or not, since you didn't post that out. But just by looking at your HTML, I see something wrong with your button toggler:
<button ... data-bs-toggle="collapse" data-bs-target="#responsive-navbar" />
Where did you get this kind of syntax from? In Bootstrap documentation, there is no -bs on the data attribute.
In order for the toggler to work properly, you need to remove -bs.
Minor improvement
Your "free estimate" button. Bootstrap has a button style to make an anchor tag look like a button. You don't need to wrap a button with an anchor tag. You can change it to something like:
<li class="nav-item">
<a class="btn btn-success" href="free-estimate.html">Free Estimate</a>
</li>
demo: https://jsfiddle.net/davidliang2008/p4ofdcae/8/

Why is my html displaying my sidebar and nav twice using laravel?

Not a native English speaker so prepare for typos.
I was wondering why my nav and sidebar are being shown twice on my html page when i look at it in a browser.
So you'd know what I'm talking 'bout here's a screenshot:
Right now my main page looks like this:
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Schadedossier #yield('title')</title>
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.5.0/css/bootstrap.min.css" integrity="sha384-9aIt2nRpC12Uk9gS9baDl411NQApFmC26EwAOH8WgZl5MYYxFfc+NcPb1dKGj7Sk" crossorigin="anonymous">
<link rel="stylesheet" href="https://soshandyman.blob.core.windows.net/themes/bs4-insurance.css">
</head>
<body>
<!--wrapper(the thing around the sidebar and the nav)-->
<div class="d-flex" id="wrapper">
<!--sidebar-->
<div class="bg-light border-right collapse" id="sidebar-wrapper">
<div class="sidebar-heading">logo</div>
<div class="list-group list-group-flush">
Tussenpersoon
Woning
Schadedossier
Data schadedossier
Verzekeringsnemer
<button class="btn btn-outline-secondary">Contract raadplegen</button>
</div>
</div>
<div class="container-fluid p-0">
<!--page content-->
<div id="page-content-wrapper">
<nav class="navbar navbar-light bg-light border-bottom">
<button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#sidebar-wrapper" aria-controls="sidebar-wrapper" aria-expanded="false" aria-label="Toggle navigation">
<span class="navbar-toggler-icon"></span>
</button>
<div class="navbar" id="navbarSupportedContent">
<ul class="nav nav-tabs" id="myTab">
<li class="nav-item">
<a class="nav-link active" id="aangifte-tab" data-toggle="tab" href="#aangifte" aria-controls="aangifte">Aangifte</a>
</li>
<li class="nav-item">
<a class="nav-link" id="details-tab" data-toggle="tab" href="#details">Details</a>
</li>
<li class="nav-item">
<a class="nav-link" id="overzicht-tab" data-toggle="tab" href="#overzicht">Overzicht</a>
</li>
<li class="nav-item">
<a class="nav-link" id="evaluatie-tab" data-toggle="tab" href="#evaluatie">Evaluatie</a>
</li>
</ul>
</div>
</nav>
<!--start tab content (here starts the nav aangifte and so on)-->
<div id="myTabContent" class="tab-content">
#yield('content', View::make('childAangifte'))
</div>
<!--end page content-->
</div>
<!--endsidebar-->
</div>
<!--endwrapper-->
<!--incert bootstrapscripts here-->
</body>
Then this is my child's code:
#extends('welcome')
#section('title')
aangifte
#endsection
<!--incert html-->
#endsection
Anyway I'm having trouble with this because this is not the only child i need to display but if this will form an issue every time then I rather want to know before I try to get the other ones to work.
Also what option would be better to use switch or if to go to the other children?
Thanks a bunch and sorry for the terrible formatting.

how to style a nav bar, logo and title in angular bootstrap 4 web app?

Im trying to make the top of the webpage so its a grid of ratio 3:6 with the section on the left being a square image. and the section on the right being split horizontally in 2 with the top half being a bar with the title and the bottom half a naviagtion bar. this is my code. unfortuanetly the title is not appearing at all, and the image is appearing on top of the navigation bar and also not filling the width of the screen. Im really not sure what the problem. any help would be great! thanks
<div class="col-sm-6 col-md-3 col-lg-3 col-xl-3">
<img ng-src="img/sky-logo.jpg" width="200px"/>
</div>
<div class="col-sm-6 col-md-9 col-lg-9 col-xl-9 ">
<div id="top">
<div class="container">
<div class="clearfix">
<div class="pull-center"><title> title </title></div>
</div>
</div>
</div>
<nav class="navbar navbar-expand-sm bg-dark navbar-dark">
<ul class="navbar-nav">
<li class="nav-item">
<a class="nav-link" href="#link1">link 1</a>
</li>
<li class="nav-item">
<a class="nav-link" href="#link2">link 2</a>
</li>
</ul>
</nav>
</div>
<div ng-view></div>
</body>
for title you should use headings instead as <title> tag defines a title in the browser toolbar and should be placed in <head></head>
for layout that you described you can try the following code
<div class="col-sm-12">
<!-- for ratio 3:6 -->
<div class="col-sm-4">
<img ng-src="img/sky-logo.jpg" style="width:200px" />
</div>
<!-- for ratio 3:6 -->
<div class="col-sm-8">
<!-- top half -->
<div class="col-sm-12">
<div id="top">
<div class="container">
<div class="clearfix">
<div class="pull-center">title</div>
</div>
</div>
</div>
</div>
<!-- bottom half -->
<div class="col-sm-12">
<nav class="navbar navbar-expand-sm bg-dark navbar-dark">
<ul class="navbar-nav">
<li class="nav-item">
<a class="nav-link" href="#link1">link 1</a>
</li>
<li class="nav-item">
<a class="nav-link" href="#link2">link 2</a>
</li>
</ul>
</nav>
</div>
</div>
</div>