I try to have multiple p tags in a division, but the paragraphs aren't separating and are just bunching together. The applicable code is as follows:
<div class="row">
<div class="col-md-12 d-flex justify-content-center padding-top">
<p>IMPORTANT LEGAL DISCLAIMER FOR TESTIMONIALS, RISK AND TYPICAL RESULTS, AS WELL AS REFUNDS</p>
<p>Test</p>
</div>
</div>
and the link to codeply is https://www.codeply.com/go/cJ37oz9g4Q. If you go to codeply, then you'll see that "Test" appears immediately after the word "REFUNDS". I have tried modifying the code, looking for known issues, etc.
How can I fix this?
You need to remove d-flex class from this code:
<div class="col-md-12 justify-content-center padding-top">
<p>IMPORTANT LEGAL DISCLAIMER FOR TESTIMONIALS, RISK AND TYPICAL RESULTS, AS WELL AS REFUNDS</p>
<p>Test</p>
</div>
This is because of d-flex class - it forces <p> to become flex-items and by default they align themself along horizontal axis. Replace d-flex and justify-content-center with text-center
.social {
margin: 0;
padding: 0;
}
.social ul {
margin: 0;
padding: 5px;
}
.social ul li {
margin: 5px;
list-style: none outside none;
display: inline-block;
}
.social i {
width: 40px;
height: 40px;
color: #FFF;
background-color: #909AA0;
font-size: 22px;
text-align:center;
padding-top: 12px;
border-radius: 50%;
-moz-border-radius: 50%;
-webkit-border-radius: 50%;
-o-border-radius: 50%;
transition: all ease 0.3s;
-moz-transition: all ease 0.3s;
-webkit-transition: all ease 0.3s;
-o-transition: all ease 0.3s;
-ms-transition: all ease 0.3s;
}
.social i:hover {
color: #FFF;
text-decoration: none;
transition: all ease 0.3s;
-moz-transition: all ease 0.3s;
-webkit-transition: all ease 0.3s;
-o-transition: all ease 0.3s;
-ms-transition: all ease 0.3s;
}
.social .fa-facebook:hover {
background: #4060A5;
}
.social .fa-twitter:hover {
background: #00ABE3;
}
.social .fa-instagram:hover {
background: #375989;
}
.social .fa-youtube:hover {
background: #FF1F25;
}
.social .fa-youtube-play:hover {
background: #DF192A;
}
p {
color: #FFF;
}
.paddding-top {
padding-bottom: 15px;
padding-top: 18px;
border-bottom: 1px solid white;
}
/*this is the padding for the form from the top*/
.padding-form-top{
padding-top: 18px;
}
<link href="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/4.0.0-alpha.6/css/bootstrap.min.css" rel="stylesheet"/>
<footer class="bg-inverse">
<div class="row">
<div class="col-md-12 d-flex justify-content-center">
<div class="social">
<ul>
<li><i class="fa fa-lg fa-instagram"></i></li>
<li><i class="fa fa-lg fa-facebook"></i></li>
<li><i class="fa fa-lg fa-twitter"></i></li>
<li><i class="fa fa-lg fa-youtube"></i></li>
</ul>
</div>
</div>
</div>
<hr>
<div class="row">
<div class="col-md-12 text-center padding-top">
<p>IMPORTANT LEGAL DISCLAIMER FOR TESTIMONIALS, RISK AND TYPICAL RESULTS, AS WELL AS REFUNDS</p>
<p>Test</p>
</div>
</div>
<hr>
<div class="row">
<div class="col-md-12 d-flex justify-content-center">
<div class="col-md-4 col-md-offset-4 text-center padding-form-top">
<form class="form-width">
<div class="form-group">
<input type="email" class="form-control" id="email" placeholder="Your Email Address">
</div>
<button type="submit" class="btn btn-success">Sign Up for the Latest Updates</button>
</form>
</div>
</div>
</div>
</footer>
Related
I have an image in HTML (aaa.jpg) and when I hover I need it to switch to another image (t1.jpg) indicated in css
.single-member .thumb .overlay-member #1 {
background: url(../img/t1.jpg) no-repeat center center/cover;
text-align: center;
padding: 30px;
opacity: 0;
-webkit-transition: all 0.3s ease 0s;
-moz-transition: all 0.3s ease 0s;
-o-transition: all 0.3s ease 0s;
transition: all 0.3s ease 0s;
}
<div class="row">
<div class="col-lg-3 col-sm-6">
<div class="single-member">
<div id="1">
<div class="thumb relative" style="background: url(img/aaa.jpg);">
<div class="overlay overlay-member d-flex flex-column justify-content-end align-items-center">
<div class="line"></div>
<div class="social d-flex align-items-center justify-content-center">
<i class="fa fa-linkedin"></i>
</div>
</div>
</div>
</div>
<div class="desc text-center">
<h5 class="text-uppercase">XXX</h5>
<p>ZZZ</p>
</div>
</div>
</div>
The above code works fine, but it works for using the same image for all. I need to use different images for people, so I repeated the code in html and css but changing the id. Then it is showing only the image stated in HTML file, flipping to the css ones.
.card {
width: 130px;
height: 195px;
position: relative;
display: inline-block;
margin: 50px;
}
.card .img-top {
display: none;
position: absolute;
top: 0;
left: 0;
z-index: 99;
}
.card:hover .img-top {
display: inline;
}
<div class="card">
<img src="https://www.tutorialrepublic.com/examples/images/card-front.jpg" alt="Card Back">
<img src="https://www.tutorialrepublic.com/examples/images/card-back.jpg" class="img-top" alt="Card Front">
</div>
First of all you needs to make some changes in your HTML
You can't use number ID as a css selector like #1 have to replaced with #one
REF: #1 should not use
and you can simply change image by css :hover selector.
Hope this will help you.
.single-member #one {
background: url(https://via.placeholder.com/728x90.png?text=normal) no-repeat center center/cover;
text-align: center;
padding: 30px;
opacity: 1;
-webkit-transition: all 0.3s ease 0s;
-moz-transition: all 0.3s ease 0s;
-o-transition: all 0.3s ease 0s;
transition: all 0.3s ease 0s;
}
.single-member #one:hover {
background: url(https://via.placeholder.com/728x90.png?text=hover) no-repeat center center/cover;
}
<div class="row">
<div class="col-lg-3 col-sm-6">
<div class="single-member">
<div id="one">
<div class="thumb relative">
<div class="overlay overlay-member d-flex flex-column justify-content-end align-items-center">
<div class="line"></div>
<div class="social d-flex align-items-center justify-content-center">
<i class="fa fa-linkedin"></i>
</div>
</div>
</div>
</div>
<div class="desc text-center">
<h5 class="text-uppercase">XXX</h5>
<p>ZZZ</p>
</div>
</div>
</div>
I suggest to use Jscript in HTML it will be of one line
<img src='FirstImage.png' onmouseover="this.src='ChangedImage.png';" onmouseout="this.src='FirstImage.png';" />
I have 2 columns inside of a div, with each column containing 3 divs each. As this is for a mobile site, I want them to be aligned in the center responsively. They're aligned fine when resized for a standard mobile (320px, 375px) like so: http://imgur.com/a/WDwSL, but when resized at tablet size, they don't center align at all. http://imgur.com/a/mMTRG
How can I get them to stay in the center no matter what size the phone size? I tried media queries and other responsive grids but they didn't work. Any help would be appreciated. Thanks!
.two-circles {
width: 100%;
}
.circles-left {
width: 37%;
float: left;
margin-left: 18%;
padding: 0;
display: block;
}
.circles-right {
width: 37%;
padding-bottom: 13%;
float: left;
display: block;
}
.clear {
clear: both;
}
.rate-circles {
border: 3px solid white;
border-radius: 50%;
-ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=60)";
filter: alpha(opacity=60);
opacity: 1;
text-align: center;
font-family: 'Montserrat', sans-serif;
font-size: 50px;
line-height: 75px;
color: #0E3475;
text-shadow: none;
-webkit-box-shadow: 0 0 1px 0px rgb( 255, 255, 255);
box-shadow: none;
width: 75px;
height: 75px;
z-index: 86;
-webkit-transition: background-color .5s ease-in-out;
-moz-transition: background-color .5s ease-in-out;
-o-transition: background-color .5s ease-in-out;
-ms-transition: background-color .5s ease-in-out;
transition: background-color .5s ease-in-out;
}
h5.circles {
font-size: 18px;
text-align: center;
margin-top: -25px;
}
h1.rate {
color: #1E53A8;
font-weight: bold;
text-align: center;
}
.two-circles a {
list-style-type: none;
text-decoration: none;
}
<div data-role="content" id="cmp-postlist">
<h1 class="rate"> RATE YOUR ANXIETY</h1>
<div class="two-circles">
<div class="circles-left">
<a href="cmp-grounding.html" rel="external">
<div class="rate-circles">1
<h5 class="circles">Nervous</h5>
</div>
</a>
</div>
<div class="circles-right">
<a href="cmp-grounding.html" rel="external">
<div class="rate-circles">2
<h5 class="circles">Uneasy</h5>
</div>
</a>
</div>
<div class="circles-left">
<a href="cmp-grounding.html" rel="external">
<div class="rate-circles">3
<h5 class="circles">Anxious</h5>
</div>
</a>
</div>
<div class="circles-right">
<a href="cmp-grounding.html" rel="external">
<div class="rate-circles">4
<h5 class="circles">Worried</h5>
</div>
</a>
</div>
<div class="circles-left">
<a href="cmp-grounding.html" rel="external">
<div class="rate-circles">5
<h5 class="circles">Fearful</h5>
</div>
</a>
</div>
<div class="circles-right">
<a href="cmp-grounding.html" rel="external">
<div class="rate-circles">6
<h5 class="circles">Panicked</h5>
</div>
</a>
</div>
</div>
<div class="clear"></div>
</div>
JSFIDDLE
.two-circles {
width: 100%;
}
.circles-left,.circles-right {
width: 45%;
padding-bottom: 13%;
float: left;
}
.circles-right {
text-align:left;
padding-left: 5%;
}
.circles-left {
text-align:right;
padding-right: 5%;
}
.clear {
clear: both;
}
.rate-circles {
border: 3px solid white;
border-radius: 50%;
-ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=60)";
filter: alpha(opacity=60);
opacity: 1;
text-align: center;
font-family: 'Montserrat', sans-serif;
font-size: 50px;
line-height: 75px;
color: #0E3475;
text-shadow: none;
-webkit-box-shadow: 0 0 1px 0px rgb( 255, 255, 255);
box-shadow: none;
width: 75px;
height: 75px;
z-index: 86;
-webkit-transition: background-color .5s ease-in-out;
-moz-transition: background-color .5s ease-in-out;
-o-transition: background-color .5s ease-in-out;
-ms-transition: background-color .5s ease-in-out;
transition: background-color .5s ease-in-out;
display: inline-block;
}
h5.circles {
font-size: 18px;
text-align: center;
margin-top: -25px;
}
h1.rate {
color: #1E53A8;
font-weight: bold;
text-align: center;
}
.two-circles a {
list-style-type: none;
text-decoration: none;
}
<div data-role="content" id="cmp-postlist">
<h1 class="rate"> RATE YOUR ANXIETY</h1>
<div class="two-circles">
<div class="circles-left">
<a href="cmp-grounding.html" rel="external"><div class="rate-circles">1
<h5 class="circles">Nervous</h5>
</div></a>
</div>
<div class="circles-right">
<a href="cmp-grounding.html" rel="external"><div class="rate-circles">2
<h5 class="circles">Uneasy</h5>
</div></a>
</div>
<div class="circles-left">
<a href="cmp-grounding.html" rel="external"><div class="rate-circles">3
<h5 class="circles">Anxious</h5>
</div></a>
</div>
<div class="circles-right">
<a href="cmp-grounding.html" rel="external"><div class="rate-circles">4
<h5 class="circles">Worried</h5>
</div></a>
</div>
<div class="circles-left">
<a href="cmp-grounding.html" rel="external"><div class="rate-circles">5
<h5 class="circles">Fearful</h5>
</div></a>
</div>
<div class="circles-right">
<a href="cmp-grounding.html" rel="external"><div class="rate-circles">6
<h5 class="circles">Panicked</h5>
</div></a>
</div>
</div>
<div class="clear"></div>
</div>
use this css. i didnt make any changes in HTML. my suggestion is you need to do some changes in both HTML and CSS
.wrapper{
width: 1170px;
max-width: 90%;
margin: 0 auto;
padding: 0 20px;
text-align: center;
}
.column{
width: 48%;
display: inline-block;
margin: 0 .5%;
}
.item{
width: 100%;
background-color: blue;
color: white;
margin-bottom: 20px;
display: inline-block;
}
<div class="wrapper">
<h2>2 column center divs</h2>
<div class="column">
<div class="item">1</div>
<div class="item">2</div>
<div class="item">3</div>
</div>
<div class="column">
<div class="item">4</div>
<div class="item">5</div>
<div class="item">6</div>
</div>
</div>
Would personally change your approach
There are many ways to do it but the most efficient and simplest way would be to use the CSS3 Flexbox. Designed to solve exactly these sort of layout issues.
Code reduces significantly as well. All you need is to give the outer .two-circles and inner .circles-left, .circles-right a property display: flex. Most importantly the justify-content: center to the inner circles to align it to the center. Shown below:
.two-circles {
width:100%;
display: flex;
flex-wrap: wrap;
}
.circles-left, .circles-right {
width:48%;
display: flex;
justify-content: center;
padding-bottom: 13%;
}
That's it! The rest of the code from .clear remains the same as you require.
Fiddle updated here
Using FLex will make this easier. See below.
body {
background: #ccc;
}
.two-circles {
width: 100%;
display: flex;
flex-wrap: wrap;
justify-content: center;
}
.circles-left, .circles-right {
width: 37%;
text-align: center;
}
.circles-right {
padding-bottom: 13%;
}
.rate-circles {
border: 3px solid white;
border-radius: 50%;
-ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=60)";
filter: alpha(opacity=60);
opacity: 1;
text-align: center;
font-family: 'Montserrat', sans-serif;
font-size: 50px;
line-height: 75px;
color: #0E3475;
text-shadow: none;
-webkit-box-shadow: 0 0 1px 0px rgb( 255, 255, 255);
box-shadow: none;
width: 75px;
height: 75px;
z-index: 86;
-webkit-transition: background-color .5s ease-in-out;
-moz-transition: background-color .5s ease-in-out;
-o-transition: background-color .5s ease-in-out;
-ms-transition: background-color .5s ease-in-out;
transition: background-color .5s ease-in-out;
}
h5.circles {
font-size: 18px;
text-align: center;
margin-top: -25px;
}
h1.rate {
color: #1E53A8;
font-weight: bold;
text-align: center;
}
.two-circles a {
list-style-type: none;
text-decoration: none;
display: inline-block;
}
<div data-role="content" id="cmp-postlist">
<h1 class="rate"> RATE YOUR ANXIETY</h1>
<div class="two-circles">
<div class="circles-left">
<a href="cmp-grounding.html" rel="external">
<div class="rate-circles">1
<h5 class="circles">Nervous</h5>
</div>
</a>
</div>
<div class="circles-right">
<a href="cmp-grounding.html" rel="external">
<div class="rate-circles">2
<h5 class="circles">Uneasy</h5>
</div>
</a>
</div>
<div class="circles-left">
<a href="cmp-grounding.html" rel="external">
<div class="rate-circles">3
<h5 class="circles">Anxious</h5>
</div>
</a>
</div>
<div class="circles-right">
<a href="cmp-grounding.html" rel="external">
<div class="rate-circles">4
<h5 class="circles">Worried</h5>
</div>
</a>
</div>
<div class="circles-left">
<a href="cmp-grounding.html" rel="external">
<div class="rate-circles">5
<h5 class="circles">Fearful</h5>
</div>
</a>
</div>
<div class="circles-right">
<a href="cmp-grounding.html" rel="external">
<div class="rate-circles">6
<h5 class="circles">Panicked</h5>
</div>
</a>
</div>
</div>
<!--<div class="clear"></div> Remove-->
</div>
.heading{
margin: 40px 0px;
}
.heading h1{
text-align: center;
}
.block{
width: 100%;
text-align: center;
display: inline-flex;
}
.block_left, .block_right{
width: 50%;
}
.sub_block{
background: transparent;
border: 1px solid #ccc;
padding: 25px 30px;
border-radius: 50%;
}
.block_head{
margin: 40px 0px;
font-weight: bold;
}
<div class="heading">
<h1 class="">
RATE YOUR ANXIETY
</h1>
</div>
<div class="block">
<div class="block_left">
<span class="sub_block">
1
</span>
<div class="block_head">
Nervous
</div>
</div>
<div class="block_right">
<span class="sub_block">
2
</span>
<div class="block_head">
Uneasy
</div>
</div>
</div>
<!-- Third block row -->
<div class="block">
<div class="block_left">
<span class="sub_block">
5
</span>
<div class="block_head">
Fearful
</div>
</div>
<div class="block_right">
<span class="sub_block">
6
</span>
<div class="block_head">
Panicked
</div>
</div>
</div>
<!-- second block row -->
<div class="block">
<div class="block_left">
<span class="sub_block">
3
</span>
<div class="block_head">
Anxious
</div>
</div>
<div class="block_right">
<span class="sub_block">
4
</span>
<div class="block_head">
Worried
</div>
</div>
</div>
Since you mentioned grids, have you tried the concepts of display:inline-blocks?
CSS
.circles {
width:48%;
margin:1%; //not really required
display: inline-block;
}
.circle-wrapper {
text-align: center;
}
HTML
<div class="circle-wrapper">
<div class="circle">
<!-- content here -->
</div>
</div>
What display:inline-block does is that it wraps the space required to be exactly as much as the content it has (unless you define the width and height of course)
Thus with that you are able to place your elements the way you want.
What i have done in circles is I have defined the width of the circle to be 48% of the entire screen. Thus the content inside receives that much amount of space. (i could go for 50 but then there won't be space for margins and stuffs).
The wrapper class aligns these inline blocks to the center just like text blocks. :)
After all. text can be treated as inline-blocks
So I built a menu and would like to be able to toggle it. I'm simply animation the width using CSS3.
-webkit-transition: width 1s;
transition: width 1s;
Now, when the menu is closed and you re-open it, the menu items "pop in", as shown here: https://gyazo.com/6dfee24687fff026e464323882770959
I think it's because the sentences are wrapping. I've tried everything to stop that from happening, to no avail.
This is my structure:
<div id="menu" class="col-md-2 col-xs-12 nopad closed">
<div id="togglemenu" class="col-xs-12 nopad">
<div class="hidden-xs hidden-sm col-md-3 menu-icon" onclick="document.querySelector('#menu').classList.toggle('closed')">
<div class="vertical">
<div>
<i class="fa fa-bars" aria-hidden="true"></i>
</div>
</div>
</div>
</div>
<div class="nopad menu-header col-xs-12" onclick="document.querySelector('#menu').classList.toggle('closed')">
<div class="vertical">
<div class="pull-right menu-toggle">
<i class="fa fa-bars" aria-hidden="true"></i>
</div>
<div>MENU</div>
</div>
</div>
<div class="col-xs-12 nopad">
<div class="hidden-xs hidden-sm col-md-3 menu-icon">
<div class="vertical">
<div>
<i class="fa fa-usd" aria-hidden="true"></i>
</div>
</div>
</div>
<div class="col-xs-12 col-md-9 menu-item active">
<div class="vertical">
<div>Menu item</div>
</div>
</div>
</div>
<div class="nopad menu-header btop col-xs-12">
<div class="vertical">
<div>Menu divider</div>
</div>
</div>
</div>
And the CSS that goes along with it:
#menu {
min-height: 65vh;
background: #1c2329;
-webkit-transition: width 1s;
transition: width 1s;
}
#menu div {
text-overflow: clip;
}
.togglemenu {
cursor: pointer;
}
.menu-header {
text-align: center;
color: white;
text-transform: uppercase;
background: #181d21;
}
.menu-header.btop {
border-top: 1px solid #3de66e;
}
.vertical {
display: table-cell;
vertical-align: middle;
}
.menu-icon {
background: #1c252a;
text-align: center;
font-size: 2.1vh;
color: #3de66e;
}
.menu-item {
background: #1c2329;
text-transform: uppercase;
cursor: pointer;
}
.menu-item.active {
border-right: 3px solid #3de66e;
}
.menu-icon, .menu-header, .menu-item {
height: 5vh;
display: table;
overflow: hidden;
}
#menu.closed .menu-item, #menu.closed .col-md-9, #menu.closed .menu-header {
display: none;
}
#menu.closed .menu-item div {
display: block;
}
#menu.closed {
width: 3vw;
}
#menu.closed .menu-part {
display: none;
}
#togglemenu {
display: none;
}
#menu.closed #togglemenu {
display: block;
}
I was hoping someone could help me. Thanks in advance!
I often run into a problem, where it is taking to long for me to solve. I would like that the bootstrap boxes in the bottom have the same height. I tried to set a height in px in my css, but that messes everything up. I also tried to set it with %, but that does not work. So how is the propper way to set the height, so all of the boxes are expaning to same height, if I add some text there is gonna make the box change the height?
Portfolio
HTML (Just inserted 1 col here, so the code do not fill so much)
#import url("http://maxcdn.bootstrapcdn.com/font-awesome/4.2.0/css/font-awesome.min.css");
.panel-pricing {
-moz-transition: all .3s ease;
-o-transition: all .3s ease;
-webkit-transition: all .3s ease;
}
h3.panel-pricing {
color: #999;
font-size: 20px;
}
.panel-pricing .panel-heading {
padding: 20px 10px;
}
.panel-pricing .panel-heading .fa {
margin-top: 10px;
font-size: 58px;
}
.panel-pricing .list-group-item {
color: #777777;
border-bottom: 1px solid rgba(250, 250, 250, 0.5);
}
.panel-pricing .list-group-item:last-child {
border-bottom-right-radius: 0px;
border-bottom-left-radius: 0px;
}
.panel-pricing .list-group-item:first-child {
border-top-right-radius: 0px;
border-top-left-radius: 0px;
}
.panel-pricing .panel-body {
background-color: #f0f0f0;
font-size: 40px;
color: #777777;
padding: 20px;
margin: 0px;
}
<section id="plans">
<div class="container">
<div class="row">
<!-- item -->
<div class="col-md-4 text-center">
<div class="panel panel-danger panel-pricing">
<div class="panel-heading">
<i class="fa fa-money" aria-hidden="true"></i>
<h3>Plan 1</h3>
</div>
<div class="panel-body text-center">
<p><strong>$100 / Month</strong>
</p>
</div>
<ul class="list-group text-center">
<li class="list-group-item"><i class="fa fa-check"></i> Personal use</li>
<li class="list-group-item"><i class="fa fa-check"></i> Unlimited projects</li>
<li class="list-group-item"><i class="fa fa-check"></i> 27/7 support</li>
</ul>
<div class="panel-footer">
<a class="btn btn-lg btn-block btn-danger" href="#">BUY NOW!</a>
</div>
</div>
</div>
</div>
</div>
</section>
update css and add min-height
.panel-pricing .panel-body {
background-color: #f0f0f0;
font-size: 40px;
color: #777777;
padding: 20px;
margin: 0px;
min-height: 115px;
}
I have 3 boxes within a fluid container.
Each box has a heading title, an icon and some text below.
On :hover I want the icon to move to the top of the <div> and change it's size, I have managed to "achieve" it but using certain number of pixels.
That will not work in mobile resolutions if the title text is longer and takes 2 lines.
Here is what I have done so far:
Fiddle here
HTML
<div class="container">
<div class="row">
<div class="col-lg-4 col-md-4 col-sm-4 col-xs-12 text-center market-blocks orange wow rollIn">
<div class="service-box">
<h2>Title</h2>
<i class="fa fa-5x fa-paper-plane wow bounceIn market-icon" data-wow-delay=".1s"></i>
<p class="">Certain text below the icon</p>
</div>
</div>
</div>
CSS
.container{
text-align:center;
}
.market-blocks{
background: #3aa0d1;
padding: 30px 0 30px 0;
cursor:pointer;
}
.orange{
background: #e97d68;
}
i.market-icon {
-webkit-transition: 1s ease-in;
-moz-transition: 1s ease-in;
-o-transition: 1s ease-in;
transition: 1s ease-in
}
.market-blocks:hover i.market-icon {
-webkit-transform: translate(0,-70px);
-moz-transform: translate(0,-70px);
-o-transform: translate(0,-70px);
-ms-transform: translate(0,-70px);
transform: translate(0,-70px);
font-size: 1.8em;
}
How can I do it? And also is there a better way to do the movement from the initial position to the top of the <div>?
Pure HTML/CSS solution:
.container {
text-align: center;
}
.market-blocks {
background: #3aa0d1;
padding: 30px 0;
cursor: pointer;
}
.orange {
background: #e97d68;
}
.service-box {
display: inline-block;
}
.service-box-header {
position: relative;
}
.market-title {
padding-bottom: 5em;
-webkit-transition: 1s ease-in;
transition: 1s ease-in
}
.market-icon {
position: absolute;
right: 0;
bottom: 0;
left: 0;
-webkit-transition: 1s ease-in;
transition: 1s ease-in
}
.market-blocks:hover .market-title {
padding-bottom: 0;
}
.market-blocks:hover .market-icon {
bottom: 100%;
font-size: 1.8em;
}
<link href="http://maxcdn.bootstrapcdn.com/font-awesome/4.2.0/css/font-awesome.min.css" rel="stylesheet"/>
<div class="container">
<div class="row">
<div class="col-lg-4 col-md-4 col-sm-4 col-xs-12 text-center market-blocks orange wow rollIn">
<div class="service-box">
<div class="service-box-header">
<h2 class="market-title">Very-very-very-very-very-very-very-very loooooooooooooooooooong title</h2>
<i class="fa fa-5x fa-paper-plane wow bounceIn market-icon"></i>
</div>
<p class="">Certain text below the icon</p>
</div>
</div>
</div>
</div>