JSFiddle - React, Tailwind, and code Playground
HTML
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.4/js/bootstrap.min.js"></script>
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.4/css/bootstrap.min.css">
<div id="carousel-example" class="carousel slide" data-ride="carousel">
<ol class="carousel-indicators">
<li data-target="#carousel-example-generic" data-slide-to="0" class="active"></li>
<li data-target="#carousel-example-generic" data-slide-to="1"></li>
<li data-target="#carousel-example-generic" data-slide-to="2"></li>
</ol>
<!-- Wrapper for slides -->
<!--<div class="row" style="background-color: #e3dfd6;">
<div class="col-xs-offset-2 col-xs-8">-->
<div class="carousel-inner">
<div class="item active">
<div class="carousel-content">
<div>
<p class="mytext">This is the text of the first item.</p> <span class="name">This is the first name</span>
</div>
</div>
</div>
<div class="item">
<div class="carousel-content">
<div>
<p class="mytext">This is the text of the second item.This is the text of the second item.</p> <span class="name">This is the second name, This is the second name</span>
</div>
</div>
</div>
<div class="item">
<div class="carousel-content">
<div>
<p class="mytext">This is the text of the third item.This is the text of the third item.This is the text of the third item.</p> <span class="name">This is the third name,This is the third name,This is the third name,</span>
</div>
</div>
</div>
</div>
<!--</div>
</div>-->
</div>
CSS
.name {
color: black;
font-size: 20px;
}
.mytext {
font-size: 24px;
font-weight: 200;
line-height: 1.3em;
margin-bottom: 10px;
padding: 0 !important;
}
body {
background-color: #e3dfd6;
}
.carousel-inner {
padding-bottom: 50px;
}
.carousel-content {
text-align: center;
padding-top: 20px;
padding-bottom: 20px;
}
JavaScript
setCarouselHeight('#carousel-example');
function setCarouselHeight(id) {
var slideHeight = [];
$(id + ' .item').each(function () {
// add all slide heights to an array
slideHeight.push($(this).height());
});
// find the tallest item
max = Math.max.apply(null, slideHeight);
// set the slide's height
$(id + ' .carousel-content').each(function () {
$(this).css('height', max + 'px');
});
}