Resizable containers at the same level - css

<div class="row container-row">
<div class="col-md-8 col-xs-12 no-padding-column">
<div class="video-container">
<img class="video-image" src="image.jpg">
<a href="#" class="js-play-video">
<img class="play-image" src="play.png">
</a>
</div>
</div>
<div class="col-md-4 col-xs-12 no-padding-column">
<div class="text-content">
<h1>Superious Quality</h1>
<p>sometext</p>
</div>
</div>
</div>
Below is my Style
.panel-container {
color: #fff;
height: auto;
position: relative;
margin: 0px auto;
}
.panel-container .container-row {
margin: 5%;
}
.panel-container .container-row .no-padding-column {
padding-right: 0px;
padding-left: 0px;
}
.panel-container .video-container {
display: block;
position: relative;
}
.panel-container .video-container .video-image {
width: 100%;
}
.panel-container .play-image {
position: absolute;
width: 13%;
height: auto;
top: 50%;
left: 57%;
margin-left: -12%;
margin-top: -6%;
}
.panel-container .text-content {
padding-left: 15px;
padding-right: 15px;
float: left;
height: 381px;
background-color: rgba(0, 0, 0, 0.6);
color: #fff;
}
#media (max-width: 30em) {
.panel-container .text-content {
height: auto;
}
}
.panel-container .text-content h1 {
color: #fff;
}
I want the text-content has the same height as the video-container. Please note that the height of video-container is not fixed and defined by the size of image and it's resizing when the browser resize. How can I make the text-content resizable to always be aligned (height) with the video-container?

One solution would be to make the .container-row and the .text-content the same background-color. The code:
.panel-container {
color: #fff;
margin: 0px auto;
}
.panel-container .container-row {
background: #666666;
margin: 5%;
}
.panel-container .container-row .no-padding-column {
padding-right: 0px;
padding-left: 0px;
}
.panel-container .video-container .video-image {
width: 100%;
}
.panel-container .play-image {
position: absolute;
width: 13%;
height: auto;
top: 50%;
left: 57%;
margin-left: -12%;
margin-top: -6%;
}
.panel-container .text-content {
padding: 0 15px;
float: left;
color: #fff;
}
.panel-container .text-content h1 {
color: #fff;
}
<link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap.min.css" rel="stylesheet" />
<div class="container-fluid panel-container">
<div class="row container-row">
<div class="col-xs-8 no-padding-column">
<div class="video-container">
<img class="video-image" src="http://www.keenthemes.com/preview/metronic/theme/assets/global/plugins/jcrop/demos/demo_files/image1.jpg" />
<a href="#" class="js-play-video">
<img class="play-image" src="http://uxrepo.com/static/icon-sets/iconic/svg/play-circle2.svg" />
</a>
</div>
</div>
<div class="col-xs-4 no-padding-column">
<div class="text-content">
<h1>Superious Quality</h1>
<p>sometext</p>
</div>
</div>
</div>
</div>
I know it is not the right way to do it and that it doesn't answer the question, but it works on behaviour.

I actually used the Reflex on a link but it's not used extensively. I'm not sure if it's a right thing to use to get the site to production. Please let me know if there is any better option.

To adjust both divs at the same height, all I did was adding
float: left;
to the css class .no-padding-column
.panel-container .container-row .no-padding-column {
padding-right: 0px;
padding-left: 0px;
float: left;
}
I tried to reproduce your situation in a fiddle. Notice that I removed the .panel-container class, since it's not in your code. I am not sure where this class is, it might cause problems as well, let me know if my Fiddle works as exspected. And if there's still a problem, could you add your .panel-container class as well? (And maybe images from the internet and not local ones? That would make it much easier for us)
For those who want to adjust the height of the second div, depending on the change of the first div:
For this you could use the JS framework "attrchange". Add the JS file to your page and use the following code.
$(".video-container").attrchange({
trackValues: true, // set to true so that the event object is updated with old & new values
callback: function(event) {
if(event.attributeName == "height") { // which attribute you want to watch for changes
$(".text-content").css('height', event.newValue);
}
}
});

I post the solution I found you might be interested as well.
Here is codepen link!
<div class="table-wrapper">
<div class="table-row">
<div class="table-column short-column">
<div class="content-container">
<p>Short Column</p>
</div>
<div class="button-row">
<button>Click Me</button>
</div>
</div>
<div class="table-column medium-column">
<div class="content-container">
<p>Medium Column</p>
<p>Medium Column</p>
<p>Medium Column</p>
</div>
<div class="button-row">
<button>Click Me</button>
</div>
</div>
<div class="table-column long-column">
<div class="content-container">
<p>Long Column</p>
<p>Long Column</p>
<p>Long Column</p>
<p>Long Column</p>
<p>Long Column</p>
<p>Long Column</p>
<p>Long Column</p>
</div>
<div class="button-row">
<button>Click Me</button>
</div>
</div>

Related

push the element out of flow without making horizontal scroll using bootstrap

I've been using bootstrap framework recently. I'm new to this framework.
so I'm trying to position an image next to some text in landing page. I use grid system of the bootstrap and it work. but when I come to push the image using position: absolute, and left:somePX, it make horizontal scroll and get out of the body of the page. what should I do to prevent this scrolling. I just want to cut the image and position it as I want.
Note: I've applied so many templates using only CSS with out bootstrap and I never get across on same problem.
thank you
here is my html code:
/* landing */
/*this is the image style*/
.landing {
padding-bottom: 100px;
margin-right: 0;
}
.landing .right .image {
position: relative;
}
.landing .right .image .back img {
position: absolute;
left: 100px;
}
.landing .right .image .mockups {
position: absolute;
top: -100px;
left: 100px;
}
/*this is text style I don't think the problem is here but I put it*/
.landing .left {
padding-top: 80px;
padding-left: 80px;
}
.landing .left h1 {
line-height: 1.3;
margin-bottom: 20px;
}
.landing .left p {
font-size: 15px;
margin-bottom: 20px;
}
.landing .left button {}
<div class="landing row">
<div class="col-md-6 left">
<div class="container">
<h1>Next generation digital banking</h1>
<p>Take your financial life online. Your Easybank account<br> will be a one-stop-shop for spending, saving,<br> budgeting, investing, and much more.</p>
<button class="btn linear" type="button">Request Invite</button>
</div>
</div>
<div class="col-md-6 right">
<div class="image">
<div class="back">
<img class="back-image img-fluid" src="images\bg-intro-desktop.svg" alt="">
</div>
<div class="front">
<img class="img-fluid mockups" src="images\image-mockups.png" alt="">
</div>
</div>
</div>
</div>
you can simply add to your body:
<style>
body{
overflow-x: hidden;
}
</style>

Specify exactly where content goes even when screen size changes

I'm trying to specify content specifically somewhere on the page, How can i do this so that it'll always be in the exact same spot even when screen size changes?
jsfiddle = https://jsfiddle.net/4pkgfgwh/1/
<div class="container">
<img src="http://i.imgur.com/iGIFvH6.png" style="width:354px;height:228px;">
<div class="display">
<p> Here is some Text</p>
</div>
</div>
.container {
text-align: center;
}
.display {
position:absolute;
TOP:45px;
LEFT:350px;
}
Use position: relative on the parent container:
HTML
<div class="container">
<div class="image-container">
<img src="http://i.imgur.com/iGIFvH6.png">
<div class="display">
<p> Here is some Text</p>
</div>
</div>
</div>
CSS
.container {
width: 100%;
text-align: center;
}
.image-container {
display: inline-block;
position: relative;
width: 354px;
height: 228px;
}
.container img {
width: 100%;
}
.display {
position: absolute;
top: 10px;
left: 200px;
}
JSFiddle demo: https://jsfiddle.net/ompfnjc5/2/

Resize image in ionic cards

I want display a set of images with a description below. I chose to use Ionic cards.
I got this result (the first image):
While I want to preserve the same layout I have now, and add a description.
Here is my code:
<ion-content ng-controller="cityController">
<div class="row">
<div class="col col-33">
<div class="list card">
<div class="item item-body">
<img class="full-image"src="img/images/opera.jpg"/>
This is a "Facebook" styled Card..
</div>
</div>
</div>
<div class="col col-33">
<img src="img/images/basilique.jpg"/>
</div>
<div class="col col-33">
<img src="img/images/hoteldeville.jpg"/>
</div>
</div>
.center {
text-align: center;
}
.col {
overflow: hidden;
}
.row {
overflow: hidden;
height: 180px;
}
.fullscreen {
width: 100%;
height: 100%;
}
How can I fix this?
UPDATE
You have to change your source little bit.
Example HTML:
<div class="row">
<div class="col col-33">
<img class="full-image" src="http://www.w3schools.com/css/img_fjords.jpg"/>
<div class="card-description">This is a "Facebook" styled Card..</div>
</div>
<div class="col col-33">
<img class="full-image" src="http://www.w3schools.com/css/img_forest.jpg"/>
<div class="card-description">This is a "Facebook" styled Card..</div>
</div>
<div class="col col-33">
<img class="full-image" src="http://www.w3schools.com/css/img_mountains.jpg"/>
<div class="card-description">This is a "Facebook" styled Card..</div>
</div>
</div>
Example CSS:
.col-33 {
width: 33%;
float:left;
}
.full-image {
width: 100%;
height: 100%;
}
.card-description {
text-align: center;
}
Live demo here
This is just an example how it can work.
UPDATE:
To have the images full sized, you need to put the description over it.
In that case this CSS is required.
.col-33 {
width: 33%;
float:left;
position: relative;
}
.full-image {
width: 100%;
height: 100%;
}
.card-description {
position: absolute;
bottom: 0;
left: 0;
right: 0;
text-align: center;
padding: 5px;
line-height: 1.5;
background-color: rgba(255, 255, 255, 0.6);
}

How to make a horizontal line?

Hi so here's what I want to do,
http://i1377.photobucket.com/albums/ah45/nikilean/line_zpswvrndxwg.jpg
a horizontal line behind the images? There are 8 circles and I want them to be connected with a line
I made it in bootstrap so the lines are divided into two col 6 and inside each col there are 3 col-3
.stepnumber {
height: 30px;
width: 30px;
border-radius: 50%;
background-color: #f9b315;
vertical-align: middle;
color: #fff;
padding-top: 2px;
padding-right: 10px;
font-size: 18px;
font-weight: bold;
margin-top: 150px;
left: -10px;
}
.step {
height: 150px;
width: 150px;
border-radius: 50%;
background-color: #fff;
margin-top: 80px;
margin-right:-60px;
position: absolute;
}
<div class="container">
<div class="col-md-6">
<div class="row">
<div class="col-md-3">
<div class="lineline"><div class=stepnumber>1</div></div>
</div>
<div class="col-md-3">
<div class="step">
<div class="workstitle">
BOOK
</div>
</div>
</div>
<div class="col-md-3">
<div class=stepnumber>2</div>
</div>
<div class="col-md-3">
<div class="step">
<div class="workstitle">
WAIT
</div>
</div>
</div>
</div>
</div>
<div class="col-md-6">
<div class="row">
<div class="col-md-3">
<div class=stepnumber>3 </div>
</div>
<div class="col-md-3">
<div class="step">
<div class="workstitle">
FOUND
</div>
</div>
</div>
<div class="col-md-3">
<div class=stepnumber>4</div>
</div>
<div class="col-md-3">
<div class="step">
<div class="workstitle">
FLY!
</div>
</div>
</div>
</div>
</div>
</div>
You can achieve the look you're going for by using the :after (or :before) pseudo class on your wrapping element. You can create a border on the :after element and position it behind your circles using z-index.
Below is an example of how you could construct it.
.timeline {
height: 150px;
line-height: 150px;
display: table;
position: relative;
}
.timeline:after {
position: absolute;
left: 0.5em;
right: 0.5em;
top: 50%;
content: "";
border-top: 3px solid #F9B315;
z-index: 900;
}
.-item {
display: table-cell;
vertical-align: middle;
z-index: 1000;
position: relative;
}
.-item > div {
margin-left: 0.5em;
margin-right: 0.5em;
width: 150px;
height: 150px;
border-radius: 50%;
text-align: center;
line-height: 150px;
font-weight: bold;
font-size: 18px;
background-color: #f9b315;
color: #FFF;
}
.-item:first-of-type > div { margin-left: 0; }
.-item:last-of-type > div { margin-right: 0; }
.-item._number > div {
width: 30px;
height: 30px;
line-height: 2;
}
<div class="timeline">
<div class="-item _number">
<div>1</div>
</div>
<div class="-item _title">
<div>BOOK</div>
</div>
<div class="-item _number">
<div>2</div>
</div>
<div class="-item _title">
<div>WAIT</div>
</div>
<div class="-item _number">
<div>3</div>
</div>
<div class="-item _title">
<div>FOUND</div>
</div>
<div class="-item _number">
<div>4</div>
</div>
<div class="-item _title">
<div>FLY!</div>
</div>
</div>
This is going to take a little bit of work on your part, but here is a way to put a horizontal line behind the div.
Here is the fiddle. The trick for the line is to make a div that's only 1px high. It will take a little bit of thinking on your part:
.line{
height: 1px;
width: 100px;
background-color: black;
z-index: 1;
position: absolute;
top: 25px;
}

Create 6 boxes with css

I really need some help with some easy css that I just can't get my head around.
I want to create boxes like in the link below.
I guess I could have the code for just one of them, and then use it over and over again, but how do I create the boxes so that they don't mind the other stuff around them?
Example here: http://s23.postimg.org/qypbfvv0r/boxes.jpg
Here: I have figured out a way of doing this. I hope that this helps you in some way in helping you figure out how to finish your task.
HTML:
<div class="containers">
<p class="heading">Heading</p>
<div class="inner1"></div>
<div class="inner2"></div>
</div>
<div class="containers">
<p class="heading">Heading</p>
<div class="inner1"></div>
<div class="inner2"></div>
</div>
<div class="containers">
<p class="heading">Heading</p>
<div class="inner1"></div>
<div class="inner2"></div>
</div>
CSS:
.containers {
width: 300px;
height: 150px;
border: 1px solid black;
margin-bottom: 10px;
overflow: hidden;
position: relative;
}
.inner1 {
margin-left: 5px;
width: 135px;
height: 80px;
border: 1px solid black;
background-color: blue;
}
.inner2 {
position: relative;
float: right;
top: -60%;
margin-left: 5px;
margin-right: 5px;
width: 135px;
height: 80px;
border: 1px solid black;
background-color: red;
}
.heading {
padding-left: 20px;
}
You can start off using this code. After this you can give border styles and colors to the individual divs.
<div>
<div style="float:right"> Content </div>
<div style="float:left"> Content </div>
</div>
<div style="padding-top:10px">
<div style="float:right"> Content </div>
<div style="float:left"> Content </div>
</div>
<div style="padding-top:10px">
<div style="float:right"> Content </div>
<div style="float:left"> Content </div>
</div>
Hope this helps

Resources