I am trying to have a thumbnail grid. Each thumbnail can have either one of two different height, but I want the whole row to have the same height
As can be seen, because the last two thumbnails are higher, the rest get's pushed down.
When I inspect it with Google Devtools, no padding or margin has been added, they're just being forced down somehow
CSS:
.video {
display: inline-block;
width: 220px;
height: 250px;
margin: 0 0 15px 15px;
h4 {
margin-top: 5px;
}
.thumbnail {
padding: 0px;
border: none;
background: none;
// box-shadow: 5px 5px 15px -6px;
.caption {
word-break: break-all;
}
}
}
HTML:
<div class="row">
<div class="col-xs-12">
<div class="videoList">
<div class="video">
<div class="item">
<div class="thumbnail">
<img src="https://i.ytimg.com/s_vi/YXQdrjJiQjY/hqdefault.jpg?sqp=CNjOtKgF&rs=AOn4CLAx8dW9kP4W6XdVeCR73QmLOEOdNw" alt="thumbnail">
<div class="caption">
<h4><span class="title">My Slideshow</span></h4>
<ul class="list-inline">
<li>1 views</li>
<li><i class="fa fa-thumbs-o-up"></i> 0</li>
<li><i class="fa fa-thumbs-o-down"></i> 0</li>
<li><i class="fa fa-comment-o"></i> 0</li>
</ul>
</div>
</div>
</div>
</div>
<div class="video">
<div class="item">
<div class="thumbnail">
<img src="https://i.ytimg.com/s_vi/Ii7FfPgDU6A/hqdefault.jpg?sqp=CNjOtKgF&rs=AOn4CLAU-ezif1lm8rXcVNRePjnfVhGvTA" alt="thumbnail">
<div class="caption">
<h4><span class="title">My Slideshow</span></h4>
<ul class="list-inline">
<li>1 views</li>
<li><i class="fa fa-thumbs-o-up"></i> 0</li>
<li><i class="fa fa-thumbs-o-down"></i> 0</li>
<li><i class="fa fa-comment-o"></i> 0</li>
</ul>
</div>
</div>
</div>
</div>
<div class="video">
<div class="item">
<div class="thumbnail">
<img src="https://i.ytimg.com/s_vi/GB9syW4zI2o/hqdefault.jpg?sqp=CNjOtKgF&rs=AOn4CLDbBXF49SYPGVhCKJ6QqYcwP3xpEA" alt="thumbnail">
<div class="caption">
<h4><span class="title">My Slideshow</span></h4>
<ul class="list-inline">
<li>0 views</li>
<li><i class="fa fa-thumbs-o-up"></i> 0</li>
<li><i class="fa fa-thumbs-o-down"></i> 0</li>
<li><i class="fa fa-comment-o"></i> 0</li>
</ul>
</div>
</div>
</div>
</div>
<div class="video">
<div class="item">
<div class="thumbnail">
<img src="https://i.ytimg.com/s_vi/b7dK2DEMkyI/hqdefault.jpg?sqp=CNjOtKgF&rs=AOn4CLC6UBWeTho-vmmSozu-CG1Zno88vQ" alt="thumbnail">
<div class="caption">
<h4><span class="title">My Slideshow</span></h4>
<ul class="list-inline">
<li>1 views</li>
<li><i class="fa fa-thumbs-o-up"></i> 0</li>
<li><i class="fa fa-thumbs-o-down"></i> 0</li>
<li><i class="fa fa-comment-o"></i> 0</li>
</ul>
</div>
</div>
</div>
</div>
<div class="video">
<div class="item">
<div class="thumbnail">
*<img src="https://i.ytimg.com/s_vi/9nizjdeEecE/hqdefault.jpg?sqp=CNjOtKgF&rs=AOn4CLC5VfvmjPALw-K5COknauUE2fTORg" alt="thumbnail">
<div class="caption">
<h4><span class="title">John Lennon - Imagine (rock instrumenta...</span></h4>
<ul class="list-inline">
<li>38 views</li>
<li><i class="fa fa-thumbs-o-up"></i> 0</li>
<li><i class="fa fa-thumbs-o-down"></i> 3</li>
<li><i class="fa fa-comment-o"></i> 0</li>
</ul>
</div>
</div>
</div>
</div>
Any help is much appreciated
It's because other divs have longer titles than others and your div are aligning them bottom by default.To fix this problem you'll need to add vertical-align:top; to your class .item, if not I think the class is .thumbnail
.item {
vertical-align:top;
}
add vertical align to video class:
vertical-align:top
Related
Which property can I use to align vertically the font awesome icon with the word support? I mean this navigation list:
<nav class="nav">
<ul class="nav__list--second">
<i class="far fa-life-ring fa-2x"></i>
Support
</ul>
</nav>
#import url('https://fonts.googleapis.com/css?family=Lato&display=swap');
body {
margin: 0;
padding: 0;
box-sizing: border-box;
font-family: 'Lato', sans-serif;
font-size: 16px;
}
header {
display: flex;
flex-direction: row;
justify-content: space-between;
width: 95vw;
padding: 10px;
margin: 10px;
}
header .brand img {
width: 60px;
}
header nav ul {
list-style: none;
}
ul.nav__list--first {
vertical-align: middle;
}
header .nav__list--first li,
header .nav__list--second li
{
text-decoration: none;
display: inline;
margin: 10px;
}
header .nav__list--first li a,
header .nav__list--second li a {
text-decoration: none;
}
<head>
<script src="https://kit.fontawesome.com/69b14a4680.js" crossorigin="anonymous"></script>
</head>
<header>
<div class="brand">
<a href="/">
<img src="./assets/images/logo.png" alt="GEM Logo" />
</a>
</div>
<nav class="nav">
<ul class="nav__list--first">
<li>
Home
</li>
<li>
Company
</li>
<li>
Solutions
</li>
</ul>
</nav>
<nav class="nav">
<ul class="nav__list--second">
<i class="far fa-life-ring fa-2x"></i>
Support
</ul>
</nav>
</header>
<div class="container">
<main id="main">
<div class="main">
</div>
</main>
<section id="why-choose-us">
<div class="container">
<div class="card">
<div class="card-icon">
<i>icon</i>
</div>
<div class="card-description">
<p>Description</p>
</div>
</div>
<div class="card">
<div class="card-icon">
<i>icon</i>
</div>
<div class="card-description">
<p>Description</p>
</div>
</div>
<div class="card">
<div class="card-icon">
<i>icon</i>
</div>
<div class="card-description">
<p>Description</p>
</div>
</div>
</div>
</section>
<section id="about-us" class="about-us">
<div class="title">
<h2>Our Team</h2>
</div>
<div class="container">
<div class="card">
<img src="./assets/images/team/enrique.jpg" alt="Enrique Massuet" />
<p>Enrique Massuet</p>
<p>CEO</p>
<p>Medical Insurance Specialist.</p>
<div class="personal-social-icons">
<a href="https://twitter.com/uno ahi">
<i class="fab fa-twitter"></i>
</a>
<a href="https://www.facebook.com/emassuet">
<i class="twitter"></i>
</a>
<a href="https://instagram.com/emassuet">
<i class="twitter"></i>
</a>
<a href="mailto://emassuet#gemfs.company">
<i class="twitter"></i>
</a>
</div>
</div>
<div class="card">
<img src="./assets/images/team/giosvel.jpg" alt="Giosvel Carril" />
<p>Giosvel Carril</p>
<p>CFO</p>
<p>Life Insurance Specialist.</p>
<div class="personal-social-icons">
<a href="https://twitter.com/uno ahi">
<i class="fab fa-twitter"></i>
</a>
<a href="https://www.facebook.com/emassuet">
<i class="twitter"></i>
</a>
<a href="https://instagram.com/emassuet">
<i class="twitter"></i>
</a>
<a href="mailto://emassuet#gemfs.company">
<i class="twitter"></i>
</a>
</div>
</div>
<div class="card">
<img src="./assets/images/team/diesan.jpg" alt="Diesan Romero" />
<p>Diesan Romero</p>
<p>CTO</p>
<p>Technology and Data Science Expert/</p>
<div class="personal-social-icons">
<a href="https://twitter.com/diesanromero">
<i class="fab fa-twitter"></i>
</a>
<a href="https://www.facebook.com/diesan.romero.56">
<i class="fab fa-facebook-f"></i>
</a>
<a href="https://instagram.com/diesanromero">
<i class="fab fa-instagram"></i>
</a>
<a href="https://www.linkedin.com/in/diesanromeros/">
<i class="fab fa-linkedin-in"></i>
</a>
<a href="mailto://diesanromero#gemfs.company">
<i class="far fa-envelope"></i>
</a>
</div>
</div>
</div>
</section>
</div>
<footer class="footer">
<div class="copyright">
<p>Copyright</p>
</div>
<ul class="social-icons">
<a href="">
<i class="fab fa-twitter"></i>
</a>
<a href="">
<i class="fab fa-facebook-f"></i>
</a>
<a href="">
<i class="fab fa-instagram"></i>
</a>
<a href="https://www.linkedin.com/company/gemfsolutions/">
<i class="fab fa-linkedin-in"></i>
</a>
</ul>
</footer>
Just make it flex and align the items center.
.nav__list--second {
display: flex;
flex-direction: row;
align-items: center;
}
Use flexbox with align-items:center
#import url('https://fonts.googleapis.com/css?family=Lato&display=swap');
body {
margin: 0;
padding: 0;
box-sizing: border-box;
font-family: 'Lato', sans-serif;
font-size: 16px;
}
header {
display: flex;
flex-direction: row;
justify-content: space-between;
width: 95vw;
padding: 10px;
margin: 10px;
}
header .brand img {
width: 60px;
}
header nav ul {
list-style: none;
}
ul.nav__list--first {
vertical-align: middle;
}
header .nav__list--first li,
header .nav__list--second li
{
text-decoration: none;
display: inline;
margin: 10px;
}
header .nav__list--first li a,
header .nav__list--second li a {
text-decoration: none;
}
.nav ul{
display:flex;
align-items:center;
}
<head>
<script src="https://kit.fontawesome.com/69b14a4680.js" crossorigin="anonymous"></script>
</head>
<header>
<div class="brand">
<a href="/">
<img src="./assets/images/logo.png" alt="GEM Logo" />
</a>
</div>
<nav class="nav">
<ul class="nav__list--first">
<li>
Home
</li>
<li>
Company
</li>
<li>
Solutions
</li>
</ul>
</nav>
<nav class="nav">
<ul class="nav__list--second">
<i class="far fa-life-ring fa-2x"></i>
Support
</ul>
</nav>
</header>
<div class="container">
<main id="main">
<div class="main">
</div>
</main>
<section id="why-choose-us">
<div class="container">
<div class="card">
<div class="card-icon">
<i>icon</i>
</div>
<div class="card-description">
<p>Description</p>
</div>
</div>
<div class="card">
<div class="card-icon">
<i>icon</i>
</div>
<div class="card-description">
<p>Description</p>
</div>
</div>
<div class="card">
<div class="card-icon">
<i>icon</i>
</div>
<div class="card-description">
<p>Description</p>
</div>
</div>
</div>
</section>
<section id="about-us" class="about-us">
<div class="title">
<h2>Our Team</h2>
</div>
<div class="container">
<div class="card">
<img src="./assets/images/team/enrique.jpg" alt="Enrique Massuet" />
<p>Enrique Massuet</p>
<p>CEO</p>
<p>Medical Insurance Specialist.</p>
<div class="personal-social-icons">
<a href="https://twitter.com/uno ahi">
<i class="fab fa-twitter"></i>
</a>
<a href="https://www.facebook.com/emassuet">
<i class="twitter"></i>
</a>
<a href="https://instagram.com/emassuet">
<i class="twitter"></i>
</a>
<a href="mailto://emassuet#gemfs.company">
<i class="twitter"></i>
</a>
</div>
</div>
<div class="card">
<img src="./assets/images/team/giosvel.jpg" alt="Giosvel Carril" />
<p>Giosvel Carril</p>
<p>CFO</p>
<p>Life Insurance Specialist.</p>
<div class="personal-social-icons">
<a href="https://twitter.com/uno ahi">
<i class="fab fa-twitter"></i>
</a>
<a href="https://www.facebook.com/emassuet">
<i class="twitter"></i>
</a>
<a href="https://instagram.com/emassuet">
<i class="twitter"></i>
</a>
<a href="mailto://emassuet#gemfs.company">
<i class="twitter"></i>
</a>
</div>
</div>
<div class="card">
<img src="./assets/images/team/diesan.jpg" alt="Diesan Romero" />
<p>Diesan Romero</p>
<p>CTO</p>
<p>Technology and Data Science Expert/</p>
<div class="personal-social-icons">
<a href="https://twitter.com/diesanromero">
<i class="fab fa-twitter"></i>
</a>
<a href="https://www.facebook.com/diesan.romero.56">
<i class="fab fa-facebook-f"></i>
</a>
<a href="https://instagram.com/diesanromero">
<i class="fab fa-instagram"></i>
</a>
<a href="https://www.linkedin.com/in/diesanromeros/">
<i class="fab fa-linkedin-in"></i>
</a>
<a href="mailto://diesanromero#gemfs.company">
<i class="far fa-envelope"></i>
</a>
</div>
</div>
</div>
</section>
</div>
<footer class="footer">
<div class="copyright">
<p>Copyright</p>
</div>
<ul class="social-icons">
<a href="">
<i class="fab fa-twitter"></i>
</a>
<a href="">
<i class="fab fa-facebook-f"></i>
</a>
<a href="">
<i class="fab fa-instagram"></i>
</a>
<a href="https://www.linkedin.com/company/gemfsolutions/">
<i class="fab fa-linkedin-in"></i>
</a>
</ul>
</footer>
i have this piece of code which not in order.i am trying to make it appear in the middle of the page but i want to to stick to one line in verticle.
current outcome is as below.How do i adjust contacts inline?
<div class="col-md-12">
<div>
<ul class="list-icons" style="text-align: center;margin-left:0;">
<li><i class="fa fa-phone-square pr-10 text-default" style="font-size:15px"></i> +65 1234567</li>
<li><i class="fa fa-fax pr-10 text-default" style="font-size:15px"></i> +65 12345678</li>
<li "><i class="fa fa-envelope pr-10 text-default" style="font-size:15px"></i>contactus#testmail.com</li>
</ul>
</div>
<br>
</div>
add text-align:center to the div containing your ul, then change the ul text-align:center to text-align: left and add display: inline-block
<script src="https://use.fontawesome.com/89d51f385b.js"></script>
<link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" rel="stylesheet" />
<div class="col-md-12">
<div style="text-align:center;">
<ul class="list-icons" style="text-align: left;margin-left:0; display:inline-block; list-style-type: none;">
<li><i class="fa fa-phone-square pr-10 text-default" style="font-size:15px"></i> +65 1234567</li>
<li><i class="fa fa-fax pr-10 text-default" style="font-size:15px"></i> +65 12345678</li>
<li><i class="fa fa-envelope pr-10 text-default " style="font-size:15px"></i>contactus#testmail.com</li>
</ul>
</div>
<br>
</div>
I have a web page ioterm which I tried to make it responsive. I tested on several web browsers FF, IE11 and Chrome 44. The problem is the div seems lower when it is displayed with Chrome. You can check it when you enter my sample page and navigate to products page. (WASPMOTE) When images slide, you will notice the WASPMOTE div positions lower than the others. It seems OK with FF and IE11. How can I fix this for Chrome?
Incase you can't access my page here is the images.imgur
Thanks in advance.
EdiT
Here is the problemmatic div.
<div class="row item active" id="one">
<div>
<div class="row ">
<div class="col-md-4" id="img1">
<img class="img-center" src="images/waspmote_pro_t.png" alt="waspmote">
</div>
<div class="col-md-4" id="img2">
<img class="img-center" src="images/waspmote_exp_radio_board_2-375_t.png" alt="waspmote">
</div>
<div class="col-md-4" id="img3">
<img class="img-center" src="images/u13_gw_t.png" alt="waspmote">
</div>
</div>
</div>
<div class="caption row ">
<div class="col-md-12">
<h3 class="productHeight">Waspmote</h3>
</div>
<div class="row" id="desc">
<div class="col-md-4" id="exp1">
<ul style="list-style-type: none;" class="productSize">
<li lang="tr">
<i class="fa fa-share-alt"></i> Tüm sensörlere bağlanabilir
</li>
<li lang="tr">
<i class="fa fa-rss"></i> Tüm wi-fi teknolojilerini destekler
</li>
<li lang="tr">
<i class="fa fa-cloud"></i> Bulut teknolojilerine uyumlu
</li>
</ul>
</div>
<div class="col-md-4" id="exp2">
<ul style="list-style-type: none;" class="waspmote">
<li lang="tr">
<i class="fa fa-check-circle"></i> Ultra düşük güç (0.7uA)
</li>
<li lang="tr">
<i class="fa fa-check-circle"></i> 100+ Sensör uyumluluğu
</li>
<li lang="tr">
<i class="fa fa-check-circle"></i> Kablosuz uzaktan programlama
</li>
<li lang="tr">
<i class="fa fa-check-circle"></i> Şifreleme Kütüphaneleri (AES, RSA)
</li>
<li lang="tr">
<i class="fa fa-check-circle"></i> Encapsulated line available
</li>
</ul>
</div>
<div class="col-md-4" id="exp3">
<ul style="list-style-type: none;" class="waspmote">
<li lang="tr">
<i class="fa fa-check-circle"></i> Desteklediği Protokoller: RS-232,RS-485,Modbus,CAN Bus, 4-20mA
</li>
<li lang="tr">
<i class="fa fa-check-circle"></i> 3G/GPRS/LoRaWAN/LoRa/Sigfox/868/900MHz,ZigBee/802.15.4/WiFi/RFID/ NFC/ Bluetooth 4.0
</li>
</ul>
</div>
</div>
</div>
I'm working on Foundation Zurb template and I'm trying to get it working.
I have Top Bar at the top of the screen (full width), Icon Bar at the left side (full height). I know that Foundation has 12 grid system.
According to Foundation:
The Foundation Top Bar gives you a great way to display a complex
navigation bar on small, medium or large screens.
And:
An Icon Bar provides a menu to quickly navigate an app. Use the Icon
Bar horizontally or vertically, with the labels below the icons or to
the right. Have it your way.
Here is my template. I've took out div.large-9.columns etc.. Because they were braking the view.
<!-- Navigation -->
<nav class="top-bar" data-topbar role="navigation">
<ul class="title-area">
<li class="name">
<h1>LOGO PLACEHOLDER</h1>
</li>
<li class="toggle-topbar menu-icon"><span>Menu</span></li>
</ul>
<section class="top-bar-section">
<!-- Right Nav Section -->
<ul class="right">
<li class="active"><i class="fa fa-diamond"></i> Go PRO</li>
<li class="has-dropdown">
<i class="fa fa-user"></i> My Account
<ul class="dropdown">
<li>Some Li's here</li>
</ul>
</li>
</ul>
<!-- Left Nav Section -->
<ul class="left">
<li><i class="fa fa-database"></i> ONE</li>
<li><i class="fa fa-list-ol"></i> TWO</li>
<li><i class="fa fa-users"></i> THREE</li>
</ul>
</section>
</nav>
<!-- Left Nav Sidebar -->
<div class="icon-bar vertical five-up">
<a class="item">
<i class="fa fa-home"></i>
<label>Home</label>
</a>
<a class="item">
<i class="fa fa-gamepad"></i>
<label>ONE</label>
</a>
<a class="item">
<i class="fa fa-star"></i>
<label>TWO</label>
</a>
<a class="item">
<i class="fa fa-thumbs-up"></i>
<label>THREE</label>
</a>
<a class="item">
<i class="fa fa-trophy"></i>
<label>FOUR</label>
</a>
</div>
I want to achieve:
Top Bar and Icon Bar the same
Content Area to be fixed and have large-8 or large-9
Sidebar to be fixed and have large-3
What I've already tried:
Was separating all 3 bits with div.large-1/8/3, nothing happened
Was nesting them into div.row
I think I've tried almost everything, but have no idea, what is the problem.
i had done the changes in html and css. this what your expecting
html code
<nav class="top-bar" data-topbar role="navigation">
<ul class="title-area">
<li class="name">
<h1>LOGO PLACEHOLDER</h1>
</li>
<li class="toggle-topbar menu-icon"><span>Menu</span></li>
</ul>
<section class="top-bar-section">
<!-- Right Nav Section -->
<ul class="right">
<li class="active"><i class="fa fa-diamond"></i> Go PRO</li>
<li class="has-dropdown">
<i class="fa fa-user"></i> My Account
<ul class="dropdown">
<li>Some Li's here</li>
</ul>
</li>
</ul>
<!-- Left Nav Section -->
<ul class="left">
<li><i class="fa fa-database"></i> ONE</li>
<li><i class="fa fa-list-ol"></i> TWO</li>
<li><i class="fa fa-users"></i> THREE</li>
</ul>
</section>
</nav>
<!-- Left Nav Sidebar -->
<div class="medium-1 columns left-nav">
<div class="icon-bar vertical five-up">
<a class="item">
<i class="fa fa-home"></i>
<label>Home</label>
</a>
<a class="item">
<i class="fa fa-gamepad"></i>
<label>ONE</label>
</a>
<a class="item">
<i class="fa fa-star"></i>
<label>TWO</label>
</a>
<a class="item">
<i class="fa fa-thumbs-up"></i>
<label>THREE</label>
</a>
<a class="item">
<i class="fa fa-trophy"></i>
<label>FOUR</label>
</a>
</div>
</div>
<div class="medium-8 columns content-area">content-area</div>
<div class="medium-3 columns sidebar">columns sidebar</div>
css code
.columns.content-area{border:1px solid #111;padding:0}
.columns.sidebar{border:1px solid #111;padding:0}
.columns.left-nav{padding:0}
.icon-bar.vertical.five-up{width:100%}
demo jsFiddle
I am creating a small landing page at http://www.saleshuddlegames.com
on the desktop everything is fine but when I start using tablets and smartphones, everything starts going out of alignment. I can't seem to make anything centered.
Specifically look at my .footer
<footer>
<div class="row">
<div class="col-md-4 col-sm-10 col-sm-offset-2 col-xs-12 centered">
<ul class="social navbar-nav">
<li class="social-item"><i class="fa fa-facebook fa-3x"></i></li>
<li class="social-item"><i class="fa fa-instagram fa-3x"></i></li>
<li class="social-item"><i class="fa fa-youtube fa-3x"></i></li>
<li class="social-item"><i class="fa fa-twitter fa-3x"></i></li>
</ul>
</div>
</div>
<div class="row">
<div class="copyright col-md-6 col-md-offset-4 col-sm-10 col-sm-offset-2 col-xs-12">
<p>© 2013. The Training Game is property of Sales Huddle Group, Inc.</p>
</div>
</div>
</footer>
I used a centering snippet from a previous post:
.centered {
float:none;
margin: 0 auto;
}
Any Ideas??
Have you tried using the text-center class from bootstrap?
I've juggled the selection of columns for the social icons, and removed them all for the copyright text.. now this looks good here at all browser sizes:
<footer>
<div class="row">
<div class="col-md-4 col-md-offset-4 col-sm-4 col-sm-offset-4 col-xs-12 text-center">
<ul class="social navbar-nav">
<li class="social-item"><i class="fa fa-facebook fa-3x"></i></li>
<li class="social-item"><i class="fa fa-instagram fa-3x"></i></li>
<li class="social-item"><i class="fa fa-youtube fa-3x"></i></li>
<li class="social-item"><i class="fa fa-twitter fa-3x"></i></li>
</ul>
</div>
</div>
<div class="row">
<div class="copyright text-center">
<p>© 2013. The Training Game is property of Sales Huddle Group, Inc.</p>
</div>
</div>
</footer>