Expected
Im having trouble placing two smaller images next to one larger image using Bootstrap 4. However, I cannot seem to align one of the smaller images to bottom such that it is aligned as the bigger image.
The grid should be responsive as well as the image text.
Any help is appreciated.
<div class="container">
<div class="row">
<div class="col-md-6">
<img src="../assets/img/Iot.png" class="img-fluid">
<div class="carousel-caption text-justify" style="bottom: 0px;left: 10%;">
<h1 style="color:white !important">IoT</h1>
<p style="color:white !important">In the forefront of emerging technologies,
Internet of Things (IoT) applications are some of the most challenging and
innovative solutions to work with today... READ MORE</p>
</div>
</div>
<div class="col-md-6">
<div class="row">
<div class="col">
<img src="../assets/img/fintech.png" class="img-fluid">
<div class="carousel-caption text-justify" style="bottom: 0px;left: 10%;">
<h1 style="color:white !important">FinTech</h1>
<p style="color:white !important">The growth in digital banking is showing no
signs of slowing down. Convenience, speed and security aren’t just extra
benefits in consumers minds anymore... READ MORE</p>
</div>
</div>
</div>
<div class="row">
<div class="col">
<img src="../assets/img/smartapps.png" class="img-fluid">
<div class="carousel-caption text-justify" style="bottom: 0px;left: 10%;">
<h1 style="color:white !important">SmartApps</h1>
<p style="color:white !important">With people using their smartphones more and
more, they are now
demanding solutions that can help them complete their task event on the go…
READ MORE</p>
</div>
</div>
</div>
</div>
</div>
</div>
added height and width to each image
.big img{
height: calc(500px + 1.5em);
}
.small img{
height:250px;
width:100%
}
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.2.1/css/bootstrap.min.css">
<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.14.6/umd/popper.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.2.1/js/bootstrap.min.js"></script>
<div class="container">
<div class="row">
<div class="col-md-6 big">
<img src="https://www.w3schools.com/w3css/img_lights.jpg" class="img-fluid">
<div class="carousel-caption text-justify" style="bottom: 0px;left: 10%;">
<h1 style="color:white !important">IoT</h1>
<p style="color:white !important">In the forefront of emerging technologies,
Internet of Things (IoT) applications are some of the most challenging and
innovative solutions to work with today... READ MORE</p>
</div>
</div>
<div class="col-md-6">
<div class="row small">
<div class="col">
<img src="https://www.w3schools.com/w3css/img_lights.jpg" class="img-fluid">
<div class="carousel-caption text-justify" style="bottom: 0px;left: 10%;">
<h1 style="color:white !important">FinTech</h1>
<p style="color:white !important">The growth in digital banking is showing no
signs of slowing down. Convenience, speed and security aren’t just extra
benefits in consumers minds anymore... READ MORE</p>
</div>
</div>
</div>
<div class="row mt-4 small">
<div class="col">
<img src="https://www.w3schools.com/w3css/img_lights.jpg" class="img-fluid">
<div class="carousel-caption text-justify" style="bottom: 0px;left: 10%;">
<h1 style="color:white !important">SmartApps</h1>
<p style="color:white !important">With people using their smartphones more and
more, they are now
demanding solutions that can help them complete their task event on the go…
READ MORE</p>
</div>
</div>
</div>
</div>
</div>
</div>
Related
i'm using bootstrap 5 and the images are not getting aligned in horizontal way. The image gets added in the lower row. i've tried everything nut it dosent's works. any help would be appriciated.
Thank you.
<!-- Bootstrap-5 -->
<link href="https://cdn.jsdelivr.net/npm/bootstrap#5.1.3/dist/css/bootstrap.min.css" rel="stylesheet" />
<!-- Body -->
<section>
<div class="container pt-3" class="text1">
<div class="row">
<div class="col-12 text-center ">
<h3> Lots of IT companies in town. Why you should choose us? </h3>
</div>
</div>
</div>
<hr>
</section>
<div class="row">
<div class="col-md-4 text-center">
<img class="img-fluid p-2" src="https://via.placeholder.com/200.jpg" width="150">
<h4 style="font-weight: 700;">Customized requirements</h4>
<p> Every idea is unique and that's we craft it as<br> per your requirements.</p>
</div>
</div>
<div class="col-md-4 text-center">
<img class="img-fluid p-2" src="https://via.placeholder.com/200.jpg" width="150">
<h4 style="font-weight: 700;">Customized requirements</h4>
<p> Every idea is unique and that's we craft it as<br> per your requirements.</p>
</div>
</section>
row div early close
<link href="https://cdn.jsdelivr.net/npm/bootstrap#5.1.3/dist/css/bootstrap.min.css" rel="stylesheet" />
<section>
<div class="container pt-3" class="text1">
<div class="row">
<div class="col-12 text-center ">
<h3> Lots of IT companies in town. Why you should choose us? </h3>
</div>
</div>
</div>
<hr>
</section>
<div class="container" class="text1">
<section>
<div class="row">
<div class="col-md-4 text-center">
<img class="img-fluid p-2" src="images/our qualities/our_qualities/customized.png" width="150">
<h4 style="font-weight: 700;">Customized requirements</h4>
<p> Every idea is unique and that's we craft it as<br> per your requirements.</p>
</div> <!-- Not Here -->
<div class="col-md-4 text-center">
<img class="img-fluid p-2" src="images/our qualities/our_qualities/customized.png" width="150">
<h4 style="font-weight: 700;">Customized requirements</h4>
<p> Every idea is unique and that's we craft it as<br> per your requirements.</p>
</div>
</div> <!-- Close Here -->
</section>
</div>
Im trying to get my "Jumbotron" centered at the top and beneath it have my picture to the left and carousel on the right.
Why does all my content float to the left? Im trying to get everything centered but cant quite make it work.
Im using Bootstrap 5, with flexbox
https://codepen.io/spacemonki87/pen/VwbvogM
HTML:
<section>
<div class="hero">
<div class="row" style="max-width: 1220px;">
<div class="content text-center">
<div class="value-prop text-center">
<h1 class="display-4">Hello, world!</h1>
<p class="lead">This is a simple hero unit, a simple jumbotron-style component for calling extra attention to featured content or information.</p>
<hr class="my-4">
<p>It uses utility classes for typography and spacing to space content out within the larger container.</p>
<a class="btn btn-success btn-lg" href="#" role="button">Learn more</a>
</div>
<div class="hero-row d-flex">
<div class="hero-img-container d-flex text-center align-items-center" style="margin: 0 auto; width: 84%;">
<img style="max-width: 100%; height: auto;" src="../img/hp_hero_note#2x__en.png" height="800" />
</div>
<div class="carousel-container d-flex align-items-center" style="width: 16%; min-width: 240px;">
<div class="hero-carousel-texts slick-initialized slick-slider slick-dotted">
<div aria-live="polite" class="slick-list draggable">
<div class="slick-track">
<div class="hero-carousel-text slick-slide slick-cloned">
<div class="heading">
<p class="p-title hero-carousel-text-heading">FIND THINGS FAST</p>
</div>
<div class="description">
<p class="p-small">Get what you need, when you need it. Search gives you results as you type.</p>
</div>
</div>
<div class="hero-carousel-text slick-slide slick-cloned">
<div class="heading">
<p class="p-title hero-carousel-text-heading">FIND THINGS FAST</p>
</div>
<div class="description">
<p class="p-small">Get what you need, when you need it. Search gives you results as you type.</p>
</div>
</div>
<div class="hero-carousel-text slick-slide slick-cloned">
<div class="heading">
<p class="p-title hero-carousel-text-heading">FIND THINGS FAST</p>
</div>
<div class="description">
<p class="p-small">Get what you need, when you need it. Search gives you results as you type.</p>
</div>
</div>
<div class="hero-carousel-text slick-slide slick-cloned">
<div class="heading">
<p class="p-title hero-carousel-text-heading">FIND THINGS FAST</p>
</div>
<div class="description">
<p class="p-small">Get what you need, when you need it. Search gives you results as you type.</p>
</div>
</div>
<div class="hero-carousel-text slick-slide slick-cloned">
<div class="heading">
<p class="p-title hero-carousel-text-heading">FIND THINGS FAST</p>
</div>
<div class="description">
<p class="p-small">Get what you need, when you need it. Search gives you results as you type.</p>
</div>
</div>
<div class="hero-carousel-text slick-slide slick-cloned">
<div class="heading">
<p class="p-title hero-carousel-text-heading">FIND THINGS FAST</p>
</div>
<div class="description">
<p class="p-small">Get what you need, when you need it. Search gives you results as you type.</p>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</section>
Any tips on mastering layouts is greatly appreciated
You could just add mx-auto class to first child of div.hero. This will set margin-left and margin-right to auto, centering the contents of the page.
<section>
<div class="hero">
<div class="row mx-auto" style="max-width: 1220px;">
...
Try to add this style into .hero
display: flex;
justify-content: center;
I'm trying to make a "products" page, I have a card in each column, and only one row.
<section>
<div class="container">
<div class="row">
<div class="col s12">
<h4 class="grey-text text-darken-4">
New Listings
</h4>
</div>
</div>
<div class="row">
<div class="col s6 m4 l3">
<div class="card hoverable">
<a href="">
<div class="card-image">
<img src="https://source.unsplash.com/250x250/?mobile" alt="" />
</div>
<div class="card-content">
<h6 class="truncate black-text"><b>Lorem</b></h6>
<p class="truncate grey-text text-darken-2">Buy Lorem</p>
<p class="right-align grey-text"><small>Today</small></p>
</div>
</a>
</div>
</div>
<div class="col s6 m4 l3">
<div class="card hoverable">
<a href="">
<div class="card-image">
<img src="https://source.unsplash.com/250x250/?mobile" alt="" />
</div>
<div class="card-content">
<h6 class="truncate black-text"><b>Lorem</b></h6>
<p class="truncate grey-text text-darken-2">Buy Lorem</p>
<p class="right-align grey-text"><small>Today</small></p>
</div>
</a>
</div>
</div>
<div class="col s6 m4 l3">
<div class="card hoverable">
<a href="">
<div class="card-image">
<img src="https://source.unsplash.com/250x250/?mobile" alt="" />
</div>
<div class="card-content">
<h6 class="truncate black-text"><b>Lorem</b></h6>
<p class="truncate grey-text text-darken-2">Buy Lorem</p>
<p class="right-align grey-text"><small>Today</small></p>
</div>
</a>
</div>
</div>
</div>
</div>
</section>
My code looks something like this, a card jumps from one line to the next even though there is space for it, I don't really know what is wrong
Edit: It is working now, gave a class "small" to card div. Thanks to Sean.
Materialize rows don't handle cards with different heights very well, for this scenario, it helps to fix the height of your cards to make them uniform using the three provided classes:|
<div class="card small">
<!-- Card Content -->
</div>
Three sizes applied as an extra class on the card - small, medium and large which equate to:
.card.small {
height: 300px;
}
.card.medium {
height: 400px;
}
.card.large {
height: 500px;
}
https://materializecss.com/cards.html#sizes
Here is a div; I want to make the image in the other column(6) sticky when it gets in view so I can update it while scrolling. But it has refused to work. Every other positioning method works apart from sticky
<div class="row">
<div class="col-md-6 col-x">
<div class="iphone">
<div>
<div class="section-header">
<div class="opportunity-image">
<img style="height: 30%; width: 50%" src="/images/advertise.svg" alt="">
</div>
<h2 class="section-title wow fadeInDown pt-4" data-wow-delay="0.3s">Create Opportunities</h2>
<!-- <div class="shape wow fadeInDown" data-wow-delay="0.3s"></div> -->
<p class="wow fadeInUp" data-wow-delay="0.4s">Do you have Items or Products you want to sell? Or do you want to view and buy products? <br> You can view and also create opportunities from the comfort of your home and process all transactions and logistics right from there. Just wait at home and the goods come to you!</p>
</div>
</div>
</div>
<div class="iphone">
<div class="section-header">
<div class="opportunity-image">
<img style="height: 30%; width: 50%" src="/images/request.svg" alt="">
</div>
<h2 class="section-title wow fadeInDown p-4" data-wow-delay="0.3s">Make Requests</h2>
<!-- <div class="shape wow fadeInDown" data-wow-delay="0.3s"></div> -->
<p class="wow fadeInUp" data-wow-delay="0.4s">Manage all your requests from your App and enjoy smooth operation on all orders</p>
</div>
</div>
<div class="iphone">
<div class="section-header">
<div class="opportunity-image " >
<img style="height: 30%; width: 50%" src="/images/creditcard.svg" alt="">
</div>
<h2 class="section-title wow fadeInDown pt-4" data-wow-delay="0.3s">Make Payments</h2>
<!-- <div class="shape wow fadeInDown" data-wow-delay="0.3s"></div> -->
<p class="wow fadeInUp" data-wow-delay="0.4s">Make Payments via our crypto method pegged to the naira. Once payments is made, Your coin is held in escrow until orders has been fulfilled! Secure payment guaranteed.Our Escrow system is safe and security guranteed. You can also withdraw or convert your coins to naira whenever you want</p>
</div>
</div>
<div class="iphone">
<div class="section-header">
<div class="opportunity-image " >
<img style="height: 30%; width: 50%" src="/images/creditcard.svg" alt="">
</div>
<h2 class="section-title wow fadeInDown pt-4" data-wow-delay="0.3s">Withdraw and Pay with Cryptocurrency pegged to the naira</h2>
<p class="wow fadeInUp" data-wow-delay="0.4s">Do you have a product to sell?, Post it as an opportunity on our platform and let users send requests to buy them!</p>
</div>
</div>
</div>
<div class="col-md-6 col-xs-12">
<!-- <div class="opportunity-image m float-right fixed"> -->
<img class="iphone-pic fixed float-right" src="/images/spottr-image.png" alt="" >
<!-- </div> -->
</div>
</div>
I want the three images to be side-by-side (on desktop), with the headings and paragraph text to be beneath each respective image.
Does anyone know why it wouldn't be working for me? I presume my code is incorrect somehow
<link href="https://stackpath.bootstrapcdn.com/bootstrap/4.4.1/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-Vkoo8x4CGsO3+Hhxv8T/Q5PaXtkKtu6ug5TOeNV6gBiFeWPGFN9MuhOf23Q9Ifjh" crossorigin="anonymous">
<div class="portfolio-container">
<section class="portfolio">
<div class="row">
<div class="col-12 my-5">
<h2 class="text-uppercase">Portfolio</h2>
</div>
</div>
<div class="row">
<div class="col-12 col-md-6 col-lg-4">
<div class="media">
<div class="d-none d-sm-block">
<img src="images/whiskey-drop.png" class="rounded-circle mr-3" height=50 width=50>
</div>
<div class="media-body">
<h3>Whiskey Drop</h3>
<h4>HTML, CSS, Bootstrap</h4>
<p>An e-commerce website for a premium whiskey service.</p>
</div>
</div>
</div>
<div class="row">
<div class="col-12 col-md-6 col-lg-4">
<div class="media">
<div class="d-none d-sm-block">
<img src="images/rosie-odenkirk.png" class="rounded-circle mr-3" height=50 width=50>
</div>
<div class="media-body">
<h3>Resume</h3>
<h4>HTML, CSS, Bootstrap</h4>
<p>A responsive and user friendly resume showcasing a sample candidate in the best light possible.</p>
</div>
</div>
</div>
<div class="row">
<div class="col-12 d-md-none d-lg-block col-lg-4">
<div class="media">
<div class="d-none d-sm-block">
<img src="images/flappy-bird.png" class="rounded-circle mr-3" height=50 width=50>
</div>
<div class="media-body">
<h3>Flappy Bird</h3>
<h4>Python and Django</h4>
<p>A fun and interactive game where you are in control of a bird as you navigate through tight spaces.</p>
</div>
</div>
</div>
You are creating a new row for every item
Instead, put the col's in one row:
<div class="row">
<div class="col-4">
</div>
<div class="col-4">
</div>
<div class="col-4">
</div>
</div>
You don't need a new <div class="row"></div> around every <div class="col-lg-4"></div>. You can just wrap it around the entire lot to clear the floats.
<div class="row">
<div class="col-12 my-5">
<h2 class="text-uppercase">Portfolio</h2>
</div>
<div class="col-12 col-md-6 col-lg-4">
<div class="media">
<div class="d-none d-sm-block">
<img src="images/whiskey-drop.png" class="rounded-circle mr-3" height=50 width=50>
</div>
<div class="media-body">
<h3>Whiskey Drop</h3>
<h4>HTML, CSS, Bootstrap</h4>
<p>An e-commerce website for a premium whiskey service.</p>
</div>
</div>
</div>
<div class="col-12 col-md-6 col-lg-4">
<div class="media">
<div class="d-none d-sm-block">
<img src="images/rosie-odenkirk.png" class="rounded-circle mr-3" height=50 width=50>
</div>
<div class="media-body">
<h3>Resume</h3>
<h4>HTML, CSS, Bootstrap</h4>
<p>A responsive and user friendly resume showcasing a sample candidate in the best light possible.</p>
</div>
</div>
</div>
<div class="col-12 d-md-none d-lg-block col-lg-4">
<div class="media">
<div class="d-none d-sm-block">
<img src="images/flappy-bird.png" class="rounded-circle mr-3" height=50 width=50>
</div>
<div class="media-body">
<h3>Flappy Bird</h3>
<h4>Python and Django</h4>
<p>A fun and interactive game where you are in control of a bird as you navigate through tight spaces.</p>
</div>
</div>
</div>
</div>
Also make sure that you wrap your height and width values with "" too.