Bootstrap image card text overlay - image

Unable to set card footer as expected output
Expected output:
My Code:
<link href="https://stackpath.bootstrapcdn.com/bootstrap/4.5.2/css/bootstrap.min.css" rel="stylesheet"/>
<div class="col-md-3">
<div class="card">
<img src="https://images.unsplash.com/photo-1523805009345-7448845a9e53?ixlib=rb-1.2.1&ixid=eyJhcHBfaWQiOjEyMDd9&auto=format&fit=crop&w=752&q=80" class="card-img-top" alt="...">
<div class="card-img-overlay">
<h5 class="card-title"></h5>
</div>
<div class="card-footer text-center">
<h6>
Africa
</h6>
<h4>
Kenya
</h4>
</div>
</div>
</div>
jsfiddle: https://jsfiddle.net/sidh_41/p8sdfy7u/2/

.card-footer:last-child {
border-radius: 0!important;
}
.card-footer {
padding: 0!important;
background-color: unset!important;
border-top: unset!important;
}
.text-center {
color: #fff;
}
.card-img-overlay {
display: flex;
flex-direction: column;
justify-content: flex-end;
height: 100%;
}
<link href="https://stackpath.bootstrapcdn.com/bootstrap/4.5.2/css/bootstrap.min.css" rel="stylesheet"/>
<div class="col-md-3">
<div class="card">
<img src="https://images.unsplash.com/photo-1523805009345-7448845a9e53?ixlib=rb-1.2.1&ixid=eyJhcHBfaWQiOjEyMDd9&auto=format&fit=crop&w=752&q=80" class="card-img-top" alt="...">
<div class="card-img-overlay">
<h5 class="card-title"></h5>
<div class="card-footer text-center">
<h6>
Africa
</h6>
<h4>
Kenya
</h4>
</div>
</div>
</div>
</div>

Try this:
.card-footer:last-child {
border-radius: 0!important;
}
.card-footer {
padding: 0!important;
background-color: unset!important;
border-top: unset!important;
}
.text-center {
color: #fff;
}
.card-img-overlay {
display: flex;
flex-direction: column;
justify-content: flex-end;
height: 100%;
}
<link href="https://stackpath.bootstrapcdn.com/bootstrap/4.5.2/css/bootstrap.min.css" rel="stylesheet"/>
<div class="col-md-3">
<div class="card">
<img src="https://images.unsplash.com/photo-1523805009345-7448845a9e53?ixlib=rb-1.2.1&ixid=eyJhcHBfaWQiOjEyMDd9&auto=format&fit=crop&w=752&q=80" class="card-img-top" alt="...">
<div class="card-img-overlay">
<h5 class="card-title"></h5>
<div class="card-footer text-center">
<h6 class="m-0 small">
AFRICA
</h6>
<h1>
Kenya
</h1>
</div>
</div>
</div>
</div>

<div class="row">
<div class="col-md-3">
<div class="card">
<img class="card-img" src="https://images.unsplash.com/photo-1523805009345-7448845a9e53?ixlib=rb-1.2.1&ixid=eyJhcHBfaWQiOjEyMDd9&auto=format&fit=crop&w=752&q=80" alt="...">
<div class="card-img-overlay">
<h5 class="card-title"></h5>
<div class="card-footer text-center">
<h6>
Africa
</h6>
<h4>
Kenya
</h4>
</div>
</div>
</div>
</div></div>
I think you need to add another div surrounding the card. This div needs to have the class row

.img-wrapper{
position: relative;
text-align: center;
color: white;
}
.card-footer{
position: absolute;
top: 60%;
left: 50%;
transform: translate(-50%, -50%);
}
h3, h1{
color: #fff
}
<div class="col-md-3">
<div class="card">
<div class="img-wrapper">
<img src="https://images.unsplash.com/photo-1523805009345-7448845a9e53?ixlib=rb-1.2.1&ixid=eyJhcHBfaWQiOjEyMDd9&auto=format&fit=crop&w=752&q=80" class="card-img-top" alt="...">
<div class="card-img-overlay">
<h5 class="card-title"></h5>
</div>
</div>
</div>
<div class="card-footer text-center">
<h3>
Africa
</h3>
<h1>
Kenya
</h1>
</div>
</div>
</div>

Related

Add a scrolling animation to a product slider ( scrollBy js)

I made a product slider using Html Css JS and I want the scrollby left and right goes smoth instead of going directly.
Here is my website it works fine on the first slider but the second slider and third that have this issue
Html
<!-- Container for the layout of the full carousel -->
<div class="container2 cover2">
<div class=" scrolling-wrapper scrollmenu-SLIDER2 scroll-images2">
<div class="card2">
<a href=" https://ma.santemagasin.com/produit/hemoconfort/">
<div class="card-img2">
<img src=" https://ma.santemagasin.com/wp-content/uploads/2022/10/hemo-confort-compr.webp">
<h5 class="Product-Disc"> مكمل طبيعي لراحة البواسير
علاج مضمون من المصدر للبواسير الداخلية
حل نهائي للنزيف والالم</h5>
<p class="Product-Prix"> 249د.م.
</p>
<span class="Stars">&bigstar;&bigstar;&bigstar;&bigstar;&bigstar;</span>
</div>
</a>
</div>
<div class="card2">
<a href="https://ma.santemagasin.com/produit/iron-hair/">
<div class="card-img2">
<img src="https://ma.santemagasin.com/wp-content/uploads/2022/09/iron-300x300.webp">
<h5 class="Product-Disc">
مكمل طبيعي خاص بالرجال
sante magasinمن
حل لتساقط الشعر
ملء فراغات اللحية
60 كبسولة نباتية
</h5>
<p class="Product-Prix">249 د.م.</p>
<span class="Stars">&bigstar;&bigstar;&bigstar;&bigstar;&bigstar;</span>
</div>
</a>
</div>
<div class="card2">
<a href="https://ma.santemagasin.com/produit/vitex/">
<div class="card-img2">
<img src="https://ma.santemagasin.com/wp-content/uploads/2022/09/vtx-300x300.webp">
<h5 class="Product-Disc">
مكمل طبيعي من كف مريم
للنساء ٬ الدورة الشهرية
الحمل ٬ 60 كبسولة نباتية
صنع مغربي٬ 300 ملغرام
</h5>
<p class="Product-Prix">249 د.م.</p>
<span class="Stars">&bigstar;&bigstar;&bigstar;&bigstar;&bigstar;</span>
</div>
</a>
</div>
<div class="card2">
<a href="https://ma.santemagasin.com/produit/perfecto/">
<div class="card-img2">
<img src="https://ma.santemagasin.com/wp-content/uploads/2022/09/prfrcto-300x300.webp">
<h5 class="Product-Disc">
مكمل طبيعي
لزيادة المناطق الأنثوية
بدون أضرار جانبية
مستخلصات طبيعية
60 كبسولة٬ 300 ملغرام
</h5>
<p class="Product-Prix">249 د.م.</p>
<span class="Stars">&bigstar;&bigstar;&bigstar;&bigstar;&bigstar;</span>
</div>
</a>
</div>
<div class="card2">
<a href="https://ma.santemagasin.com/produit/hair-lit/">
<div class="card-img2">
<img src="https://ma.santemagasin.com/wp-content/uploads/2022/09/hair-lit-300x300.webp">
<h5 class="Product-Disc">
للنساء الشعر والاضافر
تركيبة مطورة ٬ مكمل طبيعي
60 كبسولة نباتية
</h5>
<p class="Product-Prix">249 د.م.</p>
<span class="Stars">&bigstar;&bigstar;&bigstar;&bigstar;&bigstar;</span>
</div>
</a>
</div>
<div class="card2">
<a href="https://ma.santemagasin.com/produit/strong-carti/">
<div class="card-img2">
<img src="https://ma.santemagasin.com/wp-content/uploads/2022/09/strong-300x300.webp">
<h5 class="Product-Disc">
مكمل طبيعي من
sante magasin
حل للسياتيك والروماتيزم
60 كبسولة نباتية
</h5>
<p class="Product-Prix">249 د.م.</p>
<span class="Stars">&bigstar;&bigstar;&bigstar;&bigstar;&bigstar;</span>
</div>
</a>
</div>
<div class="card2">
<a href="https://ma.santemagasin.com/produit/pure-skin/">
<div class="card-img2">
<img src="https://ma.santemagasin.com/wp-content/uploads/2022/09/pure-skin-300x300.webp">
<h5 class="Product-Disc">
مكمل طبيعي
من sante magasin
بشرة صافية خالية
من الشوائب والبثور
60 كبسولة نباتية
</h5>
<p class="Product-Prix">249 د.م.</p>
<span class="Stars">&bigstar;&bigstar;&bigstar;&bigstar;&bigstar;</span>
</div>
</a>
</div>
<div class="card2">
<a href="https://ma.santemagasin.com/produit/maca/">
<div class="card-img2">
<img src="https://ma.santemagasin.com/wp-content/uploads/2022/09/maca-300x300.webp">
<h5 class="Product-Disc">
مكمل طبيعي
من sante magasin
كبسولات جذور الماكا
الطبيعية - العضوية
محفز الطاقة والقوة
</h5>
<p class="Product-Prix">249 د.م.</p>
<span class="Stars">&bigstar;&bigstar;&bigstar;&bigstar;&bigstar;</span>
</div>
</a>
</div>
<div class="card2">
<a href="https://ma.santemagasin.com/produit/collagen-complex/">
<div class="card-img2">
<img src="https://ma.santemagasin.com/wp-content/uploads/2021/11/collagine-300x300.webp">
<h5 class="Product-Disc">
مكمل طبيعي
من sante magasin
كولاجين بحري
تركيبة طبيعية
60 كبسولة نباتية
</h5>
<p class="Product-Prix">199 د.م.</p>
<span class="Stars">&bigstar;&bigstar;&bigstar;&bigstar;&bigstar;</span>
</div>
</a>
</div>
<div class="card2">
<a href="https://ma.santemagasin.com/produit/control-cholesterol/">
<div class="card-img2">
<img src="https://ma.santemagasin.com/wp-content/uploads/2022/09/bio-cholesto-300x300.webp">
<h5 class="Product-Disc">
مكمل طبيعي
من sante magasin
كوليسترول متوازن
محاربة الدهون الثلاثية
60 كبسولة نباتية
</h5>
<p class="Product-Prix">249 د.م.</p>
<span class="Stars">&bigstar;&bigstar;&bigstar;&bigstar;&bigstar;</span>
</div>
</a>
</div>
<div class="card2">
<a href="https://ma.santemagasin.com/produit/bio-oral-complement-alimentaire/">
<div class="card-img2">
<img src="https://ma.santemagasin.com/wp-content/uploads/2022/09/bio-oral-300x300.webp">
<h5 class="Product-Disc">
مكمل لصحة الفم
حل طبيعي من المصدر
الرائحة الكريهة٫ اللثة
60 كبسولة نباتية
</h5>
<p class="Product-Prix">249 د.م.</p>
<span class="Stars">&bigstar;&bigstar;&bigstar;&bigstar;&bigstar;</span>
</div>
</a>
</div>
<div class="card2">
<a href="https://ma.santemagasin.com/produit/ibs-active-complement-alimentaire/">
<div class="card-img2">
<img src="https://ma.santemagasin.com/wp-content/uploads/2022/09/ibs-300x300.webp">
<h5 class="Product-Disc">
مستخلصات طبيعية
300 ملغرام - 60 كبسولة
راحة الجهاز الهضمي
</h5>
<p class="Product-Prix">249 د.م.</p>
<span class="Stars">&bigstar;&bigstar;&bigstar;&bigstar;&bigstar;</span>
</div>
</a>
</div>
<div class="card2">
<a href="https://ma.santemagasin.com/produit/saw-palmetto/">
<div class="card-img2">
<img src="https://ma.santemagasin.com/wp-content/uploads/2022/09/palmetto-300x300.webp">
<h5 class="Product-Disc">
مكمل طبيعي
من sante magasin
للرجال - صحة البروستاتا
مستخلصات طبيعية
60 كبسولة نباتية
</h5>
<p class="Product-Prix">249 د.م.</p>
<span class="Stars">&bigstar;&bigstar;&bigstar;&bigstar;&bigstar;</span>
</div>
</a>
</div>
<div class="card2">
<a href="https://ma.santemagasin.com/produit/zen-stress/">
<div class="card-img2">
<img src="https://ma.santemagasin.com/wp-content/uploads/2022/09/zen-strees-300x300.webp">
<h5 class="Product-Disc">
مكمل طبيعي مغربي
من sante magasin
نوم مريح - حل للتوتر العصبي
60 كبسولة نباتية
</h5>
<p class="Product-Prix">249 د.م.</p>
<span class="Stars">&bigstar;&bigstar;&bigstar;&bigstar;&bigstar;</span>
</div>
</a>
</div>
</div>
</div>
<div class="cover2">
<button class="left" onclick="leftScroll2()">❮</button>
<button class="right" onclick="rightScroll2()">❯</button>
</div>
CSS
.cover2 {
padding: 0px 30px;
position: relative;
}
.left {
position: absolute;
right: -20px;
top:-170PX;
background-color: transparent !important;
color: #006f07 !important;
font-size: 20px;
font-weight: bold;
border-color: grey;
border-radius: 20%;
}
.right:hover {
background-color: #006F07 !important;
color: white !important;
}
.left:hover {
background-color: #006F07 !important;
color: white !important;
}
.right {
position: absolute;
left: -20px;
top:-170PX;
background-color: transparent !important;
color: #006f07 !important;
font-size: 20px;
font-weight: bold;
border-color: grey;
border-radius: 20%;
margin-left :-10px;
}
.scrollmenu-SLIDER2 {
width: 100%;
height: auto;
display: flex;
flex-wrap: nowrap;
overflow-x: auto;
overflow-y: hidden;
}
.container2 {
display: flex;
overflow-x: auto;
}
.card2 {
padding: 10px;
margin: 10px;
border-radius: 20px;
line-height: 1.2;
background-color: white;
text-align: center;
}
.card2 img{
border-radius: 10px;
}
.Product-Prix{
text-decoration:none;
color : #006f07;
font-size: 20;
font-weight: bold;
margin:5px !important;
}
.Product-Disc{
color: #789FD6;
font-size: 15px;
display: -webkit-box;
max-width: 200px;
-webkit-line-clamp: 3;
-webkit-box-orient: vertical;
overflow: hidden;
text-align: center;
padding-top: 5px;
margin: auto;
width: 100%;
}
.scroll-images {
width: 100%;
height: auto;
display: flex;
flex-wrap: nowrap;
overflow-x: auto;
overflow-y: hidden;
scroll-behavior: smooth;
-webkit-overflow-scrolling: touch;
}
.Stars{
display: flex;
justify-content: center;
color: orange;
letter-spacing: 0.5px;
font-size: 20px;
}
.card-img2 {
width: 09rem;
}
::-webkit-scrollbar {
display: NONE;
}
#media only screen and (max-width: 800px) {
.card-img2 {
width: 07rem;
}
.card-img3 {
width: 10rem;
}
.left , .right {
display:none;
}
.cover2{
padding: 0px 5px;
position: relative;
}
JS
<script>
function leftScroll2() {
const left = document.querySelector(".scroll-images2");
left.scrollBy(2000, 0) ;
}
function rightScroll2() {
const right = document.querySelector(".scroll-images2");
right.scrollBy(-2000, 0) ;
}
</script>
I tried give different classes for every element than the first slider but the same problem still stop the slider from going smoothly

flex scroll with no scroll bar

I am trying to get my main area container (with overflow: auto) to scroll, but with no extra scroll bar. Currently there is an extra scroll bar for the container. I would like to use to main scroll bar to scroll up and down. Im sure ill have to do a slightly different layout to get this to work. I would prefer a flexbox solution, however am open to any method.
https://codepen.io/marti2221/pen/oyxZzx
<section id="container" >
<header id="header" >
<div class="header-top">
<button class="order-btn">Order</button>
<div class="icon-1">
<div class="">icon 1</div>
<div class="">icon 2</div>
</div>
</div>
<div class="header-bottom">
</header>
<article id="content" >
<div class="main-bg">
<div class="menu-box">
<div class="menu-item">
<div class="top-info-wrapper">
<h3>Name</h3>
<h3>$6.50</h3>
</div>
<div class="descr-wrapper">
<p>this is a paragraph about a menu-item. It should be a few sentances long and take up only space in the box</p>
</div>
</div>
<div class="menu-item">
<div class="top-info-wrapper">
<h3>Name</h3>
<h3>$6.50</h3>
</div>
<div class="descr-wrapper">
<p>this is a paragraph about a menu-item. It should be a few sentances long and take up only space in the box</p>
</div>
</div>
<div class="menu-item">
<div class="top-info-wrapper">
<h3>Name</h3>
<h3>$6.50</h3>
</div>
<div class="descr-wrapper">
<p>this is a paragraph about a menu-item. It should be a few sentances long and take up only space in the box</p>
</div>
</div>
<div class="menu-item">
<div class="top-info-wrapper">
<h3>Name</h3>
<h3>$6.50</h3>
</div>
<div class="descr-wrapper">
<p>this is a paragraph about a menu-item. It should be a few sentances long and take up only space in the box</p>
</div>
</div>
<div class="menu-item">
<div class="top-info-wrapper">
<h3>Name</h3>
<h3>$6.50</h3>
</div>
<div class="descr-wrapper">
<p>this is a paragraph about a menu-item. It should be a few sentances long and take up only space in the box</p>
</div>
</div>
<div class="menu-item">
<div class="top-info-wrapper">
<h3>Name</h3>
<h3>$6.50</h3>
</div>
<div class="descr-wrapper">
<p>this is a paragraph about a menu-item. It should be a few sentances long and take up only space in the box</p>
</div>
</div>
</div>
</div>
</article>
</section>
html, body {
height: 100%;
width: 100%;
}
#container {
display: flex;
flex-direction: column;
height: 100%;
width: 100%;
background-color: lightblue;
}
#container header {
background-color: gray;
height: 200px;
display: flex;
flex-direction: column;
}
.header-top {
display: flex;
justify-content: space-between;
}
.order-btn {
align-self: flex-start;
}
#container article {
flex: 1 1 auto;
overflow-y: auto;
min-height: 0px;
}
.main-bg {
display: flex;
justify-content: center;
}
.menu-box {
width: 35%;
border: 1px solid black;
display: flex;
flex-direction: column;
}
.top-info-wrapper {
display: flex;
justify-content: space-between;
}
.icon-1 {
display: flex;
}
.header-bottom {
display: flex;
width: 35%;
}
Removed flex from container div as it was not required. Also moved background-color: lightblue; to article instead of container div. Also added margin: 0; on body tag.
html, body {
height: 100%;
width: 100%;
margin: 0;
}
#container {
height: 100%;
width: 100%;
}
#container header {
background-color: gray;
height: 100px;
position: fixed;
top: 0;
width: 100%;
}
.header-top {
display: flex;
justify-content: space-between;
}
.order-btn {
align-self: flex-start;
}
#container article {
background-color: lightblue;
overflow-y: auto;
min-height: 0px;
margin-top: 100px;
}
.main-bg {
display: flex;
justify-content: center;
}
.menu-box {
width: 35%;
border: 1px solid black;
display: flex;
flex-direction: column;
}
.top-info-wrapper {
display: flex;
justify-content: space-between;
}
.icon-1 {
display: flex;
}
.header-bottom {
display: flex;
width: 35%;
}
<section id="container" >
<header id="header" >
<div class="header-top">
<button class="order-btn">Order</button>
<div class="icon-1">
<div class="">icon 1</div>
<div class="">icon 2</div>
</div>
</div>
<div class="header-bottom">
</header>
<article id="content" >
<div class="main-bg">
<div class="menu-box">
<div class="menu-item">
<div class="top-info-wrapper">
<h3>Name</h3>
<h3>$6.50</h3>
</div>
<div class="descr-wrapper">
<p>this is a paragraph about a menu-item. It should be a few sentances long and take up only space in the box</p>
</div>
</div>
<div class="menu-item">
<div class="top-info-wrapper">
<h3>Name</h3>
<h3>$6.50</h3>
</div>
<div class="descr-wrapper">
<p>this is a paragraph about a menu-item. It should be a few sentances long and take up only space in the box</p>
</div>
</div>
<div class="menu-item">
<div class="top-info-wrapper">
<h3>Name</h3>
<h3>$6.50</h3>
</div>
<div class="descr-wrapper">
<p>this is a paragraph about a menu-item. It should be a few sentances long and take up only space in the box</p>
</div>
</div>
<div class="menu-item">
<div class="top-info-wrapper">
<h3>Name</h3>
<h3>$6.50</h3>
</div>
<div class="descr-wrapper">
<p>this is a paragraph about a menu-item. It should be a few sentances long and take up only space in the box</p>
</div>
</div>
<div class="menu-item">
<div class="top-info-wrapper">
<h3>Name</h3>
<h3>$6.50</h3>
</div>
<div class="descr-wrapper">
<p>this is a paragraph about a menu-item. It should be a few sentances long and take up only space in the box</p>
</div>
</div>
<div class="menu-item">
<div class="top-info-wrapper">
<h3>Name</h3>
<h3>$6.50</h3>
</div>
<div class="descr-wrapper">
<p>this is a paragraph about a menu-item. It should be a few sentances long and take up only space in the box</p>
</div>
</div>
</div>
</div>
</article>
</section>

Issue Firefox - Carousel Bootstrap with background-attachment: fixed

I have an Issue with the Bootstrap Carousel.
I want to have the fixed effect but in Firefox it's giving jumps.
HTML
<div id="carouselExampleIndicators" class="carousel slide" data-ride="carousel">
<ol class="carousel-indicators">
<li data-target="#carouselExampleIndicators" data-slide-to="0" class="active"></li>
<li data-target="#carouselExampleIndicators" data-slide-to="1"></li>
<li data-target="#carouselExampleIndicators" data-slide-to="2"></li>
</ol>
<div class="carousel-inner">
<div class="carousel-item active">
<div class="carousel-item-content" style="background:url('http://www.kia.ca/content/2018-soul/gallery/gallery-img-3.jpg')">
</div>
</div>
<div class="carousel-item">
<div class="carousel-item-content" style="background:url('http://carimages.silovendes.com/imgAutos/11/1056445-0.jpg')">
</div>
</div>
<div class="carousel-item">
<div class="carousel-item-content" style="background:url('https://kia.com.gt/images/modelos/rio/img/exterior-old//thumb/5.jpg')">
</div>
</div>
</div>
<a class="carousel-control-prev" href="#carouselExampleIndicators" role="button" data-slide="prev">
<span class="carousel-control-prev-icon" aria-hidden="true"></span>
<span class="sr-only">Previous</span>
</a>
<a class="carousel-control-next" href="#carouselExampleIndicators" role="button" data-slide="next">
<span class="carousel-control-next-icon" aria-hidden="true"></span>
<span class="sr-only">Next</span>
</a>
</div>
CSS
.carousel-item {
width: 100%;
height: 100vh;
}
.carousel-item .carousel-item-content {
width: 100%;
height: 100%;
-webkit-background-size: cover !important;
-moz-background-size: cover !important;
-o-background-size: cover !important;
background-size: cover !important;
background-position: center center !important;
background-repeat: no-repeat !important;
overflow: hidden !important;
background-attachment: fixed !important;
}
You can try it hier:
https://codepen.io/TamZam/pen/ZvQvox
Any ideas why it happens?
Thanks!

Bootstrap 3 making images centre and content vertically center

I am struggling with trying to align my responsive images center. If I don't use the <img-responsive> tag they do align centre.
The images are the grey placeholder squares, I want them to be placed center above the text, and then the text AND images to be aligned vertical.
I am using Bootstrap 3
Here is my code.
<html>
<head>
<link href="css/bootstrap.min.css" rel="stylesheet">
<link href="css/styles.css" rel="stylesheet">
<title>Layout3</title>
<style>
.panel1 {
background-color: pink;
height:768px;
align-items: center;
}
.panel2a {
background-color:white;
text-align: center;
align-content: center;
height:384px;
margin:0 auto;
}
.panel2b {
background-color:#3DB39E;
text-align: center;
align-content: center;
height:384px;
margin:0 auto;
}
.panel3 {
background-color:#efc75e;
height:768px;
}
.panel4 {
background-color:#e2574c;
height:768px;
}
.panel5 {
background-color:#3db39e;
height:768px;
}
.panel6 {
background-color:#e2574c;
height:768px;
}
.footer {
background-color:#000000;
</style>
</head>
<body>
<div class="container-full">
<div class="col-lg-12 panel1">
<div class="col-lg-6">
<img class="img-responsive" src="http://placehold.it/456x366" alt="" />
</div>
<div class=" col-lg-6">
<h1>Title</h1>
<p class="lead">description</p>
<p><input type="text" class="form-control" placeholder="e-mail"><a class="btn btn-large btn-success" href="#" target="ext">NOTIFY ME</a></p>
</div>
</div>
<div class="row vcenter">
<div class="col-xs-12 col-md-4 panel2a">
<img class="img-responsive" src="http://placehold.it/80x91" alt="" />
<h1>1</h1>
<p>abc</p>
</div>
<div class="col-xs-12 col-md-4 panel2a">
<img class="img-responsive" src="http://placehold.it/80x91" alt="" />
<h1>2</h1>
<p>def</p>
</div>
<!-- 2b -->
<div class="col-xs-12 col-md-4 panel2a">
<img class="img-responsive" src="http://placehold.it/80x91" alt="" />
<h1>3</h1>
<p>ghi</p>
</div>
<div class="col-xs-12 col-md-4 panel2b">
<img class="img-responsive" src="http://placehold.it/80x91" alt="" />
<h1>4</h1>
<p>jkl</p>
</div>
<div class="col-xs-12 col-md-4 panel2b">
<img class="img-responsive" src="http://placehold.it/80x91" alt="" />
<h1>5</h1>
<p>mno</p>
</div>
<div class="col-xs-12 col-md-4 panel2b">
<img class="img-responsive" src="http://placehold.it/80x91" alt="" />
<h1>6</h1>
<p>pqr</p>
</div>
</div>
>
</div> <!-- /container full -->
</body>
</html>
You can get rid of most of your inline css and apply this general concept to each of your image containers:
<div class="outer" >
<div class="inner">
<img class="img-responsive center-block" src="//placehold.it/200x100" />
<span class="text-center">Description</span>
</div>
</div>
CSS
.outer {
display: table;
width: 100%;
}
.inner {
display: table-cell;
text-align: center;
vertical-align: middle;
}
DEMO: http://www.bootply.com/rE4V28TBqw

Kendo UI Mobile Scroller issue

I have used kendo UI mobile version in ASP.NET MVC to show changes in a iframe.
In my html i have several views in which i want header,contain area,footer area i need scroller in contain area for which I have used
" " in each view it's working only in one view but not other view so is there anything wrong which I have missed out .
<div data-role="header" class="header-home3" >
<span class="headerContent1"> Opening Hours </span>
</div>
<div id="divLayout" data-role="scroller" class="scroller-content middle-home3">
<div id="divOpeningHoursPageBackgroundImage" class="inner-container">
<div id="divOpeningHoursheaderImg" class="inner-imgheader"> <img id="OpeningHoursHeaderImage" style="width:100%;"/></div>
<div id="divOpeningHoursHeaderText" class="inner-txtheader"></div>
<div class="inner-midcontainer">
<div id="divOpeningHoursContainer" style="height:80%;min-height:400px;position:static;"></div>
<div id="div5" style="float: left;height: 20%;position: relative;width: 100%;"></div>
</div>
<div id="divOpeningHoursFooterText" class="inner-txtfooter" > </div>
<div id="divOpeningHoursFooterImg" class="inner-imgfooter"> <img id="OpeningHoursFooterImage" style="width:100%;"/></div>
</div>
</div>
<div data-role="footer" class="footer-common footerimg" ></div>
</div>
<div data-role="view" id="tabstrip-share">
<div data-role="header" class="header-map3" >
<span class="headerContent1"> Map & Direction </span>
</div>
<div id="div1" data-role="scroller" class="scroller-content middle-home3">
<div id="divMapPageBackgroundImage" class="inner-container">
<div class="inner-imgheader"> <img id="MapHeaderImage" style="width:100%;"/></div>
<div id="divMapHeaderText" class="inner-txtheader"></div>
<div id="divMapContainer" class="inner-midcontainer">
<div id="divgooglemap" style="height:80%;min-height:400px;position:static;"></div>
<div id="divMapRoute" style="float: left;height: 20%;position: relative;width: 100%;"></div>
</div>
<div id="divMapFooterText" class="inner-txtfooter" > </div>
<div class="inner-imgfooter"><img id="MapFooterImage" style="width:100%;"/></div>
</div>
</div>
<div data-role="footer" class="footer-common footerimg" ></div>
</div>
<div data-role="view" id="tabstrip-Twitter">
<div data-role="header" class="header-mile3" >
<span class="headerContent1"> Twitter </span>
</div>
<div data-role="footer" class="footer-common footerimg" ></div>
</div>
<div data-role="view" id="tabstrip-History">
<div data-role="header" class="header-history3" >
<span class="headerContent1"> Contact Form</span>
</div>
<div id="divContactFormMain" data-role="scrollview" class="scroller-content middle-home3">
<div id="divContactFormPageBackgroundImage" class="inner-container">
<div id="divContactFormheaderImg" class="inner-imgheader"> <img id="ContactFormHeaderImage" style="width:100%;"/></div>
<div id="divContactFormHeaderText" class="inner-txtheader"></div>
<div id="divContactFormContainer" class="inner-midcontainer">
<div id="div6" style="height:80%;min-height:400px;">
<div style="width: 100%; height: 20%; margin-bottom: 13%;">
<div style="float: left; padding-left: 5%; width: 25%; text-align: left;"> Name</div>
<div style="float: left; width: 55%; padding-left: 5%;"> <input type="text" id="txtHtmlName" class="newstyle" name="name"></div>
</div>
<div style="width: 100%; height: 20%; margin-bottom: 13%;">
<div style="float: left; padding-left: 5%; width: 25%; text-align: left;"> Address</div>
<div style="float: left; width: 55%; padding-left: 5%;"> <input type="text" id="txtHtmlAddress" class="newstyle" name="name"></div>
</div>
<div style="width: 100%; height: 20%; margin-bottom: 13%;">
<div style="float: left; padding-left: 5%; width: 25%; text-align: left;"> Country</div>
<div style="float: left; width: 55%; padding-left: 5%;"> <input type="text" id="txtHtmlCountry" class="newstyle" name="name"></div>
</div>
<div style="width: 100%; height: 20%; margin-bottom: 13%;">
<div style="float: left; padding-left: 5%; width: 25%; text-align: left;"> Email</div>
<div style="float: left; width: 55%; padding-left: 5%;"> <input type="text" id="txtHtmlEmail" class="newstyle" name="name"></div>
</div>
<div style="width: 100%; height: 20%; margin-bottom: 13%;">
<div style="float: left; padding-left: 5%; width: 25%; text-align: left;"> Phone</div>
<div style="float: left; width: 55%; padding-left: 5%;"> <input type="text" id="txtHtmlPhone" class="newstyle" name="name"></div>
</div>
<div style="width: 100%; height: 20%; margin-bottom: 13%;text-align:center;margin-top:20%;">
<input type="button" id="btnHtmlSaveContactForm" class="newButton" value="SAVE"/>
</div>
</div>
</div>
<div id="divContactFormFooterText" class="inner-txtfooter" > </div>
<div id="divContactFormFooterImg" class="inner-imgfooter"><img id="ContactFormFooterImage" style="width:100%;"/></div>
</div>
</div>
<div data-role="footer" class="footer-common footerimg" ></div>
</div>
<div data-role="view" id="tabstrip-news">
<div data-role="header" class="header-news3" >
<span class="headerContent1"> News & Articles </span>
</div>
<div id="divNewsMain" data-role="scroller" class="scroller-content middle-home3">
<div id="divNewsPageBackgroundImage" class="inner-container">
<div id="divNewsheaderImg" class="inner-imgheader"> <img id="NewsHeaderImage" style="width:100%;"/></div>
<div id="divNewsHeaderText" class="inner-txtheader"></div>
<div id="divNewsContainer" class="inner-midcontainer">
This is News and Article Page
</div>
<div id="divNewsFooterText" class="inner-txtfooter" > </div>
<div id="divNewsFooterImg" class="inner-imgfooter"><img id="NewsFooterImage" style="width:100%;"/></div>
</div>
</div>
<div data-role="footer" class="footer-common footerimg" ></div>
</div>
<div data-role="view" id="tabstrip-About">
<div data-role="header" class="header-about3" >
<span class="headerContent1"> About Page</span>
</div>
<div id="divAboutMain" data-role="scroller" class="scroller-content middle-home3">
<div id="divAboutPageBackgroundImage" class="inner-container">
<div id="divAboutHeaderImg" class="inner-imgheader"> <img id="AboutHeaderImage" style="width:100%;"/></div>
<div id="divAboutHeaderText" class="inner-txtheader"></div>
<div id="divAboutContainer" class="inner-midcontainer">
This Is About Page
</div>
<div id="divAboutFootertext" class="inner-txtfooter" > </div>
<div id="divAboutFooterImg" class="inner-imgfooter"><img id="AboutFooterImage" style="width:100%;"/></div>
</div>
</div>
<div data-role="footer" class="footer-common footerimg" ></div>
</div>
<div data-role="view" id="tabstrip-Events">
<div data-role="header" class="header-event3" >
<span class="headerContent1">Events</span>
</div>
<div id="divEventsMain" data-role="scroller" class="scroller-content middle-home3">
<div id="divEventsPageBackgroundImage" class="inner-container">
<div id="divEventsHeaderImg" class="inner-imgheader"> <img id="EventsHeaderImage" style="width:100%;"/></div>
<div id="divEventsHeaderText" class="inner-txtheader"></div>
<div id="divEventsContainer" class="inner-midcontainer">
This is Events Page
</div>
<div id="divEventsFooterText" class="inner-txtfooter" > </div>
<div id="divEventsFooterImg" class="inner-imgfooter"><img id="EventsFooterImage" style="width:100%;"/></div>
</div>
</div>
<div data-role="footer" class="footer-common footerimg" ></div>
</div>
<div data-role="view" id="tabstrip-Team">
<div data-role="header" class="header-team3" >
<span class="headerContent1"> Team Member </span>
</div>
<div id="divTeamMain" data-role="scroller" class="scroller-content middle-home3">
<div id="divTeamPageBackgroundImage" class="inner-container">
<div id="divTeamheaderImg" class="inner-imgheader"> <img id="TeamMembersHeaderImage" style="width:100%;"/></div>
<div id="divTeamHeaderText" class="inner-txtheader"></div>
<div id="divTeamContainer" class="inner-midcontainer">
<div id="div2" style="height:80%;min-height:400px;">
This is team member page
</div>
<div id="div3" style="float: left;height: 20%;position: relative;width: 100%;"></div>
</div>
<div id="divTeamFooterText" class="inner-txtfooter" > </div>
<div id="divTeamFooterImg" class="inner-imgfooter"><img id="TeamMembersFooterImage" style="width:100%;"/></div>
</div>
</div>
<div data-role="footer" class="footer-common footerimg" ></div>
</div>
<div data-role="view" id="tabstrip-Contacts">
<div data-role="header" class="header-contact3" >
<span class="headerContent1"> Contact Details</span>
</div>
<div id="divContactDetailsMain" data-role="scroller" class="scroller-content middle-home3">
<div id="divContactDetailsPageBackgroundImage" class="inner-container">
<div id="divContactDetailsHeaderImg" class="inner-imgheader"> <img id="ContactDetailsHeaderImage" style="width:100%;"/></div>
<div id="divContactDetailsHeaderText" class="inner-txtheader"></div>
<div id="divContactDetailsContainer" class="inner-midcontainer">
This is contact details Page
</div>
<div id="divContactDetailsFooterText" class="inner-txtfooter" > </div>
<div id="divContactDetailsFooterImg" class="inner-imgfooter"><img id="ContactDetailsFooterImage" style="width:100%;"/></div>
</div>
</div>
<div data-role="footer" class="footer-common footerimg" ></div>
</div>
<div data-role="view" id="tabstrip-Facebook">
<div data-role="header" class="header-mile3" >
<span class="headerContent1"> Facebook </span>
</div>
<div data-role="footer" class="footer-common footerimg" ></div>
</div>
<div data-role="view" id="tabstrip-miles">
<div data-role="header" class="header-mile3" >
<span class="headerContent1"> Milestones </span>
</div>
<div id="divMilestonesMain" data-role="scroller" class="scroller-content middle-home3">
<div id="divMilestonesPageBackgroundImage" class="inner-container">
<div id="divMilestonesHeaderImg" class="inner-imgheader"> <img id="MilestoneHeaderImage" style="width:100%;"/></div>
<div id="divMilestonesHeaderText" class="inner-txtheader"></div>
<div id="divMilestonesContainer" class="inner-midcontainer">
this is Milestones page
</div>
<div id="divMilestonesFooterText" class="inner-txtfooter" > </div>
<div id="divMilestonesFooterImg" class="inner-imgfooter"><img id="MilestoneFooterImage" style="width:100%;"/></div>
</div>
</div>
<div data-role="footer" class="footer-common footerimg" ></div>
</div>
<!--3rd layout ends here-->
<script>
var subMenuVal = parent.document.getElementById("selectedSubMenu").value;
if ((subMenuVal == "") || (typeof subMenuVal === "undefined")) {
var app = new kendo.mobile.Application(document.body, { transition: "slide", layout: "mobile-tabstrip" });
}
else {
console.log(subMenuVal);
var app = new kendo.mobile.Application(document.body, { transition: "slide", initial: subMenuVal });
}
</script>
</body>
Thanks in advance

Resources