I want to add a number to the top left corner of my div's, but whatever I have tried so far has not worked properly.
Here is what I currently have:
Here is what I would like:
Here is the code:
#Office365, #OneDrive {
height: 100px;
width: 16.259%;
display: flex;
align-items: center;
justify-content: center;
margin-right: 5px;
background-color: #F2F2F2;
}
<div class="row" id="firstAppRow">
<div class="col-sm-2" id="Office365" style="padding-top: 20px; font-weight: bold;">
<span>1</span>
<div><img src="/TrainingResourceCenter/O365Training/PublishingImages/OVbiWcG.png" height="50px" width="50px" />
<p>Office365</p>
</div>
</div>
<div class="col-sm-2" id="OneDrive" style="padding-top: 20px; font-weight: bold;">
<div><img src="/TrainingResourceCenter/O365Training/PublishingImages/wJAtQYP.png" height="40px" width="40px" />
<p>OneDrive</p>
</div>
</div>
</div>
He, the solution will be to use absolute position for the numbers.
Note that the blocks containing the tag with the number will need to be positioned relative so that the numbers are absolute to that block. Here is a sample code
#Office365,#OneDrive{
display: inline-block;
margin-right: 2px;
background-color: #F2F2F2;
position:relative;
border:1px solid black;
padding: 0 50px;
text-align: center;
}
#Office365 img,#OneDrive img{
width:100px;
height: auto;
}
.num{
position: absolute;
top: 5px;
left: 5px;
}
<div class="row" id="firstAppRow">
<div class="col-sm-2" id="Office365" style="padding-top: 20px; font-weight: bold;">
<div><img src="https://png.icons8.com/color/1600/office-365.png" height="50px" width="50px" />
<p>Office365</p>
<span class="num">1</span>
</div>
</div>
<div class="col-sm-2" id="OneDrive" style="padding-top: 20px; font-weight: bold;">
<div><img src="https://bcpsodl.pbworks.com/f/1477585037/onedrive.png" height="40px" width="40px" />
<p>OneDrive</p>
<span class="num">2</span>
</div>
</div>
</div>
Try assigning
position: relative;
to the #Office365 and #OneDrive. Also put the images inside those divs.
Then assign
position: absolute;
left: 1px;
top: 1px;
to #Office365 span and #OneDrive span.
absolute vs float
.a {
width: 200px;
position: relative;
border: 1px solid gray;
margin-right:20px;
display:inline-block;
vertical-align:top;
}
.viaAbsolute {
position: absolute;
top:0;
left: 0;
padding: 3px;
border: 1px solid red;
}
.viaFloat {
float: left;
padding: 3px;
border: 1px solid red;
}
<div class="a">
<span class="viaAbsolute">
1
</span> Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nullam tempus rhoncus quam quis vestibulum. Cras eu mollis nisl. Pellentesque semper tincidunt placerat.
</div>
<div class="a">
<span class="viaFloat">
1
</span> Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nullam tempus rhoncus quam quis vestibulum. Cras eu mollis nisl. Pellentesque semper tincidunt placerat.
</div>
Related
I am trying to write a responsive footer. The footer items are separated by vertical bar (|). When we decrease the screen size, the footer items are wrapping to second line. Vertical bar (|) needs to be only between the footer items. Also facebook logo needs to be on the same line with the footer items for bigger screen sizes and on the center for smaller screen sizes. I used float:right but now they wrap from the beginning. How can I make them wrap from the end and hide vertical bar (|) if it is not between the footer items?
Here is my source code: https://jsfiddle.net/6kcdvteo/
body {
font-family: 'Calibri';
}
.text {
font-size: 1rem;
padding: 1rem 1rem 2rem 2rem;
color: #666666;
background-color: #f4f4f4;
}
.footer {
font-size: 0.85rem;
padding: 2rem 1rem 2rem 2rem;
background-color: #303741;
color: white;
}
.footer_company {
float: right;
padding-right: 2rem;
}
.footer_links {
font-size: 0.85rem;
background-color: #303741;
color: white;
padding-bottom: 2rem;
padding-right: 2.5rem;
}
.footer_links_span span {
background-color: #303741;
padding-right: 0.5rem;
float: right;
}
img {
height: 3rem;
width: 3rem;
}
.img {
padding-left: 1rem;
display: inline-block;
}
<div class="text">
<p>
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Cras ac cursus felis, ut egestas lacus. Sed nec elementum ipsum. Morbi metus est, venenatis at libero pharetra, suscipit posuere dolor. Proin a auctor nulla, sed tincidunt tellus. Nullam bibendum
luctus elit, sed porttitor lectus varius in. Cras venenatis rutrum urna at ultrices. Sed in luctus ligula.
</p>
</div>
<div class="footer">
<span class="footer_company">© My Company Name</span>
</div>
<div class="footer_links">
<div class="img">
<img src="https://image.flaticon.com/icons/png/512/124/124010.png">
</div>
<div class="footer_links_span">
<span>Sed metus</span>
<span>|</span>
<span>Aenean ultricies</span>
<span>|</span>
<span>Praesent vitae</span>
<span>|</span>
<span>Donec auctor</span>
<span>|</span>
<span>Vestibulum lobortis</span>
</div>
</div>
As part of your question you can use this
<div class="footer_links">
<div class="img">
<img src="https://image.flaticon.com/icons/png/512/124/124010.png" alt="">
</div>
<div class="footer_links_span">
<span><b>|</b> Sed metus</span>
<span><b>|</b> Aenean ultricies</span>
<span><b>|</b> Praesent vitae</span>
<span><b>|</b> Donec auctor</span>
<span><b>|</b> Vestibulum lobortis <b>|</b></span>
</div>
</div>
with this css
/* container */
.footer_links {
padding: 0.75rem 1.5rem;
font-size: 0.85rem;
background-color: #303741;
color: white;
}
/* clearfix floats */
.footer_links::after {
display: block;
clear: both;
content: "";
}
/* facebook img */
.img {
float: left;
}
.img img {
width: 3rem;
height: auto;
border: 0;
}
/* links */
.footer_links_span {
float: right;
width: calc(100% - 3.5rem);
text-align: right;
}
.footer_links_span span {
display: inline-block;
white-space: nowrap;
background-color: #303741;
}
.footer_links b {
padding: 0 0.2rem;
font-weight: inherit;
}
.footer_links_span span:first-child b {
padding-left: 0;
}
.footer_links_span span:last-child b {
padding-right: 0;
}
Maybe it will help you in the right direction.
This will solve your problem, but it's Bootstrap :) All your responsive screenshotes are implemented in this code. No extra css for the layout required.
EDIT: The included style is for the width of the links block and for hiding the pipe symbool on small screens.
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<title>Page</title>
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css">
<style type="text/css">
#footerSocial img { width: 3rem; margin-bottom: 0.5rem; }
#footerLinks > div { max-width: 350px; margin: auto; }
#footerLinks .dv { font-weight: inherit; display: none; }
#media (min-width: 576px) {
#footerSocial img { margin-bottom: 0; }
#footerLinks > div { max-width: none; padding-left: 100px; }
}
#media (min-width: 768px) {
#footerLinks > div { padding-left: 0; }
#footerLinks .dv { display: inline; }
}
</style>
</head>
<body>
<div class="container-fluid bg-secondary text-white">
<div class="row py-3">
<div class="col-12 text-center">
<h1 class="mb-2">Company Name</h1>
</div>
</div>
</div>
<div class="container">
<div class="row py-3">
<div class="col-12 ">
<h2>Article</h2>
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Cras ac cursus felis, ut egestas lacus.
Sed nec elementum ipsum. Morbi metus est, venenatis at libero pharetra, suscipit posuere dolor.
Proin a auctor nulla, sed tincidunt tellus. Nullam bibendum luctus elit, sed porttitor lectus
varius in. Cras venenatis rutrum urna at ultrices. Sed in luctus ligula.</p>
</div>
</div>
</div>
<div class="container-fluid bg-dark text-white">
<div class="row px-2 py-3">
<div id="footerSocial" class="col-12 col-sm-2 text-center text-sm-left">
<img class="img-fluid bg-white" src="https://image.flaticon.com/icons/png/512/124/124010.png" alt="FB">
</div>
<div id="footerLinks" class="col-12 col-sm-10 text-center text-sm-right">
<div>
© Company Name<br>
<span class="text-nowrap">Sed metus</span>
<span class="text-nowrap">| Aenean ultricies</span>
<span class="text-nowrap">| Praesent vitae</span>
<span class="text-nowrap"><b class="dv">| </b>Donec auctor</span>
<span class="text-nowrap">| Vestibulum lobortis</span>
</div>
</div>
</div>
</div>
</body>
</html>
I am trying to create a few block/box with image and two text - headline and subtext, but headline sometimes has one sentence, but another more, so if one has one and second one has two I would like to center vertically this first one.
For subtext I would like to vertically to the top.
Here is code which I am trying to use:
<div class="row row-home">
<div class="col-sm-4">
<img src="/images/home-1.png" alt="Schody" class="center-block img-responsive" />
<div class="text">
<h2>Schody</h2>
<h3>Lorem ipsum dolor sit amet, consectetur adipi scing elit. Nulla volut pat sem id turpis tempus efficitur. Maecenas eu bibendum sem.</h3>
</div>
</div>
<div class="col-sm-4">
<img src="/images/home-2.png" alt="Balustrady" class="center-block img-responsive" />
<div class="text">
<h2>Balustrady i ogrodzenia</h2>
<h3>Lorem ipsum dolor sit amet, consectetur adipi scing elit. Nulla volut pat sem id turpis tempus efficitur. Maecenas eu bibendum sem.</h3>
</div>
</div>
<div class="col-sm-4">
<img src="/images/home-3.png" alt="Meble" class="center-block img-responsive" />
<div class="text">
<h2>Meble</h2>
<h3>Lorem ipsum dolor sit amet, consectetur adipi scing elit. Nulla volut pat sem id turpis tempus efficitur. Maecenas eu bibendum sem.</h3>
</div>
</div>
</div>
Here is CSS:
#home .text {
display: flex;
flex-direction: column;
-ms-flex-direction: column;
position: relative;
text-align: center;
padding: 10px 20px 30px;
margin: 0px auto 40px;
width: 100%;
height: 100%;
max-width: 236px;
z-index: 1;
}
#home .text h2 {
display: flex;
flex-direction: column;
-ms-flex-direction: column;
justify-content: center;
flex: 1 0 auto;
position: relative;
color: white;
font-size: 14px;
font-weight: bold;
text-transform: uppercase;
margin-top: 40px;
margin-bottom: 0px;
z-index: 2;
}
#home .text h3 {
position: relative;
color: white;
font-size: 12px;
text-align: justify;
text-transform: uppercase;
text-align-last: center;
z-index: 2;
}
It almost work, but if h3 has less text in one of blocks this text align to the bottom and h2 goes down.
Here is live website to test
I create picture to show how it should work
Since the h2 elements aren't aware of each other, I suggest you give them a height, or else you will need a extensive markup change
Here I added height: 28px; to the .row-home .text h2 rule
.row-home .text {
display: flex;
flex-direction: column;
-ms-flex-direction: column;
position: relative;
text-align: center;
padding: 10px 20px 30px;
margin: 0px auto 40px;
width: 100%;
height: 100%;
max-width: 236px;
z-index: 1;
}
.row-home .text h2 {
display: flex;
flex-direction: column;
-ms-flex-direction: column;
justify-content: center;
flex: 1 0 auto;
position: relative;
color: white;
font-size: 14px;
height: 28px;
font-weight: bold;
text-transform: uppercase;
margin-top: 40px;
margin-bottom: 0px;
z-index: 2;
}
.row-home .text h3 {
position: relative;
color: white;
font-size: 12px;
text-align: justify;
text-transform: uppercase;
text-align-last: center;
z-index: 2;
}
<link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" rel="stylesheet" />
<div class="container">
<div class="row row-home">
<div class="col-sm-4">
<img src="http://malykowal.linuxpl.eu/images/home-1.png" alt="Schody" class="center-block img-responsive" />
<div class="text">
<h2>Schody</h2>
<h3>Lorem ipsum dolor sit amet, consectetur adipi scing elit. Nulla volut pat sem id turpis tempus efficitur. Maecenas eu bibendum sem.</h3>
</div>
</div>
<div class="col-sm-4">
<img src="http://malykowal.linuxpl.eu/images/home-1.png" alt="Balustrady" class="center-block img-responsive" />
<div class="text">
<h2>Balustrady i ogrodzenia</h2>
<h3>Lorem ipsum dolor sit amet, consectetur adipi scing elit. Nulla volut pat sem id turpis tempus efficitur. Maecenas eu bibendum sem.</h3>
</div>
</div>
<div class="col-sm-4">
<img src="http://malykowal.linuxpl.eu/images/home-1.png" alt="Meble" class="center-block img-responsive" />
<div class="text">
<h2>Meble</h2>
<h3>Lorem ipsum dolor sit amet, consectetur adipi scing elit. Nulla volut pat sem id turpis tempus efficitur. Maecenas eu bibendum sem.</h3>
</div>
</div>
</div>
</div>
Updated with a second version based on a comment
If you want this to be really dynamic, you'll need to break it down like this, where you make the col-sm-4 flex items
Updated again, with a media query, to utilize Flexbox's order property and re-position the elements on smaller screens
.row-home {
display: flex;
flex-wrap: wrap;
justify-content: center;
}
.row-home .col-sm-4 {
min-width: 0;
flex-basis: 33%;
padding: 10px 20px 30px;
}
.row-home .col-sm-4.vcentered {
align-self: center;
}
.row-home .col-sm-4 h2 {
font-size: 14px;
font-weight: bold;
text-transform: uppercase;
}
.row-home .col-sm-4 h3 {
font-size: 12px;
text-align: justify;
text-transform: uppercase;
text-align-last: center;
}
#media (max-width: 600px) {
.row-home .col-sm-4 {
flex-basis: 51%;
}
.row-home .col-sm-4 * {
text-align: center;
}
.row-home .col-sm-4:nth-child(3n+1) {
order: 1;
}
.row-home .col-sm-4:nth-child(3n+2) {
order: 2;
}
.row-home .col-sm-4:nth-child(3n+3) {
order: 3;
}
}
<link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" rel="stylesheet" />
<div class="container">
<div class="row row-home">
<div class="col-sm-4">
<img src="http://malykowal.linuxpl.eu/images/home-1.png" alt="Schody" class="center-block img-responsive" />
</div>
<div class="col-sm-4">
<img src="http://malykowal.linuxpl.eu/images/home-1.png" alt="Balustrady" class="center-block img-responsive" />
</div>
<div class="col-sm-4">
<img src="http://malykowal.linuxpl.eu/images/home-1.png" alt="Meble" class="center-block img-responsive" />
</div>
<div class="col-sm-4 vcentered">
<h2>Schody this is some extra text I added for test</h2>
</div>
<div class="col-sm-4 vcentered">
<h2>Balustrady i ogrodzenia</h2>
</div>
<div class="col-sm-4 vcentered">
<h2>Meble</h2>
</div>
<div class="col-sm-4">
<h3>Lorem ipsum dolor sit amet, consectetur adipi scing elit.</h3>
</div>
<div class="col-sm-4">
<h3>Lorem ipsum dolor sit amet, consectetur adipi scing elit. Nulla volut pat sem id turpis tempus efficitur. Maecenas eu bibendum sem.</h3>
</div>
<div class="col-sm-4">
<h3>Lorem ipsum dolor sit amet, consectetur adipi scing elit. Nulla volut pat sem id turpis tempus efficitur. Maecenas eu bibendum sem.</h3>
</div>
</div>
</div>
I've been going through lot of articles about placing a label/legend/text on the border of a div. I've a lot of div where I want to show the different labels exactly like the image shown below:
As I can see in the w3school they say to have a field set and get declare legend to display the texts, but its not working out for me. I have a set of jquery codes which appends the html with the labels :
$('.menu').hover(function () {
$(this).css('border', 'solid 2px #8080ff');
$(this).find('.divlabel').show();
}, function () {
$(this).css('border', 'none');
$(this).find('.divlabel').hide();
});
.divlabel {
float: left;
top: 5px;
right: 10px;
padding: 0px;
background: #fff;
}
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<div class="menu">
<div class="divlabel">Menu</div>
<ul class="mainmenu">
<li>...</li>
<li>...</li>
</ul>
</div>
<div>
Its not working as desired, please help out guys with this css.
You can use HTML5 data-* attribute to achieve this. It will save one div element:
body {
font: 14px/20px Arial, sans-serif;
}
.menu {
position: relative;
border: 3px solid #8fdaf9;
padding: 30px 10px;
}
.menu:before {
content: attr(data-title);
background: #8fdaf9;
position: absolute;
padding: 0 20px;
color: #fff;
left: 0;
top: 0;
}
.menu ul {
margin: 0;
}
<div class="menu" data-title="Menu">
<ul class="mainmenu">
<li>Menu Item 1</li>
<li>Menu Item 2</li>
</ul>
</div>
<div>
Below example can help you get started. A CSS only solution
div.wrapper {
position: relative;
border: 2px solid cornflowerblue;
margin-top: 20px;
padding: 20px 10px 10px;
}
div.wrapper label {
color: white;
line-height: 20px;
padding: 0 5px;
position: absolute;
background-color: cornflowerblue;
/* Adjust these values to posiytion the title or label */
top: -10px;
left: 10px;
}
<div class="wrapper">
<label>Menu 1</label>
<div>
Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Maecenas porttitor congue massa. Fusce posuere, magna sed pulvinar ultricies, purus lectus malesuada libero, sit amet commodo magna eros quis urna
</div>
</div>
<div class="wrapper">
<label>Menu 2</label>
<div>
Nunc viverra imperdiet enim. Fusce est. Vivamus a tellus.
</div>
</div>
<div class="wrapper">
<label>Menu 3</label>
<div></div>
</div>
<div class="wrapper">
<label>Menu 4</label>
<div></div>
</div>
<div class="wrapper">
<label>Menu 5</label>
<div></div>
</div>
<div class="wrapper">
<label>Menu 6</label>
<div>Suspendisse dui purus, scelerisque at, vulputate vitae, pretium mattis, nunc. Mauris eget neque at sem venenatis eleifend. Ut nonummy.</div>
</div>
I'm looking at the solution here on SO to set all columns in a bootstrap row to equal heights. It works fine in my fiddle, but in my browser with all other css the '.thumbnail.row.equalColumnHeight' css is not being used. There are black lines through it. I'm kinda a newbie to css, is there a way to override these black lines and get it to use the css for this class?
Here is what it looks like in Chrome dev tools.
here is the row in the browser - not equal heights.
Here is the code in fiddle where it shows unequal heights.
Here is the code.
html,
body,
.container-fluid,
.row {
height: 100%;
}
.row > div {
height: 100%;
}
.row .col-md-5 {
background-color: #eee;
top: 51px;
/*border: 1px solid black;*/
height: calc(100% - 51px);
padding-left: 0;
padding-right: 0;
}
.row .col-md-7 {
background-color: #ddd;
top: 51px;
/*border: 1px solid black;*/
height: calc(100% - 51px);
padding-left: 0;
padding-right: 0;
}
#googleResultMap {
width: 100%;
height: 100%;
/*border: 1px solid black;*/
}
.searchFilter {
/*width:200px;*/
height: 15%;
/*border: 1px solid blue;*/
}
.searchResults {
height: 85%;
border: 1px solid green;
overflow-y: scroll
}
input[readonly].default-cursor {
cursor: default;
background-color: white;
}
.date-field {
width: 120px;
}
##media only screen and (max-width:768px) {
/* only size 'xs' and below */
.searchResults {
height: 100%;
}
}
.thumbnail .col-lg-3 {
border: 1px solid red;
}
.searchResults {
height: 85%;
border: 1px solid green;
overflow-y: scroll
}
.thumbnail.row {
height: auto;
}
.cborder {
border: 1px solid pink;
}
.imageColumn {
padding-right: 0;
padding-left: 0;
}
.thumbnail.row.equalColumnHeight {
display: -webkit-box;
display: -webkit-flex;
display: -ms-flexbox;
display: flex;
}
<div class="container-fluid">
<div class="row">
<div class="col-lg-5 col-md-5 col-sm-5 hidden-xs">
#*Sidebar*#
<div id="googleResultMap"></div>
</div>
<div class="col-lg-7 col-md-7 col-sm-7 col-xs-12">
#*Body content*#
<div class="searchFilter col-lg-12 col-md-12 col-sm-12 hidden-xs">
#Html.TextBoxFor(model => model.ClassDate, "{0:MM/dd/yyyy}", new { #class = "date-field form-control default-cursor", #readonly = "readonly" }) #Html.Hidden("classTime")
<br/>Time Filter
<br/>Open Classes Only
</div>
#*
<div class="searchResults col-lg-12 col-xs-12 col-sm-12">*#
<div class="searchResults col-lg-12 col-xs-12 col-sm-12">
<div class="thumbnail row equalColumnHeight">
<div class="col-lg-3 col-xs-3 imageColumn">
#*
<h3>Thumbnail label</h3>
<p>
<a class="btn btn-primary" role="button" data-toggle="collapse" href="#collapseExample" aria-expanded="false" aria-controls="collapseExample">
Link
</a>Test Data
</p>*#
<img src="http://www.joomlaworks.net/images/demos/galleries/abstract/7.jpg" class="img-responsive center-block" alt="Responsive image" style="width: 100%; border: 1px solid purple;">
<img src="http://www.joomlaworks.net/images/demos/galleries/abstract/7.jpg" class="img-responsive center-block" alt="Responsive image" style="width: 100%; border: 1px solid purple;">
<img src="http://www.joomlaworks.net/images/demos/galleries/abstract/7.jpg" class="img-responsive center-block" alt="Responsive image" style="width: 100%; border: 1px solid purple;">
</div>
<div class="col-lg-3 col-xs-3" style="text-align: center;">
#*
<h3>Thumbnail label</h3>
<p>Cras justo odio, dapibus ac facilisis in, egestas eget quam. Donec id elit non mi porta gravida at eget metus. Nullam id dolor id nibh ultricies vehicula ut id elit.</p>*#
<i class="fa fa-users fa-5x" style="margin: auto;"></i>
</div>
<div class="col-lg-3 col-xs-3" style="text-align: center;">
#*
<h3>Thumbnail label</h3>
<p>Cras justo odio, dapibus ac facilisis in, egestas eget quam. Donec id elit non mi porta gravida at eget metus. Nullam id dolor id nibh ultricies vehicula ut id elit.</p>*#
<i class="fa fa-user fa-5x" style="margin: auto;"></i>
</div>
<div class="col-lg-3 col-xs-3">
#*
<h3>Thumbnail label</h3>
<p>Cras justo odio, dapibus ac facilisis in, egestas eget quam. Donec id elit non mi porta gravida at eget metus. Nullam id dolor id nibh ultricies vehicula ut id elit.</p>*#
</div>
<div class="collapse cborder" id="collapseExample">
<div class="well">
test data
<br />test data
<br />test data
<br />
</div>
</div>
</div>
</div>
#*</div>*#
</div>
</div>
</div>
To do same height columns in Bootstrap you need follow this answer. Simply add this code to your CSS:
.row [class*="col-"]{
margin-bottom: -99999px;
padding-bottom: 99999px;
}
.row{
overflow: hidden;
}
https://jsfiddle.net/7v0dyfo3/
This is (not exactly, without styling) what i'm trying to do for a listing.
It's all good but it does not resize properly.
I would like the div episode-box to expand its height for smartphone screens, so the text can be shown vertically, below the image.
It's not very correctly coded, but can you tell me what are my mistakes for the bad resizing ?
<article class="full-width">
<div class="post-box">
<div class="container">
<div class="row">
<div class="col-md-12">
<div class="guide-art-container">
<div class="episode-content">
<div class="saga">
<div class="row">
<div class="col-md-12">
<div class="episode-box">
<div class="episode-img">
<img class="thumbnail-ep" src="http://image.noelshack.com/fichiers/2015/35/1440684992-img.jpg"/>
</div>
<span class="episode-nb"> <p>001</p></span>
<div class="episode-single- content">
<div class="episode-single-title">
<h5><b>Lorem Ipsum Title</b></h5>
</div>
<div class="episode-single- desc">
<p><b>Lorem ipsum dolor sit amet, consectetur adipiscing elit.</b>
<br> Sed interdum luctus erat, in Sed interdum luctus erat, in</p>
<hr2>
<span class="cast"><p> <b>Scénario:</b> Sed interdum · <b>Art:</b> Sed interdum · <br>
<b>Animation:</b> Sed interdum · <b>Réalisation:</b> Sed interdum</p></span>
</div>
</div>
</div>
<div class="episode-box">
<div class="episode-img">
<img class="thumbnail-ep" src="http://image.noelshack.com/fichiers/2015/35/1440684992-img.jpg"/>
</div>
<span class="episode-nb"><p>001</p></span>
<div class="episode-single-content">
<div class="episode-single-title">
<h5><b>Lorem Ipsum Title</b></h5>
</div>
<div class="episode-single-desc">
<p><b>Lorem ipsum dolor sit amet, consectetur adipiscing elit.</b>
<br> Sed interdum luctus erat, in Sed interdum luctus erat, in</p>
<hr2>
<span class="cast"><p> <b>Scénario:</b> Sed interdum · <b>Art:</b> Sed interdum · <br>
<b>Animation:</b> Sed interdum · <b>Réalisation:</b> Sed interdum</p></span>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div><!--.post-box-->
</article>
You need to use media queries
Something like this: (Minimize your browser to see the effect)
.full-width {
margin: 0 0 30px;
padding: 0;
}
.container {
max-width: 1170px;
width: 100%;
}
.row {
margin-right: -15px;
margin-left: -15px;
}
#media (min-width: 1200px)
.col-md-12 {
width: 100%;
}
.guide-art-container {
padding: 25px;
}
.saga-title {
margin-top: 15px;
}
.episode-box {
width: auto;
background-color: #F9F9F9;
margin-top: 7px;
box-shadow: inset 0px 100px 150px -150px rgba(204,204,204,1);
height: 150px;
border: 1px solid #E8E8E8;
position: relative;
}
.episode-img {
float: left;
}
.episode-box img {
float: left;
margin-right: 10px;
padding: 5px;
}
span.episode-nb {
position: absolute;
bottom: 2px;
left: 5px;
background-color: #FC8A19;
max-width: 100px;
width: 100%;
opacity: 0.8;
text-align: center;
color: #fff;
font-weight: bold;
font-size: 15pt;
}
.episode-single-content {
padding: 10px 10px 10px 0px;
max-height: 150px;
}
.episode-single-desc {
max-height: 150px;
font-size: 9pt;
padding-right: 4px;
padding-left: 5px;
padding-top: 5px;
}
span.cast {
font-size: 7.4pt !important;
font-family: 'Roboto', Arial, Tahoma, Sans-serif;
line-height: 19px;
}
.thumbnail-ep {
float: left;
margin-right: 10px;
position: relative;
max-width: 260px;
width: 100%;
padding: 2px;
}
span.episode-nb {
position: absolute;
bottom: 2px;
left: 5px;
background-color: #FC8A19;
max-width: 100px;
width: 100%;
opacity: 0.8;
text-align: center;
color: #fff;
font-weight: bold;
font-size: 15pt;
}
.episode-single-title h5 {
margin-top: 2px !important;
}
#media only screen and (max-width : 480px) {
.episode-img {
float:none;
position:relative;
}
.episode-box img {
float:none;
}
.thumbnail-ep {
float:none;
}
.episode-box {
height:auto;
}
}
<article class="full-width">
<div class="post-box">
<div class="container">
<div class="row">
<div class="col-md-12">
<div class="guide-art-container">
<div class="episode-content">
<div class="saga">
<div class="row">
<div class="col-md-12">
<div class="episode-box">
<div class="episode-img">
<img class="thumbnail-ep" src="http://image.noelshack.com/fichiers/2015/35/1440684992-img.jpg"/>
<span class="episode-nb"><p>001</p></span>
</div>
<div class="episode-single-content">
<div class="episode-single-title">
<h5><b>Lorem Ipsum Title</b></h5>
</div>
<div class="episode-single-desc">
<p><b>Lorem ipsum dolor sit amet, consectetur adipiscing elit.</b>
<br> Sed interdum luctus erat, in Sed interdum luctus erat, in</p>
<hr2>
<span class="cast"><p><b>Scénario:</b> Sed interdum · <b>Art:</b> Sed interdum · <br>
<b>Animation:</b> Sed interdum · <b>Réalisation:</b> Sed interdum</p></span>
</div>
</div>
</div>
<div class="episode-box">
<div class="episode-img">
<img class="thumbnail-ep" src="http://image.noelshack.com/fichiers/2015/35/1440684992-img.jpg"/>
<span class="episode-nb"><p>001</p></span>
</div>
<div class="episode-single-content">
<div class="episode-single-title">
<h5><b>Lorem Ipsum Title</b></h5>
</div>
<div class="episode-single-desc">
<p><b>Lorem ipsum dolor sit amet, consectetur adipiscing elit.</b>
<br> Sed interdum luctus erat, in Sed interdum luctus erat, in</p>
<hr2>
<span class="cast"><p><b>Scénario:</b> Sed interdum · <b>Art:</b> Sed interdum · <br>
<b>Animation:</b> Sed interdum · <b>Réalisation:</b> Sed interdum</p></span>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div><!--.post-box-->
</article>
JS Fiddle
You need media query.
Suppose we have .high-height-in-xs-device
#media screen and (max-width:767px) {
.high-height-in-xs-device {
height: 800px;
}
}
The above CSS will only work in screen with width narrower than 767px, which is a bootstrap standard for xs screen widths.