Mulitiple span in single button - Span Positioning - html

I am trying to span positioning in button but cannot figur it out how to do it. Please help me out. Defferent button acting defferently.
I am using Bootstrap.
My expectation: enter image description here
But Showing:enter image description here
My Code
.button-row {
height: 200px;
width: 180px;
}
.button-radius {
border-bottom-right-radius: 2em;
-webkit-box-shadow: 0 8px 6px -6px black;
-moz-box-shadow: 0 8px 6px -6px black;
box-shadow: 0 8px 6px -6px black;
white-space:normal;
word-wrap: break-word;
}
.label-top-left{
position: relative;
left: -60px;
top: -90px;
display: inline-block;
padding:20px;
}
.label-top-right{
position: relative;
left: 60px;
top: 90px;
display: inline-block;
padding:20px;
}
.label-bottom-right{
position: relative;
right: -70px;
top: 36px;
display: inline-block;
}
.label-bottom-left{
position: relative;
left: -60px;
top: 90px;
display: inline-block;
}
.gi-2x{font-size: 2em;}
.gi-3x{font-size: 3em;}
.gi-4x{font-size: 4em;}
.gi-5x{font-size: 5em;}
<h3 class="text-warning">My Purchasing</h3>
<div class="row">
<div class="col-md-3 col-sm-6 col-xs-12 button-container">
<button type="button" onclick="location.href = 'Purchasing/PurchaseRequisitionRelease.aspx';" class="btn btn-default button-row button-radius">
Approve Purchase Requisition
<span runat="server" id="spnPR" class="label label-warning label-top-right">1 Pending</span>
<span class="glyphicon glyphicon-list-alt gi-2x text-warning label-top-left"></span>
</button>
</div>
<div class="col-md-3 col-sm-6 col-xs-12 button-container">
<button type="button" onclick="location.href = 'Purchasing/PurchaseOrderRelease.aspx';" class="btn btn-default button-row button-radius">
Approve Purchase Order
<span runat="server" id="SpnNoti" class="label label-warning label-bottom-left">2 Notification</span>
<span runat="server" id="spnPO" class="label label-warning label-top-right">5 Pending</span>
<span class="glyphicon glyphicon-send gi-2x text-warning label-top-left"></span>
</button>
</div>
<div class="col-md-3 col-sm-6 col-xs-12 button-container">
<button type="button" class="btn btn-default button-row button-radius" onclick="location.href = 'Purchasing/PurchaseHistory.aspx';">
Purchase History
<span class="glyphicon glyphicon-time gi-2x text-warning label-top-left"></span>
</button>
</div>
</div>

Try this will work...
.button-row {
height: 200px;
width: 180px;
}
.sec1,.sec2,.sec3{
height: 70px;
margin: 0 !important;
margin-top: 8px !important;
}
.button-radius {
border-bottom-right-radius: 2em;
-webkit-box-shadow: 0 8px 6px -6px black;
-moz-box-shadow: 0 8px 6px -6px black;
box-shadow: 0 8px 6px -6px black;
white-space:normal;
word-wrap: break-word;
}
.label-top-left{
position: relative;
left: -60px;
top: -90px;
display: inline-block;
padding:20px;
}
.label-top-right{
position: relative;
left: 60px;
top: 90px;
display: inline-block;
padding:20px;
}
.label-bottom-right{
position: relative;
right: -70px;
top: 36px;
display: inline-block;
}
.label-bottom-left{
position: relative;
left: -60px;
top: 90px;
display: inline-block;
}
.gi-2x{font-size: 2em;}
.gi-3x{font-size: 3em;}
.gi-4x{font-size: 4em;}
.gi-5x{font-size: 5em;}
<!-- Latest compiled and minified CSS -->
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css" integrity="sha384-1q8mTJOASx8j1Au+a5WDVnPi2lkFfwwEAa8hDDdjZlpLegxhjVME1fgjWPGmkzs7" crossorigin="anonymous">
<!-- Optional theme -->
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap-theme.min.css" integrity="sha384-fLW2N01lMqjakBkx3l/M9EahuwpSfeNvV63J5ezn3uZzapT0u7EYsXMjQV+0En5r" crossorigin="anonymous">
<h3 class="text-warning">My Purchasing</h3>
<div class="row">
<div class="col-md-3 col-sm-6 col-xs-12 button-container">
<a onclick="location.href = 'Purchasing/PurchaseOrderRelease.aspx';" class="btn btn-default button-row button-radius">
<div class="row sec1" >
<span class="glyphicon glyphicon-send gi-2x text-warning pull-left"></span>
<span runat="server" id="spnPO" class="label label-warning pull-right">5 Pending</span>
</div>
<div class="sec2">
Approve Purchase Order
</div>
<div class="row sec3">
<span runat="server" id="SpnNoti" class="label label-warning pull-left">2 Notification</span>
</div>
</a>
</div>
</div>

Related

My webpage has a lot of unnecessary whitespaces, how do I fix this?

I think my image is self-explanatory. Still, I will go into details. I have been having this problem recently while trying to build my webpage. I have just an absurd amount of whitespace on the right side of my webpage which is completely unnecessary for me. I tried changing the width of all the elements in my HTML and CSS file but I got no luck. I really need some help in order to get rid of the whitespace.
Here is my HTML:
<!DOCTYPE html>
<!--
To change this license header, choose License Headers in Project Properties.
To change this template file, choose Tools | Templates
and open the template in the editor.
-->
<html>
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<!-- Latest compiled and minified CSS -->
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.1.0/css/bootstrap.min.css">
<!-- jQuery library -->
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<!-- Popper JS -->
<script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.0/umd/popper.min.js"></script>
<link href='https://fonts.googleapis.com/css?family=Actor' rel='stylesheet'>
<!-- Latest compiled JavaScript -->
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.1.0/js/bootstrap.min.js"></script>
<link rel="stylesheet" type="text/css" href="main.css">
<title></title>
</head>
<body>
<div class="container-fluid" style="font-family: Actor">
<div class="row " style="position: absolute; z-index: 999; opacity:1; box-shadow: 0 4px 8px 0 rgba(0, 0, 0, 0.2), 0 6px 20px 0 rgba(0, 0, 0, 0.19); background-color: #FFFFFF; padding: 4px;">
<div class="col-xs-2">
<img src="images/1-OrderUp!!.jpg" alt="OrderUp logo">
</div>
<div class="col-xs-2">
<p class="text-style-1">OrderUp!!</p>
</div>
<div class="col-xs-1" style="height: 100px; background: #511F18; width: 2px; margin-left: 784px;"></div>
<div class="col-xs-2">
<button class="btn btn-danger btn-lg" style="width: 100px">Log in
<?php
?>
</button>
</div>
<div class="col-xs-1" style="height: 100px; background: #511F18; width: 2px;"></div>
<div class="col-xs-2">
<button class="btn btn-danger btn-lg">Sign Up
<?php
?>
</button>
</div>
<div class="col-xs-1" style="height: 100px; background: #511F18; width: 2px;"></div>
</div><br>
<div class="row">
<div class="col-xs-12" style="box-shadow: 0 4px 8px 0 rgba(0, 0, 0, 0.2), 0 6px 20px 0 rgba(0, 0, 0, 0.19); width: 100%">
<div class="image">
<img src="images/home-1.jpg" style="width: 1350px;">
<p class="X">Welcome to OrderUp!!</p>
<p class="X_1"> Get food you love delivered at your doorstep!!</p>
<div >
<form class = "form-inline" class="srch_br"action="srch_location.php" method="post" enctype="multipart/form-data">
<input type="text" name="loc_srch" placeholder="Enter your location">
<button type="submit" class="btn btn-danger btn-md">Search</button>
</form>
</div>
</div>
</div>
</div>
</div>
</body>
</html>
Here is the CSS:
.btn.btn-danger.btn-lg{
border-radius: 0;
height: 100px;
}
.text-style-1{
font-family:Actor;
font-weight: bold;
font-size:55px;
padding-top:2px;
padding-left:20px;
color: #511F18";
}
.image {
position: relative;
}
.X{
position: absolute;
top: 200px;
left: 820px;
width: 100%;
color: #FFFFFF;
font-size: 55px;
}
.X_1{
position: absolute;
top: 270px;
left:660px;
width: 100%;
color: #FFFFFF;
font-size: 35px;
}
.srch_br{
position: absolute;
top:400px;
left: 50px;
padding: 15px;
background-color: #FFFFFF;
}
You have many issues
class X and X_1 for the popup are overlapping the viewport. Give it a left value in percentage.
image is overlapping the viewport. Give it a width in percentage
and your fixed position div is also overlapping.. Give it a width
.btn.btn-danger.btn-lg {
border-radius: 0;
height: 100px;
}
.text-style-1 {
font-family: Actor;
font-weight: bold;
font-size: 55px;
padding-top: 2px;
padding-left: 20px;
color: #511F18";
}
.image {
position: relative;
width: 100%;
}
.X {
position: absolute;
top: 200px;
color: #FFFFFF;
font-size: 55px;
}
.X_1 {
position: absolute;
top: 270px;
color: #FFFFFF;
font-size: 35px;
}
.srch_br {
position: absolute;
top: 400px;
left: 50px;
padding: 15px;
background-color: #FFFFFF;
}
<div class="container-fluid" style="font-family: Actor">
<div class="row " style="position: absolute; z-index: 999; opacity:1; box-shadow: 0 4px 8px 0 rgba(0, 0, 0, 0.2), 0 6px 20px 0 rgba(0, 0, 0, 0.19); background-color: #FFFFFF; padding: 4px;">
<div class="col-xs-2">
<img src="images/1-OrderUp!!.jpg" alt="OrderUp logo">
</div>
<div class="col-xs-2">
<p class="text-style-1">OrderUp!!</p>
</div>
<div class="col-xs-1" style="height: 100px; background: #511F18; width: 2px; margin-left: 784px;"></div>
<div class="col-xs-2">
<button class="btn btn-danger btn-lg" style="width: 100px">Log in
<?php
?>
</button>
</div>
<div class="col-xs-1" style="height: 100px; background: #511F18; width: 2px;"></div>
<div class="col-xs-2">
<button class="btn btn-danger btn-lg">Sign Up
<?php
?>
</button>
</div>
<div class="col-xs-1" style="height: 100px; background: #511F18; width: 2px;"></div>
</div><br>
<div class="row">
<div class="col-xs-12" style="box-shadow: 0 4px 8px 0 rgba(0, 0, 0, 0.2), 0 6px 20px 0 rgba(0, 0, 0, 0.19); width: 100%">
<div class="image">
<img src="images/home-1.jpg" style="width: 1350px;">
<p class="X">Welcome to OrderUp!!</p>
<p class="X_1"> Get food you love delivered at your doorstep!!</p>
<div>
<form class="form-inline" class="srch_br" action="srch_location.php" method="post" enctype="multipart/form-data">
<input type="text" name="loc_srch" placeholder="Enter your location">
<button type="submit" class="btn btn-danger btn-md">Search</button>
</form>
</div>
</div>
</div>
</div>
</div>
These two lines are causing problem:
<p class="X">Welcome to OrderUp!!</p>
<p class="X_1"> Get food you love delivered at your doorstep!!</p>
The problem is in CSS.
your code:
.X{
position: absolute;
top: 200px;
left: 820px;
width: 100%;
color: #FFFFFF;
font-size: 55px;
}
.X_1{
position: absolute;
top: 270px;
left:660px;
width: 100%;
color: #FFFFFF;
font-size: 35px;
}
left: 820px and left: 660px
change them to zero:
.X {
position: absolute;
top: 200px;
left: 0px;
width: 100%;
color: #FFFFFF;
font-size: 55px;
}
.X_1 {
position: absolute;
top: 270px;
left: 0px;
width: 100%;
color: #FFFFFF;
font-size: 35px;
}

How to make the addition of new maps side by side horizontally?

I'm using Bootstrap 3.3.7 and Angular 5.2.0. I have a loop with the addition of a new entry. Entries are added to "cards". But the problem is that they are now added vertically. And how can I make it so that they are added all along the horizontally by about 5 "cards" in a row as a new record is added ie 6 was transferred to a new row.
html and all css on the cards: :
.card{
display: inline-block;
position: relative;
width: 100%;
margin: 25px 0;
box-shadow: 0 1px 4px 0 rgba(0,0,0,0.14);
border-radius: $border-radius-base;
color: $mdb-card-body-text;
background: $mdb-card-body-background;
.card-height-indicator {
margin-top: 100%;
}
.title{
margin-top: 0;
margin-bottom: 5px;
}
.card-image {
height: 60%;
position: relative;
overflow: hidden;
margin-left: 15px;
margin-right: 15px;
margin-top: -30px;
border-radius: $border-radius-large;
img {
width: 100%;
height: 100%;
border-radius: $border-radius-large;
pointer-events: none;
}
.card-title {
position: absolute;
bottom: 15px;
left: 15px;
color: $mdb-card-image-headline;
font-size: $font-size-h4;
text-shadow: 0 2px 5px rgba(33, 33, 33, 0.5);
}
}
.category:not([class*="text-"]){
color: $gray-color;
}
.card-content{
padding: 15px 20px;
.category{
margin-bottom: 0;
}
}
.card-header{
#include shadow-big();
margin: -20px $margin-base 0;
border-radius: $border-radius-base;
padding: $padding-base;
background-color: $gray-color;
.title{
color: $white-color;
}
.category{
margin-bottom: 0;
color: rgba($white-color, .62);
}
&.card-chart{
padding: 0;
min-height: 160px;
+ .content{
h4{
margin-top: 0;
}
}
}
.ct-label{
color: rgba($white-color, .7);
}
.ct-grid{
stroke: rgba(255, 255, 255, 0.2);
}
.ct-series-a .ct-point,
.ct-series-a .ct-line,
.ct-series-a .ct-bar,
.ct-series-a .ct-slice-donut{
stroke: rgba(255,255,255,.8);
}
.ct-series-a .ct-slice-pie,
.ct-series-a .ct-area{
fill: rgba(255,255,255,.4);
}
}
.chart-title{
position: absolute;;
top: 25px;
width: 100%;
text-align: center;
h3{
margin: 0;
color: $white-color;
}
h6{
margin: 0;
color: rgba(255,255,255, .4);
}
}
.card-footer{
margin: 0 20px 10px;
padding-top: 10px;
border-top: 1px solid #eeeeee;
.content{
display: block;
}
div{
display: inline-block;
}
.author{
color: $gray-color;
}
.stats{
line-height: 22px;
color: $gray-color;
font-size: $font-size-small;
.material-icons{
position: relative;
top: 4px;
font-size: $font-paragraph;
}
}
h6{
color: $gray-color;
}
}
img{
width: 100%;
height: auto;
}
.category{
.material-icons{
position: relative;
top: 6px;
line-height: 0;
}
}
.category-social{
.fa{
font-size: 24px;
position: relative;
margin-top: -4px;
top: 2px;
margin-right: 5px;
}
}
.author{
.avatar{
width: 30px;
height: 30px;
overflow: hidden;
border-radius: 50%;
margin-right: 5px;
}
a{
color: $black-color;
text-decoration: none;
.ripple-container{
display: none;
}
}
}
.table{
margin-bottom: 0;
tr:first-child td{
border-top: none;
}
}
[data-background-color="purple"]{
background: linear-gradient(60deg, $purple-400, $purple-600);
#include shadow-big-color($brand-primary);
}
[data-background-color="blue"]{
background: linear-gradient(60deg, $blue-900, $blue-900);
#include shadow-big-color($brand-info);
}
[data-background-color="green"]{
background: linear-gradient(60deg, $green-400, $green-600);
#include shadow-big-color($brand-success);
}
[data-background-color="orange"]{
background: linear-gradient(60deg, $orange-400, $orange-600);
#include shadow-big-color($brand-warning);
}
[data-background-color="red"]{
background: linear-gradient(60deg, $red-400, $red-600);
#include shadow-big-color($brand-danger);
}
[data-background-color]{
color: $white-color;
a{
color: $white-color;
}
}
}
.card-stats{
.title{
margin: 0;
}
.card-header{
float: left;
text-align: center;
i{
font-size: 36px;
line-height: 56px;
width: 56px;
height: 56px;
}
}
.card-content{
text-align: right;
padding-top: 10px;
}
}
.card-nav-tabs{
.header-raised{
margin-top: -$margin-base * 2;
}
.nav-tabs{
background: transparent;
padding: 0;
}
.nav-tabs-title{
float: left;
padding: 10px 10px 10px 0;
line-height: 24px;
}
}
.card-plain{
background: transparent;
box-shadow: none;
.card-header{
margin-left: 0;
margin-right: 0;
}
.content{
padding-left: 5px;
padding-right: 5px;
}
.card-image{
margin: 0;
border-radius: $border-radius-base;
img{
border-radius: $border-radius-base;
}
}
}
.iframe-container{
margin: 0 -20px 0;
iframe{
width: 100%;
height: 500px;
border: 0;
#include shadow-big();
}
}
.card-profile,
.card-testimonial{
margin-top: 30px;
text-align: center;
.btn-just-icon.btn-raised{
margin-left: 6px;
margin-right: 6px;
}
.card-avatar{
max-width: 130px;
max-height: 130px;
margin: -50px auto 0;
border-radius: 50%;
overflow: hidden;
#include shadow-big();
& + .content{
margin-top: 15px;
}
}
&.card-plain{
.card-avatar{
margin-top: 0;
}
}
}
<div class="col-lg-3 col-md-6 col-sm-6">
<div *ngFor="let note of notes" >
<div class="card-header" data-background-color="blue">
<i class="material-icons">store</i>
</div>
<div class="card-content" >
<p class="category">{{note.name}} </p>
</div>
<div class="card-footer">
<div class="stats">
<button class="button-save" ><i class="fa fa-eye"></i></button>
<button class="button-trash" ><i class="fa fa-trash"></i></button>
</div>
</div>
</div>
</div>
Add the *ngFor on the following element
<div class="col-lg-3 col-md-6 col-sm-6" *ngFor="let note of notes">
<!-- Latest compiled and minified CSS -->
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css">
<!-- jQuery library -->
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<!-- Latest compiled JavaScript -->
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script>
<div class="container">
<div class="row">
<div class="col-lg-3 col-md-6 col-sm-6" *ngFor="let note of notes">
<div class="card-header" data-background-color="blue">
<i class="material-icons">store</i>
</div>
<div class="card-content">
<p class="category">{{note.name}} </p>
</div>
<div class="card-footer">
<div class="stats">
<button class="button-save"><i class="fa fa-eye"></i></button>
<button class="button-trash"><i class="fa fa-trash"></i></button>
</div>
</div>
</div>
<div class="col-lg-3 col-md-6 col-sm-6" *ngFor="let note of notes">
<div class="card-header" data-background-color="blue">
<i class="material-icons">store</i>
</div>
<div class="card-content">
<p class="category">{{note.name}} </p>
</div>
<div class="card-footer">
<div class="stats">
<button class="button-save"><i class="fa fa-eye"></i></button>
<button class="button-trash"><i class="fa fa-trash"></i></button>
</div>
</div>
</div>
<div class="col-lg-3 col-md-6 col-sm-6" *ngFor="let note of notes">
<div class="card-header" data-background-color="blue">
<i class="material-icons">store</i>
</div>
<div class="card-content">
<p class="category">{{note.name}} </p>
</div>
<div class="card-footer">
<div class="stats">
<button class="button-save"><i class="fa fa-eye"></i></button>
<button class="button-trash"><i class="fa fa-trash"></i></button>
</div>
</div>
</div>
<div class="col-lg-3 col-md-6 col-sm-6" *ngFor="let note of notes">
<div class="card-header" data-background-color="blue">
<i class="material-icons">store</i>
</div>
<div class="card-content">
<p class="category">{{note.name}} </p>
</div>
<div class="card-footer">
<div class="stats">
<button class="button-save"><i class="fa fa-eye"></i></button>
<button class="button-trash"><i class="fa fa-trash"></i></button>
</div>
</div>
</div>
<div class="col-lg-3 col-md-6 col-sm-6" *ngFor="let note of notes">
<div class="card-header" data-background-color="blue">
<i class="material-icons">store</i>
</div>
<div class="card-content">
<p class="category">{{note.name}} </p>
</div>
<div class="card-footer">
<div class="stats">
<button class="button-save"><i class="fa fa-eye"></i></button>
<button class="button-trash"><i class="fa fa-trash"></i></button>
</div>
</div>
</div>
</div>
</div>
You need to modify the Bopotstrap grid structure to incorporate 5 columns in a row. Try using the following structure, you will be able to get what you want.
.col.col-2 {
flex: 0 0 20%;
max-width: 20%;
}
<link href="https://stackpath.bootstrapcdn.com/bootstrap/4.1.2/css/bootstrap.min.css" rel="stylesheet" />
<div class="container">
<div class="row">
<div class="col col-2">
1 columns
</div>
<div class="col col-2">
2 columns
</div>
<div class="col col-2">
3 columns
</div>
<div class="col col-2">
4 columns
</div>
<div class="col col-2">
5 columns
</div>
<div class="col col-2">
6 columns
</div>
</div>
</div>

Bootstrap- elements overlap on extra small size

I have recent-posts div that show two post with their images and text. after recent-posts I have another div contact-us that contain an image and some text. My issue appear in extra-small size where recent-posts posts go under contact-us part. How can I fix that? The following is my codes and JsFiddle.
HTML:
<div id="recent-posts" class="center-block row">
<div class="posts col-md-3 col-sm-5 col-xs-9">
<div class="posts-div">
<div class="img-hover">
<img src="images/post1.jpg" class="img-responsive">
<div class="overlay col-md-12 col-xs-12">
<div>
<span class="fa fa-2x fa-square post-icon" ><span class="fa fa-heart"></span></span>
<span class="fa fa-2x fa-square post-icon" ><span>16</span></span>
</div>
<div>
<span class="fa fa-2x fa-square post-icon" ><span class="fa fa-eye"></span></span>
<span class="fa fa-2x fa-square post-icon" ><span>16</span></span>
</div>
</div>
</div>
<p class="text-center">dsfdsfsdfldshfdskfhdsf</div>
</div>
<div class="posts col-md-3 col-sm-5 col-xs-9">
<div class="posts-div">
<div class="img-hover">
<img src="images/post2.jpg" class="img-responsive">
<div class="overlay col-md-12 col-xs-12">
<div>
<span class="fa fa-2x fa-square post-icon" ><span class="fa fa-heart "></span></span>
<span class="fa fa-2x fa-square post-icon" ><span>16</span></span>
</div>
<div>
<span class="fa fa-2x fa-square post-icon" ><span class="fa fa-eye "></span></span>
<span class="fa fa-2x fa-square post-icon" ><span>16</span></span>
</div>
</div>
</div>
<p class="text-center">dsjkfhjdssafjsdkjhfdsf</p>
</div>
</div>
</div>
<div id="contact-us" class="row">
<div class="col-md-12 col-xs-12">
<img src="http://www.infocurse.com/wp-content/uploads/2014/11/716988156_1368083660.png" class="img-responsive">
<div id="contact-us-text">
<p>sdkf,sd,kfnds,nf,d.....</p>
<p>kdsfnks,dnf,ksdnf,kdsnf,kdsnf,d</p>
<button class="btn btn-success pull-left">124234234</button>
</div>
</div>
</div>
Css:
#recent-posts{
height: 350px;
display: flex;
justify-content: center;
position: relative;
flex-wrap: wrap;
margin-bottom: 100px;
}
.posts{
display: flex;
flex-direction: column;
height: 350px;
margin-top: 20px;
position: relative;
border-radius: 5px;
box-shadow: 1px 1px 5px #888888;
padding: 0;
margin-left: 20px;
margin-right: 20px;
}
.posts img{
border-radius: 5px 5px 0 0;
cursor: pointer;
}
.posts .btn-success{
position: absolute;
background-color: #01a89e;
width: 50%;
color: #101010;
cursor: auto;
margin-top: -17px;
margin-right: 25%;
}
.posts .btn-success:active{
background-color: #01a89e;
color: #101010;
box-shadow: none;
}
.posts p{
margin-top: 30px;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
.overlay {
position: absolute;
top: 0;
bottom: 100%;
left: 0;
right: 0;
background-color: rgba(46, 183, 175, .7);
overflow: hidden;
height:0;
transition: .8s ease;
display: flex;
justify-content: center;
align-items: center;
cursor: pointer;
border-radius: 5px 5px 0 0;
}
.overlay div:first-child{
margin-left: 15px;
}
.posts-div:hover .overlay {
bottom: 0;
top: 0;
height: auto;
overflow: hidden;
}
.img-hover{
position: relative;
}
.post-icon{
color: rgba(255, 255, 255, 1);
transform: rotate(45deg);
opacity: 1;
}
.post-icon span{
transform: rotate(-45deg);
font-size: 12px;
position: absolute;
left: 50%;
top: 0.6em;
margin-left: -7px;
color: #101010;
font-weight: bold;
}
.fa-heart{
color: red !important;
}
#contact-us{
height: 200px;
margin-bottom: 30px;
box-shadow: 0 1px 5px #666666, 0 -1px 5px #666666;
position: relative;
padding: 0;
overflow: hidden;
}
#contact-us-text{
position: absolute;
top: 20%;
left: 12%;
}
#contact-us-text p{
color: white;
}
#contact-us-text .btn-success{
background-color: #01a89e;
cursor: auto;
}
#contact-us-text .btn-success:active{
background-color: #01a89e;
box-shadow: none;
}
JsFiddle
Recent-posts class has a fixed height.
#recent-posts{
height: 350px; // THIS LINE IS THE REASON!
display: flex;
justify-content: center;
position: relative;
flex-wrap: wrap;
margin-bottom: 100px;
}
Updated fiddle

Hyperlink not clickable using position and z-index

I am working on a contact form.
I want to make a form same as in image
i use position absolute in social media wrapper and z-index:-1;
but facing a problem with hyperlink on social media icon.
html and css code is given below
html
<div class="section text-center c-index">
<div class="container">
<div class="row">
<div class="col-md-6 col-sm-6 col-xs-6 col-md-offset-3 col-sm-offset-3 col-xs-offset-3 form-wrapper-main">
<div class="form-wrapper">
<h3 class="contact-head">Contact Us</h3>
<div class="form-inside">
<form>
<div class="form-group">
<input type="text" class="form-control" placeholder="Name">
</div>
<div class="form-group">
<input type="email" class="form-control" placeholder="Email">
</div>
<div class="form-group">
<textarea name="" id="" cols="10" rows="1" class="form-control" placeholder="Message"></textarea>
</div>
<div id="checkbox" class="checkbox">
<label>
<input type="checkbox"> Agree with terms & conditions
</label>
</div>
<button type="submit" class="btn contact-submit">Submit</button>
</form>
</div>
<div class="social-media-wrapper">
<ul>
<li>
<a href="#" target="_blank">
<i class="fa fa-twitter fa-2x" aria-hidden="true"></i>
</a>
</li>
<li>
<a href="#" target="_blank">
<i class="fa fa-facebook-official fa-2x" aria-hidden="true"></i>
</a>
</li>
<li>
<a href="#" target="_blank">
<i class="fa fa-linkedin-square fa-2x" aria-hidden="true"></i>
</a>
</li>
<li>
<a href="#" target="_blank">
<i class="fa fa-google-plus-official fa-2x" aria-hidden="true"></i>
</a>
</li>
</ul>
</div>
</div>
</div>
</div>
</div>
</div>
Css Code
.form-wrapper {
background-color: #ffffff;
-webkit-box-shadow: 0px 10px 30px 0 rgba(0, 1, 1, .4);
box-shadow: 0px 10px 30px 0 rgba(0, 1, 1, .4);
-webkit-border-radius: 10px;
border-radius: 10px;
z-index: 3;
}
.contact-head,
.form-inside {
text-align: left;
}#checkbox {
padding-left: 55px;
padding-top: 10px;
padding-bottom: 10px;
}.contact-submit {
margin-left: 55px;
margin-top: 10px;
margin-bottom: 20px;}
.contact-head {
padding-top: 20px;
padding-bottom: 20px;
padding-left: 55px;
}
.form-inside form textarea {
resize: none;
}
.social-media-wrapper {
position: absolute;
top: 60px;
right: -80px;
padding-right: 40px;
padding-left: 40px;
padding-top: 20px;
padding-bottom: 20px;
background-color: #00a0ff;
border-radius: 10px;
z-index: -1;
}
.c-index {
z-index: 1;
}
.social-media-wrapper ul {
list-style: none;
padding: 0;
position: relative;
z-index: 10;
}
.social-media-wrapper ul li {
padding-top: 20px;
padding-bottom: 20px;
position: relative;
z-index: 10;
}
.social-media-wrapper ul li a {
color: #ffffff;
z-index: 10;
position: relative;
}
You can wrap both form and social media with a container div. then set the wrapper div to relative and rest two are absolute. then position it as you want. I think this should do the trick.
Here is a codepen link you can explore Click to see the pen
body {
padding-top: 45px;
background: #D2ECFF;
}
.contact-us-form {
box-shadow: 0px 3px 32px 2px rgba(0, 0, 0, 0.2);
width: 85%;
padding: 15px 30px;
border-radius: 15px;
z-index: 3;
position: absolute;
}
.contact-us-form .submit-form {
background: #FF6600;
padding-left: 45px;
padding-right: 45px;
color: #fff;
}
.contact-us-form h2.title {
font-size: 2em;
margin-bottom: 30px;
}
.form-control {
height: 50px;
border-radius: 25px;
font-size: 1.25em;
padding: 0 20px;
background: #F8FAFB;
border: 0;
box-shadow: none;
-webkit-box-shadow: none;
}
textarea.form-control {
padding-top: 15px;
resize: none;
}
.social {
background: #00A0FF;
width: 15%;
text-align: center;
position: absolute;
top: 66px;
right: 30px;
padding-left: 25px;
z-index: 1;
border-radius: 15px;
}
.social li {
padding: 15px;
}
.social li:first-child {
padding-top: 30px;
}
.social li:last-child {
padding-bottom: 30px;
}
.social li a {
color: white;
font-size: 2.25em;
}
.wrap {
position: relative;
}
<link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css" rel="stylesheet"/>
<link href="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.3.7/css/bootstrap.min.css" rel="stylesheet"/>
<div class="col-md-6 col-md-offset-3">
<div class="wrap">
<div class="panel panel-default contact-us-form">
<div class="panel-body">
<h2 class="title">Contact Us</h2>
<form action="">
<div class="form-group">
<input type="text" class="form-control" placeholder="Name"/>
</div>
<div class="form-group">
<input type="email" class="form-control" placeholder="Email" />
</div>
<div class="form-group">
<textarea rows="4" class="form-control" placeholder="Message"></textarea>
</div>
<div class="form-group">
<label>
<input type="checkbox" />
Agree with terms & condition
</label>
</div>
<button type="submit" class="btn btn-lg submit-form">Submit</button>
</form>
</div>
</div>
<div class="social">
<ul class="list-unstyled">
<li><i class="fa fa-twitter-square"></i></li>
<li><i class="fa fa-facebook-square"></i></li>
<li><i class="fa fa-linkedin-square"></i></li>
<li><i class="fa fa-google-plus-square"></i></li>
</ul>
</div>
</div> <!-- /wrap -->
</div>
You have added unnecessary position: relative and z-index properties on many elements. Remove all of them.
Add position: relative on the container having your social media div.
Draw required background with :before or :after pseudo element with lower z-index. This will enable the social icons to remain clickable.
.form-wrapper {
background-color: #ffffff;
-webkit-box-shadow: 0px 10px 30px 0 rgba(0, 1, 1, .4);
box-shadow: 0px 10px 30px 0 rgba(0, 1, 1, .4);
-webkit-border-radius: 10px;
border-radius: 10px;
position: relative;
}
.contact-head,
.form-inside {
text-align: left;
}
#checkbox {
padding-left: 55px;
padding-top: 10px;
padding-bottom: 10px;
}
.contact-submit {
margin-left: 55px;
margin-top: 10px;
margin-bottom: 20px;}
.contact-head {
padding-top: 20px;
padding-bottom: 20px;
padding-left: 55px;
}
.form-inside form textarea {
resize: none;
}
.social-media-wrapper {
position: absolute;
top: 60px;
right: -100px;
padding-right: 40px;
padding-left: 40px;
padding-top: 20px;
padding-bottom: 20px;
}
.social-media-wrapper:before {
background-color: #00a0ff;
border-radius: 10px;
position: absolute;
content: '';
z-index: -1;
bottom: 0;
right: 0;
left: 0;
top: 0;
}
.social-media-wrapper ul {
list-style: none;
padding: 0;
}
.social-media-wrapper ul li {
padding-top: 20px;
padding-bottom: 20px;
}
.social-media-wrapper ul li a {
color: #ffffff;
}
<link href="https://maxcdn.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css" rel="stylesheet"/>
<link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" rel="stylesheet"/>
<div class="section text-center c-index">
<div class="container">
<div class="row">
<div class="col-md-6 col-sm-6 col-xs-6 col-md-offset-3 col-sm-offset-3 col-xs-offset-3 form-wrapper-main">
<div class="form-wrapper">
<h3 class="contact-head">Contact Us</h3>
<div class="form-inside">
<form>
<div class="form-group">
<input type="text" class="form-control" placeholder="Name">
</div>
<div class="form-group">
<input type="email" class="form-control" placeholder="Email">
</div>
<div class="form-group">
<textarea name="" id="" cols="10" rows="1" class="form-control" placeholder="Message"></textarea>
</div>
<div id="checkbox" class="checkbox">
<label>
<input type="checkbox"> Agree with terms & conditions
</label>
</div>
<button type="submit" class="btn contact-submit">Submit</button>
</form>
</div>
<div class="social-media-wrapper">
<ul>
<li>
<a href="#" target="_blank">
<i class="fa fa-twitter fa-2x" aria-hidden="true"></i>
</a>
</li>
<li>
<a href="#" target="_blank">
<i class="fa fa-facebook-official fa-2x" aria-hidden="true"></i>
</a>
</li>
<li>
<a href="#" target="_blank">
<i class="fa fa-linkedin-square fa-2x" aria-hidden="true"></i>
</a>
</li>
<li>
<a href="#" target="_blank">
<i class="fa fa-google-plus-official fa-2x" aria-hidden="true"></i>
</a>
</li>
</ul>
</div>
</div>
</div>
</div>
</div>
</div>
Seems working fine, except you have given # inside href attribute, currently it is clickable, you have to provide proper url instead of the #
Fiddle Demo

Aligning responsive Bootstrap images with caption title text

I have these 3 column images with title, caption ad icon that I couldn't align properly. Is there way fix the caption and title text according to the image width? What is the best practice to deal with these kind of content? Should I align the CSS for each screen size ?
#import url('http://netdna.bootstrapcdn.com/bootstrap/3.0.0/css/bootstrap.min.css');
.urun-text {
position: absolute;
background-color: rgba(15, 15, 15, 0.93);
color: #fff;
bottom: 0px;
text-align: left;
padding: 20px 15px 20px 15px;
}
.urun-title {
position: absolute;
bottom: 80px;
text-align: left;
z-index: 15;
padding-top: 5px;
padding-bottom: 5px;
color: #fff;
padding-left: 20px;
text-shadow: 0 1px 2px rgba(0, 0, 0, .6);
background-color: rgba(194, 0, 0, 0.93);
width: 100%;
}
.click-arrow-right {
position: absolute;
z-index: 16;
color: #fff;
font-size: 10px;
bottom: 0px;
right: 33px;
}
<div class="container">
<div class="row">
<div class="col-md-4">
<div class="product-box">
<img src="http://i.imgur.com/xkAVZ3b.jpg" alt="Yeni Ürünler" class="align-center img-responsive">
<div class="urun-title"><span class="glyphicon glyphicon-star"></span> YENİ ÜRÜNLER</div>
<div class="urun-text">En yeni mobilya konseptlerini görmek için tıklayınız.</div>
<div class="click-arrow-right"><span class="glyphicon glyphicon-arrow-right"></span>
</div>
</div>
</div>
<div class="col-md-4">
<div class="product-box">
<img src="http://i.imgur.com/xkAVZ3b.jpg" alt="Yeni Ürünler" class="align-center img-responsive">
<div class="urun-title"><span class="glyphicon glyphicon-star"></span> YENİ ÜRÜNLER</div>
<div class="urun-text">En yeni mobilya konseptlerini görmek için tıklayınız.</div>
<div class="click-arrow-right"><span class="glyphicon glyphicon-arrow-right"></span>
</div>
</div>
</div>
<div class="col-md-4">
<div class="product-box">
<img src="http://i.imgur.com/xkAVZ3b.jpg" alt="Yeni Ürünler" class="align-center img-responsive">
<div class="urun-title"><span class="glyphicon glyphicon-star"></span> YENİ ÜRÜNLER</div>
<div class="urun-text">En yeni mobilya konseptlerini görmek için tıklayınız.</div>
<div class="click-arrow-right"><span class="glyphicon glyphicon-arrow-right"></span>
</div>
</div>
</div>
</div>
</div
Here you go
http://jsfiddle.net/ajruk60t/3/
.product-box {
display:inline-block;
position:relative;
}
.urun-title {
width:100%;
}
.urun-text {
width:100%;
}
Setting the display to inline-block allows the .product-box to only be as wide as it's content (namely,the image), and position:relative allows us to set the width of the nested .urun-title and .urun-text elements to be 100% of the width of the .product-box.