bootstrap columns overlapping
According to Bootstrap Docs, for each .row
you need to have a .col-*-*
as direct child but you don't have it in a few of them. Which cause the overflow.
Plus don't use the html tag width
, it is deprecated. use class="img-responsive"
from bootstrap to achieve max-width:100%
<link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css" rel="stylesheet" /><div class='container-fluid'> <div class="row"> <!-- 1 --> <div class="col-sm-5 col-md-4"> <h1>JOHN SMITH</h1> </div> </div> <div class='row'> <!-- 2 --> <div class="col-sm-5 col-md-4"> <h2>VULCAN FLATBED</h2> </div> </div>
<div class="row"> <!-- 3 --> <div class="col-sm-4 col-md-4 col-lg-4" style="background-color:yellow;">
<div class='row'> <div class="col-xs-12"> <img class="img-responsive" src="//lorempixel.com/500/200" alt="vehicle image" /> </div> </div> <div class='row'> <div class="col-xs-12"> <button type='submit'> <img src="book_now_button@2x.png" alt="book now"> </button> </div> </div> </div> <div class="col-sm-8 col-md-8 col-lg-8" style="background-color:pink;"> <!-- RIGHT SIDE -->
<div class='row'> <div class="col-xs-12"> <h3>CAN HELP WITH</h3> <p>LIFTING & YARD WORK</p> </div> </div> <div class='row'> <div class="col-xs-12"> <h3>AVAILABLE</h3> <p>ALL WEEKENDS</p> </div> </div> <div class='row'> <div class="col-xs-12"> <h3>NOTE</h3> <p>HI, MY NAME IS JOHN AND I HAVE A GREAT TRUCK FOR TRANSPORTING CARS, WORK MATTERIAL, OR HEAVY OBJECTS. I HAVE A FULL TIME JOB SO I CAN ONLY HELP YOU ON THE WEEKENDS. I LOVE WORKING WITH MY HANDS SO IF YOU SOME HELP WITH LIFTING OR YARDWORK I AM YOUR GUY. BOOK NOW TO CONTACT ME AND LET ME HELP YOU OUT. </p> </div> </div> </div>
Bootstrap columns overlapping when shrinking page
The columns will overlap because the <img>
elements have a fixed width
value. col-*-*
have a set percentage width and as soon as that becomes smaller than the width set on the images, overlapping will occur.
To make images responsive you can remove the width property and use the class .img-responsive
so that the <img>
doesn't exceed the width of the column. It utilizes max-width: 100%
.
<img class="img-responsive" src="..." />
bootstrap columns overlapping each other on mobile
You need to wrap the columns with a div giving a class name (.row) row. Make another div with calendar class in .clo-md-3 div. And use width with %
<div class="container">
<div class="row">
<div class="col-md-3">
<div class="calendar">Calendar</div>
</div>
<div class="col-md-9">
<button>Button text</button>
</div>
</div>
</div>
CSS code Example:
.calendar {
min-width: 30%;
background: #000;
color: #ffffff;
padding: 10px;
display: inline-block;
}
Bootstrap grid columns overlapping each other
Your grid syntax is incorrect: your first row div has col-md-6, col-md-6, col-md-9 and col-md-3 as children. Bootstrap grid system has 12 columns, not 24.
Maybe try something like this (wrapped col-md-9 and col-md-3 into a new row div):
<div class="container">
<div class="row">
<div class="col-md-6">
<img src="content/one.png">
</div>
<div class="col-md-6">
<div class="row">
<div class="col-md-6"><img src="content/two.png"></div>
<div class="col-md-6"><img src="content/three.png"></div>
</div>
<div class="row">
<div class="col-md-6"><img src="content/four.png"></div>
<div class="col-md-6"><img src="content/five.png"></div>
</div>
</div>
</div>
<div class="row">
<div class="col-md-9">
<div class="row">
<div class="col-md-3"><img src="content/six.png"></div>
<div class="col-md-9"><img src="content/seven.png"></div>
</div>
<div class="row">
<div class="col-md-6"><img src="content/eight.png"></div>
<div class="col-md-6"><img src="content/nine.png"></div>
</div>
</div>
<div class="col-md-3">
<img src="content/ten.png">
</div>
</div>
</div>
Bootstrap columns are overlapping when the browser window is resized
I am pretty sure your problem is that using col-sm
isn't working because your screen is smaller than what that column size is meant to accommodate. Try using col-xs
instead.
Not to mention, you used fluid-container
instead of container-fluid
at one point.
Bootstrap 4 Fixed Column Overlapping when shrunk
you need to toggle position: fixed
property for the mobile/desktop sizes... you can either use JS to do that or write a class for this property yourself... to get the exact spacing/padding etc. you would need to some css also
snippet below:
.top-level-left { overflow: hidden; height: 100vh; position: fixed;}
.top-level-left>div { padding-left: 0; padding-right: 45px;}
@media screen and (max-width:576px) { .top-level-left { overflow: hidden; height: auto; position: relative; } .top-level-left>div { padding-left: 15px; padding-right: 15px; }}
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.4.1/css/bootstrap.min.css">
<div class="container mt-3"> <div class="row">
<div class="col-md-4 col-sm-4 "> <div class="row top-level-left "> <div class="col-md-4 col-sm-4 ">
<h3>Left Column</h3> <p>What is Lorem Ipsum? 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.</p> </div> <div class="col-md-8 col-sm-8 ">
</div> </div>
</div> <!-- end column -->
<div class="col-md-8 offset-md-4 col-sm-8 offset-sm-4 top-level-right"> <h3>User Feed</h3> <p>What is Lorem Ipsum? 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 survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum. Why do we use it? It is a long established fact that a reader will be distracted by the readable content of a page when looking at its layout. The point of using Lorem Ipsum is that it has a more-or-less normal distribution of letters, as opposed to using 'Content here, content here', making it look like readable English. Many desktop publishing packages and web page editors now use Lorem Ipsum as their default model text, and a search for 'lorem ipsum' will uncover many web sites still in their infancy. Various versions have evolved over the years, sometimes by accident, sometimes on purpose (injected humour and the like). Where does it come from? Contrary to popular belief, Lorem Ipsum is not simply random text. It has roots in a piece of classical Latin literature from 45 BC, making it over 2000 years old. Richard McClintock, a Latin professor at Hampden-Sydney College in Virginia, looked up one of the more obscure Latin words, consectetur, from a Lorem Ipsum passage, and going through the cites of the word in classical literature, discovered the undoubtable source. Lorem Ipsum comes from sections 1.10.32 and 1.10.33 of "de Finibus Bonorum et Malorum" (The Extremes of Good and Evil) by Cicero, written in 45 BC. This book is a treatise on the theory of ethics, very popular during the Renaissance. The first line of Lorem Ipsum, "Lorem ipsum dolor sit amet..", comes from a line in section 1.10.32. The standard chunk of Lorem Ipsum used since the 1500s is reproduced below for those interested. Sections 1.10.32 and 1.10.33 from "de Finibus Bonorum et Malorum" by Cicero are also reproduced in their exact original form, accompanied by English versions from the 1914 translation by H. Rackham. Where can I get some? There are many variations of passages of Lorem Ipsum available, but the majority have suffered alteration in some form, by injected humour, or randomised words which don't look even slightly believable. If you are going to use a passage of Lorem Ipsum, you need to be sure there isn't anything embarrassing hidden in the middle of text. All the Lorem Ipsum generators on the Internet tend to repeat predefined chunks as necessary, making this the first true generator on the Internet. It uses a dictionary of over 200 Latin words, combined with a handful of model sentence structures, to generate Lorem Ipsum which looks reasonable. The generated Lorem Ipsum is therefore always free from repetition, injected humour, or non-characteristic words etc.</p> </div> <!-- end column -->
</div></div>
Related Topics
Html5 Number Input - Always Show 2 Decimal Places
How to Save User-Entered Line Breaks from a Textarea to a Database
Chrome User Agent Stylesheet Overwriting My Site Style
How to Position Elements Next to Each Other in a Div
Having Difficulty Understanding How to Remove Some Padding
Splitting the HTML Page Using Div
How to Rotate the Block Every Time You Click on the Button
Css - How to Have Swiper Slider Arrows Outside of Slider That Takes Up 12 Column Row
Can You Provide Some Examples of Why It Is Hard to Parse Xml and HTML With a Regex
Css Overflow-X: Visible; and Overflow-Y: Hidden; Causing Scrollbar Issue
Add Onclick Event to Svg Element
How to Prevent Newline At the End of HTML Input Field
How to Arrange HTML Label and Input Side by Side
Insert Line Break After Each Tr Tag Row
How to Declare a Variable in a Template in Angular