I am trying to use twitter-Bootstrap 4.1 to create a website. I have a jumbotron with a background image that takes 75% of the screen on the top. At the bottom, I have text blocks as demonstrated in the following code snippet https://www.codeply.com/go/NnUx8ZDmyz
However, I have the following problems with it. On my screen, the “Search” button is sticking out of the container/card (transparent/gray block). Also when you change the viewport to tablet/ phone size, it gets worst as the form overlaps the text below.
Here is a screenshot of how the form is not centered and the button is sticking out.
Here is a screenshot of how the search form is overlapping with the text below.
UPDATED
Here is a code snippet where the issues above are fixed. However, the search box is now shifted to the top of the jumbotron instead of the middle.
https://www.codeply.com/go/LjMrId9guW
2
Answers
The search button is sticking out because it’s bigger than it’s container the
col-lg-1
.To resolve the overlapping on mobile/tablet screen you’ll have to override or remove the
h-75
class from:jumbotron jumbotron-fluid intro-jumbotron h-75 clearfix
.I’ve cleaned up your HTML code a bit:
I moved the min and max price into a
col-3
. Now the search button wrapper can have acol-2
class.The solution for the update:
Add to the jumbotron
d-flex
, removed-flex
from its child and addalign-self-center
.Tip: istead of
pl-0 pr-0
you an use:px-0
(padding on x axis = 0)You should use
min-height:75%
insteadInstead of using
pr-0 pl-0
just useno-gutters
on the row…https://www.codeply.com/go/avwMFtM5Cd