How to arrange the buttons to fill the profits? - css

I am trying to create a spending board with Bootstrap 4.
Right now that's what I did, and I want buttons to be displayed as in the picture below.
I have no idea how to do it ..
What I get right now:
What I want to get in the end:
.btn-warning {
border: 1px solid black;
height: 85px;
}
.middel {
background-color: #ff00008a;
border: 4px solid black;
height: 270px;
border-radius: 50%;
}
<link href="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-ggOyR0iXCbMQv3Xipma34MD+dH/1fQ784/j6cY/iJTQUOhcWr7x9JvoRxT2MZw1T" crossorigin="anonymous">
<div class="container" style="border: 1px solid black">
<div class="row">
<div class="col-6" style="border: 1px solid black;height: 85px;"> בוצע על ידי
<select class="form-control">
<option> moshe </option>
<option> haim </option>
<option> kobi </option>
</select>
</div>
<div class="col-6" style="border: 1px solid black; height: 85px;"> באמצעות
<select class="form-control">
<option> moshe </option>
<option> haim </option>
<option> kobi </option>
</select>
</div>
</div>
<div class="row">
<button class="col-3 btn btn-warning"> אוכל לבית </button>
<button class="col-3 btn btn-warning"> בילוים </button>
<button class="col-3 btn btn-warning"> אינטרנט חשמל וכבלים </button>
<button class="col-3 btn btn-warning"> ארנונה </button>
<button class="col-3 btn btn-warning"> ארנונה </button>
<button class="col-6 middel">
<h2>expense</h2>
<div style="font-size: 120%; color: red"> <b>1900</b></div>
<div style="font-size: 75%; color: green"><b> 3500</b></div>
</button>
<button class="col-3 btn btn-warning"> חשבונות בית </button>
<button class="col-3 btn btn-warning"> הוצאות רפואיות </button><button class="col-3 btn btn-warning">
חשבונות בית </button>
<button class="col-3 btn btn-warning"> הוצאות רפואיות </button>
<button class="col-3 btn btn-warning"> חשבונות בית </button>
<button class="col-3 btn btn-warning"> הוצאות רפואיות </button>
<button class="col-3 btn btn-warning"> חשבונות בית </button>
<button class="col-3 btn btn-warning"> הוצאות רפואיות </button>
<button class="col-3 btn btn-warning"> חשבונות בית </button>
</div>
<div class="row" style="margin: 5px;height: 75px;border: 1px solid black">
<div class="col-4">
בחר את תאריך ביצוע הפעולה :
</div>
<div class="col-8">
<input class="form-control" type="date">
</div>
</div>
<div class="row" style="margin: 5px;height: 75px; border: 1px solid black">
<input class="col-12" type="text" placeholder="תאר את ההוצאה (לא חובה)">
</div>
<div class="row" style="margin: 5px;height: 75px; border: 1px solid black">
<button class="btn btn-dark col-12"> הוסף </button>
</div>
</div>
Attaching photo after #connexo answer:

Consider using CSS grid. Please note that your HTML is actually invalid. button cannot contain either of h2 and div, only non-interactive phrasing content.
body {
margin: 0;
}
.grid {
width: 100vw;
height: 100vh;
display: grid;
grid-template-rows: repeat(5, minmax(0, 1fr));
grid-template-columns: repeat(4, minmax(0, 1fr));
grid-gap: 2px;
}
.grid button {
background-color: orange;
}
.grid .centercell {
background-color: lime;
grid-row: 2/5;
grid-column: 2/4;
border-radius: 50%;
}
<div class="grid">
<button> אוכל לבית </button>
<button> בילוים </button>
<button> אינטרנט חשמל וכבלים </button>
<button> ארנונה </button>
<button> ארנונה </button>
<button class="centercell">
<span>expense</span>
<span style="font-size: 120%; color: red"> <b>1900</b></span>
<span style="font-size: 75%; color: green"><b> 3500</b></span>
</button>
<button> חשבונות בית </button>
<button> הוצאות רפואיות </button><button>
חשבונות בית </button>
<button> הוצאות רפואיות </button>
<button> חשבונות בית </button>
<button> הוצאות רפואיות </button>
<button> חשבונות בית </button>
<button> הוצאות רפואיות </button>
<button> חשבונות בית </button>
</div>

I think you need to change your html struct like this:
.btn-warning {
border: 1px solid black;
height: 85px;
}
.middel {
background-color: #ff00008a;
border: 4px solid black;
height: 270px;
border-radius: 50%;
}
<link href="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-ggOyR0iXCbMQv3Xipma34MD+dH/1fQ784/j6cY/iJTQUOhcWr7x9JvoRxT2MZw1T" crossorigin="anonymous">
<div class="container" style="border: 1px solid black">
<div class="row">
<div class="col-6" style="border: 1px solid black;height: 85px;"> בוצע על ידי
<select class="form-control">
<option> moshe </option>
<option> haim </option>
<option> kobi </option>
</select>
</div>
<div class="col-6" style="border: 1px solid black; height: 85px;"> באמצעות
<select class="form-control">
<option> moshe </option>
<option> haim </option>
<option> kobi </option>
</select>
</div>
</div>
<div class="row">
<button class="col-3 btn btn-warning"> אוכל לבית </button>
<button class="col-3 btn btn-warning"> בילוים </button>
<button class="col-3 btn btn-warning"> אינטרנט חשמל וכבלים </button>
<button class="col-3 btn btn-warning"> ארנונה </button>
</div>
<div class="row">
<div class="col-3">
<button class="col-12 btn btn-warning"> ארנונה </button>
<button class="col-12 btn btn-warning"> הוצאות רפואיות </button>
<button class="col-12 btn btn-warning">
חשבונות בית </button>
</div>
<div class="col-6">
<button class="col-12 middel">
<h2>expense</h2>
<div style="font-size: 120%; color: red"> <b>1900</b></div>
<div style="font-size: 75%; color: green"><b> 3500</b></div>
</button>
</div>
<div class="col-3">
<button class="col-12 btn btn-warning"> חשבונות בית </button>
<button class="col-12 btn btn-warning"> חשבונות בית </button>
<button class="col-12 btn btn-warning"> הוצאות רפואיות </button>
</div>
</div>
<div class="row">
<button class="col-3 btn btn-warning"> הוצאות רפואיות </button>
<button class="col-3 btn btn-warning"> חשבונות בית </button>
<button class="col-3 btn btn-warning"> הוצאות רפואיות </button>
<button class="col-3 btn btn-warning"> חשבונות בית </button>
</div>
<div class="row" style="margin: 5px;height: 75px;border: 1px solid black">
<div class="col-4">
בחר את תאריך ביצוע הפעולה :
</div>
<div class="col-8">
<input class="form-control" type="date">
</div>
</div>
<div class="row" style="margin: 5px;height: 75px; border: 1px solid black">
<input class="col-12" type="text" placeholder="תאר את ההוצאה (לא חובה)">
</div>
<div class="row" style="margin: 5px;height: 75px; border: 1px solid black">
<button class="btn btn-dark col-12"> הוסף </button>
</div>
</div>

Related

How does Meteor.js decide the order in which components are rendered?

I have the following code in Meteor.js written by someone else
<div>
<div> {{> yield region='tickets'}} </div>
<div> {{> yield region='ticketView'}} </div>
<div> {{> yield region='analytics'}} </div>
</div>
It works fine but I have an issue with the order in which those components are rendered. When that page is opened, the 'analytics' clearly loads/renders first, then once that is done the rest of it renders. I would like it to load/render in the order that the components are called.
Attaching template files to take a look at
region='tickets' ====> ticketsList (This should always load first)
region='ticketView' ====> ticket_view
region='analytics' ====> analytics
<template name="ticketsList">
<div id="tickets-list" class="tickets-list">
<div class="btn-group btn-group-justified">
<div class="btn-group btn-group-lg">
<button class="btn btn-primary {{unresolvedActive}}" id="unresolved">
Unresolved
<span class="label label-pill label-danger label-as-badge">{{ unresolvedTicketsCount }}</span>
</button>
</div>
<div class="btn-group btn-group-lg">
<button class="btn btn-primary {{resolvedActive}}" id="resolved">
Resolved
</button>
</div>
</div>
<div class="row m-t-sm">
<div class="col-xs-3">
{{> broadcast}}
</div>
<div class="col-xs-3" style="margin-left: 12px;">
<button class="btn btn-info" type="button" id="create-shift-report" style="
background-color: #278006;
border-color: #278006;
border-radius: 25px;
">
<span class="glyphicon glyphicon-plus" aria-hidden="true"
style="background-color: #278006; color: white"></span>
<i class="fa fa-folder-open fa-lg" aria-hidden="true"></i>
</button>
</div>
<div class="col-xs-5" style="float:right">
<button class="btn btn-info" type="button" id="create-ticket" style="
float: right !important;
background-color: #56cf1b;
border-color: #56cf1b;
border-radius: 25px;
">
<span class="glyphicon glyphicon-plus" aria-hidden="true"
style="background-color: #56cf1b; color: white"></span>
Create Ticket
</button>
</div>
</div>
<div class="row m-t-sm">
<div class="col-sm-12" style="padding: 0px">
<div class="wrapper">
<input type="text" placeholder="Search ..." class="searchInput" id="searchQuery" name="search" />
<button type="submit" class="searchButton search-button">
{{#if isSearch}}
<i class="fa fa-times clearbutton" aria-hidden="true"></i>
{{/if}}
<i class="fa fa-search"></i>
</button>
</div>
</div>
</div>
{{#if isSearch}}
<div class="row m-t-sm">
<div class="col-sm-12">
<div class="wrapper">
<i>
<h4>Search Results</h4>
</i>
</div>
</div>
</div>
{{/if}}
<div class="row m-t-sm">
<div class="col-sm-12">
<div class="wrapper">
<span style="font-style: italic;">Filter by department: </span>
<select class="ticket-department-filter" id="departmentFilter">
<option>All</option>
{{#each tags}}
<option value={{this.id}}>{{this.name}}</option>
{{/each}}
</select>
</div>
</div>
</div>
<div class="row m-t-sm">
<div class="col-sm-12">
<div class="wrapper">
<span style="font-style: italic;">Filter by source: </span>
<select class="ticket-department-filter" id="sourceFilter">
<option>All</option>
{{#each sourceFilter}}
<option>{{this}}</option>
{{/each}}
</select>
</div>
</div>
</div>
<div class="tickets scrollbar m-t-sm">
{{#if tickets.length}} {{#each tickets}} {{> ticketItem}} {{/each}} {{#if
showLoading}}
{{> LoadingNew }}
{{else}} {{#if noMore}}
<div class="alert alert-warning m-t-sm" style="text-align: center; vertical-align: middle; padding: 5px">
No more tickets available!
</div>
{{else}}
<div class="m-t-sm" style="text-align: center">
<button id="show-more" class="btn btn-primary"
style="width: 100px; background-color: #337ab7; border-color: #2e6da4">
Show More
</button>
</div>
{{/if}} {{/if}} {{else}} {{#if showLoading}} {{> LoadingNew }} {{else}}
<hr />
<h2 class="text-center" style="font-size: 14px">
<i>No outstanding tickets</i>
</h2>
<hr />
{{/if}} {{/if}}
</div>
</div>
{{> shiftReportModal}}
<div id="new-ticket-modal" class="modal fade" role="dialog">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header" style="background-color: #83ccff">
<button type="button" class="close" data-dismiss="modal">
×
</button>
<h4 class="modal-title" style="text-align: center; color: #ffffff">
Create a New Ticket
</h4>
</div>
<form class="form-horizontal" id="create-ticket-form">
<div class="modal-body">
<div class="form-group">
<div class="col-sm-3"><label for="source">* Source</label></div>
<div class="col-sm-9">
<label class="radio-inline">
<input type="radio" name="source" id="call" value="call" />
Call
</label>
<label class="radio-inline">
<input type="radio" name="source" id="inPerson" value="in-person" />
In-Person
</label>
<label class="radio-inline">
<input type="radio" name="source" id="email" value="email" />
Email
</label>
<label class="radio-inline">
<input type="radio" name="source" id="dnd" value="dnd" />
DND
</label>
<label class="radio-inline">
<input type="radio" name="source" id="shift-report" value="shift-report" />
Shift Report
</label>
</div>
<div class="col-sm-3"></div>
<div class="col-sm-9">
<label class="radio-inline">
<input type="radio" name="source" id="soft-check-in" value="soft-check-in" />
Soft check-in
</label>
<label class="radio-inline">
<input type="radio" name="source" id="amenity" value="amenity" />
Amenity
</label>
<label class="radio-inline">
<input type="radio" name="source" id="request" value="request" />
Request
</label>
<label class="radio-inline">
<input type="radio" name="source" id="repair" value="repair" />
Repair
</label>
</div>
</div>
<div class="form-group">
<label class="col-sm-3" for="guestName">Guest Name</label>
<div class="col-sm-4">
<input type="text" class="form-control" id="guestName" name="guestName" />
</div>
<label for="autoFill">OR Auto-Fill </label>
<select id="autoFill" name="autofill">
<option value="-1">Select Guest</option>
{{#each pastGuests}}
<option value="{{ #index }}">
{{ receiverName }} ({{ roomNumber }})
</option>
{{/each}}
</select>
</div>
<div class="form-group">
<label class="col-sm-3" for="roomNumber">* Room #</label>
<div class="col-sm-9">
<input type="text" class="form-control" required id="roomNumber" name="roomNumber" />
</div>
</div>
<div class="form-group">
<label class="col-sm-3" for="reservationNumber">Reservation #</label>
<div class="col-sm-9">
<input type="text" class="form-control" id="reservationNumber" name="reservationNumber" />
</div>
</div>
<div class="form-group">
<label class="col-sm-3" for="email">Email</label>
<div class="col-sm-9">
<input type="email" class="form-control" id="emailAddress" name="emailAddress" />
</div>
</div>
<div class="form-group">
<label class="col-sm-3" for="phoneNumber">Phone #</label>
<div class="col-sm-9">
<input type="text" class="form-control" id="phoneNumber" name="phoneNumber" />
</div>
</div>
<div class="form-group">
<label class="col-sm-3" for="notes">* Notes:</label>
<div class="col-sm-9">
<textarea type="text" class="form-control" required id="notes" name="notes" rows="3"></textarea>
</div>
</div>
</div>
<div class="modal-footer">
<button class="btn btn-primary" type="submit">Save</button>
<button type="button" class="btn btn-default" data-dismiss="modal">
Close
</button>
</div>
</form>
</div>
</div>
</div>
</template>
<template name="ticketView">
<div>
{{> ticketItemView}}
</div>
<div id="tickets-list" class="tickets-list ">
<div class="btn-group btn-group-justified">
{{#if oleryTabs}}
<div class="btn-group btn-group-lg">
<button class="btn1 email-btn {{resolvedActive}} {{#if noEmail}}simptip-position-top{{/if}}"
id="respondTab" style="background: #41e1eb;">
Respond
</button>
</div>
{{else}}
<div class="btn-group btn-group-lg">
<button class="btn1 email-btn {{resolvedActive}} {{#if noEmail}}simptip-position-top{{/if}}"
id="emailtab" disabled="{{noEmail}}"
data-tooltip="{{#if noEmail}}In-app communication unavailable for Custom Ticket{{/if}}">
Email
{{#unless noEmail}}<label class="counts">({{emailcount}})</label>{{/unless}}
</button>
</div>
<div class="btn-group btn-group-lg">
<button class="btn1 sms-btn {{resolvedActive}} {{#if noPhone}}simptip-position-top{{/if}}"
id="smstab" disabled="{{noPhone}}"
data-tooltip="{{#if noPhone}}In-app communication unavailable for Custom Ticket{{/if}}">
SMS
{{#unless noPhone}}<label class="counts">({{smscount}})</label>{{/unless}}
</button>
</div>
{{/if}}
<div class="btn-group btn-group-lg">
<button class="btn1 staff-btn {{unresolvedActive}}" id="staffnotestab">Notes
<label class="counts">({{staffcount}})</label>
</button>
</div>
</div>
</div>
<div id="show" style="display: none;">
<div class="comments">
{{> commentsList}}
</div>
<div class="comment-form">
{{> commentSubmit}}
</div>
</div>
<div id="show2" style="display: none;">
<div class="comments">
{{> sendEmailList}}
</div>
{{#unless noEmail}}
<div class="comment-form">
{{> sendemail}}
</div>
{{/unless}}
</div>
<div id="show3" style="display: none;">
<div class="comments">
{{> sendSmsList}}
</div>
{{#unless noPhone}}
<div class="comment-form">
{{#if isPhoneNumberExists}}
{{> sendsms}}
{{/if}}
{{> closesms}}
</div>
{{/unless}}
</div>
<div id="show4" style="display: none;">
<div class="comments">
<div class="panel panel-danger resolution-history" style="border-color: #41E1EB;">
<div class="panel-heading" style="background: #41e1eb; border-color: #41E1EB;">
<p>Respond directly on the review site.</p>
</div>
<div class="panel-body" style="max-height: none; border-color: #41E1EB;">
<p>
You can respond to this review using the link below. It will take you to the site's admin portal where you
can post a reply.
</p>
{{#if oleryIframe}}
<iframe src="{{oleryTabs.respond_url}}" style="width: 100%; height: 450px;"></iframe>
{{else}}
<a href="{{oleryTabs.respond_url}}" target="_blank">
{{oleryTabs.respond_url}}
</a>
{{/if}}
</div>
</div>
</div>
</div>
</template>
<template name="analytics">
<div class="panel panel-success analytics scrollbar ">
<div class="panel-heading">
<h2>Statistics</h2>
</div>
<div class="">
{{#if mobile}}
<div id="statistics-dashboard" style="border: 1px solid white">
<div class="row">
<button class="btn btn-primary {{overallActive}} col-xs-3" id="overall" style="border: 1px solid white; font-size: 8px; padding: 10px 0; text-align: center;">
{{#if smallMobile}}
<img src="/Overall_icon.png" style="height: 12px; width: 12px;">
{{else}}
<img src="/Overall_icon.png" style="height: 20px; width: 20px;">
{{/if}}
Overall
</button>
<button class="btn btn-primary {{teamActive}} col-xs-3" id="team" style="border: 1px solid white; font-size: 8px; padding: 10px 0; text-align: center;">
{{#if smallMobile}}
<img src="/Team_icon.png" style="height: 12px; width: 12px;">
{{else}}
<img src="/Team_icon.png" style="height: 20px; width: 20px;">
{{/if}}
Team
</button>
<button class="btn btn-primary {{resolutionActive}} col-xs-3" id="resolution" style="border: 1px solid white; font-size: 8px; padding: 10px 0; text-align: center;">
{{#if smallMobile}}
<img src="/Resolution_icon.png" style="height: 12px; width: 12px; padding: 0; margin: 0;">
{{else}}
<img src="/Resolution_icon.png" style="height: 20px; width: 20px;">
{{/if}}
Resolve
</button>
<button class="btn btn-primary {{shiftActive}} col-xs-3" id="shift" style="border: 1px solid white; font-size: 8px; padding: 10px 0; text-align: center;">
{{#if smallMobile}}
<img src="/Shifts_icon.png" style="height: 12px; width: 12px; padding: 0; margin: 0;">
{{else}}
<img src="/Shifts_icon.png" style="height: 20px; width: 20px;">
{{/if}}
Shift
</button>
</div>
</div>
{{else}}
<div id="statistics-dashboard">
<div class="btn-group btn-group-justified">
<div class="btn-group">
<button class="btn btn-primary {{overallActive}} col-md-3 col-xs-12" id="overall"
style="width: 100%; padding-left: 5px; border: 1px solid white; border-left: none; font-size: 12px; font-style: italic;">
<img src="/Overall_icon.png" style="height:20px; width: 20px;">
Overall
</button>
</div>
<div class="btn-group">
<button class="btn btn-primary {{teamActive}} col-md-3 col-xs-12" id="team"
style="width:90%; padding-left: 5px; border: 1px solid white; font-size: 12px; font-style: italic;">
<img src="/Team_icon.png" style="height: 20px; width: 20px;">
Team
</button>
</div>
<div class="btn-group">
<button class="btn btn-primary {{resolutionActive}} col-md-3 col-xs-12" id="resolution"
style="width: 125%; padding-left: 5px; margin-left: -10px; border: 1px solid white; font-size: 12px; font-style: italic;">
<img src="/Resolution_icon.png" style="height:20px; width:20px;">
Resolution
</button>
</div>
<div class="btn-group">
<button class="btn btn-primary {{shiftActive}} col-md-3 col-xs-12" id="shift"
style="width: 90%; padding-left: 5px; margin-left: 10px; border: 1px solid white; border-right: none; font-size: 12px; font-style: italic;">
<img src="/Shifts_icon.png" style="height:20px; width:20px;">
Shift
</button>
</div>
</div>
</div>
{{/if}}
</div>
{{#if overallActive}}
<div class="panel-body">
<div id="total-tickets">
{{> totalTickets}}
</div>
<div id="active-staff">
{{> activeStaff}}
</div>
</div>
{{/if}}
{{#if resolutionActive}}
<div class="panel-body">
<div id="tickets-graph">
{{> ticketsGraph}}
</div>
</div>
{{/if}}
{{#if shiftActive}}
<div class="panel-body">
{{> shiftStatistics }}
</div>
{{/if}}
{{#if teamActive}}
<div class="panel-body">
<div id="comment-stats">
{{> commentStats}}
</div>
<div id="department-stats">
{{> departmentStats}}
</div>
</div>
{{/if}}
</div>
</template>
Let me know if there is anything else I can provide to help! Can add the JS files if necessary. Any help would be much appreciated!

Bootstrap 3 cards align horizontally

I want card type structure horizontally in Bootstrap.
Something like this and need pagination too for more cards.
Can anyone help me with this design
.card{
border:1px solid #ccc;
border-radius:0.5rem;
padding:1rem;
box-shadow: 0 0 10px #ccc;
box-shadow:0 0 10px #ccc;
transition: all 0.2s;
}
.card:hover{
transform: scale(1.1);
}
#media screen and (max-width: 568px) {
.card{
margin:1rem;
}
.card:hover{
transform: none;
}
}
<div class="container">
<div class="row">
<div class="col-sm-3">
<div class="card">
<h3>Exam Preparation</h3>
<p>The mind Map for Physics Preparation</p>
<div class='btn-toolbar'>
<button class="btn btn-sm btn-primary">Edit</button>
<button class="btn btn-sm btn-primary">Delete</button>
<button class="btn btn-sm btn-primary">share</button>
</div>
</div>
</div>
<div class="col-sm-3">
<div class="card">
<h3>Exam Preparation</h3>
<p>The mind Map for Physics Preparation</p>
<div class='btn-toolbar'>
<button class="btn btn-sm btn-primary">Edit</button>
<button class="btn btn-sm btn-primary">Delete</button>
<button class="btn btn-sm btn-primary">share</button>
</div>
</div>
</div>
<div class="col-sm-3">
<div class="card">
<h3>Exam Preparation</h3>
<p>The mind Map for Physics Preparation</p>
<div class='btn-toolbar'>
<button class="btn btn-sm btn-primary">Edit</button>
<button class="btn btn-sm btn-primary">Delete</button>
<button class="btn btn-sm btn-primary">share</button>
</div>
</div>
</div>
<div class="col-sm-3">
<div class="card">
<h3>Exam Preparation</h3>
<p>The mind Map for Physics Preparation</p>
<div class='btn-toolbar'>
<button class="btn btn-sm btn-primary">Edit</button>
<button class="btn btn-sm btn-primary">Delete</button>
<button class="btn btn-sm btn-primary">share</button>
</div>
</div>
</div>
</div>
</div>

height alignment issue while displaying the products

I am doing an eCommerce project. While displaying the products list, if I insert any content inside, height will vary and total alignment is disturbed.
You can see the code below. I'm using bootstrap 4.
#product_list {
width: 210px;
margin-right: 0px;
font-size: 14px;
}
.product-item {
width: 100%;
height: 350px;
cursor: pointer;
background-color: #FFFFFF;
}
.product {
width: 100%;
height: 350px;
border: solid 2px #e9e9e9;
}
.product_image {
width: 100%;
text-align: center;
}
.product_image img {
width: 70%;
height: 70%;
}
<!-- Start to products display -->
<ul class="inline-item pt-2" style="padding-left:0px;padding-right:0px;" id="product_list_grid">
<li class="list-inline-item mb-1" id="product_list">
<div class="product-item mb-1">
<div class="product">
<div class="product_image">
<img src="images/FREEDOM.png" alt="">
</div>
<div class=" text-center mb-0 ">
<h6 class="product_brand"><a class="text-dark" href="single.html">Ashirvad</a></h6>
<h6 class="product_name">
<p class="card-text m-0">
<label> Ahirvad </label>
<button type="button" class="btn btn-sm text-white " id="background_color" data-toggle="modal" data-target="#myModal1"> 1kg </button>
</p>
</h6>
<p class=" mb-0">
<span>20pc/Box</span> ❙ <span>Min 5 boxes</span>
</p>
<div class="product_price">
<span>MRP : <del>$50</del></span> ❙ <span> <b> Sale : $40 </b> </span>
</div>
<div class="quantity mb-1 ">
<input type="button" value="-" class="minus " style="border-radius:50px;">
<span> 1 </span>
<input type="button" value="+" class="plus" style="border-radius:50px;">
</div>
<div class=" text-center my-2 ">
<a class="btn btn-sm text-white" id="background_color" href="#">add to cart</a>
</div>
</div>
</div>
</div>
</li>
<li class="list-inline-item mb-1" id="product_list">
<div class="product-item mb-1">
<div class="product">
<div class="product_image">
<img src="images/FREEDOM.png" alt="">
</div>
<div class=" text-center mb-0 ">
<h6 class="product_brand"><a class="text-dark" href="single.html">Ashirvad</a></h6>
<h6 class="product_name">
<p class="card-text m-0">
<label> Ahirvad </label>
<button type="button" class="btn btn-sm text-white " id="background_color" data-toggle="modal" data-target="#myModal1"> 1kg </button>
</p>
</h6>
<p class=" mb-0">
<span>20pc/Box</span> ❙ <span>Min 5 boxes</span>
</p>
<div class="product_price"> <span>MRP : <del>$50</del></span> ❙ <span> <b>
Sale : $40 </b> </span> </div>
<div class="quantity mb-1 ">
<input type="button" value="-" class="minus " style="border-radius:50px;">
<span> 1 </span>
<input type="button" value="+" class="plus" style="border-radius:50px;">
</div>
<div class=" text-center my-2 "><a class="btn btn-sm text-white" id="background_color" href="#">add to cart</a></div>
</div>
</div>
</div>
</li>
........
</ul>
This the code I am using to display the products ,while displaying if the list items content and images everything same it will display clearly. If I insert any content inside height alignment issue is arising.
<ul class="inline-item pt-2 d-flex flex-wrap" style="padding-left:0px;padding-right:0px;" id="product_list_grid">
<li class="list-inline-item mb-1" id="product_list">
<div class="product-item mb-1">
<div class="product">
<div class="product_image">
<img src="images/FREEDOM.png" alt="">
</div>
<div class=" text-center mb-0 ">
<h6 class="product_brand"><a class="text-dark" href="single.html">Ashirvad</a></h6>
<h6 class="product_name">
<p class="card-text m-0">
<label> Ahirvad </label>
<button type="button" class="btn btn-sm text-white " id="background_color"
data-toggle="modal" data-target="#myModal1">
1kg
</button>
</p>
</h6>
<p class=" mb-0">
<span>20pc/Box</span> ❙ <span>Min 5 boxes</span>
</p>
<div class="product_price"> <span>MRP : <del>$50</del></span> ❙ <span> <b>
Sale : $40 </b> </span> </div>
<div class="quantity mb-1 ">
<input type="button" value="-" class="minus " style="border-radius:50px;">
<span> 1 </span>
<input type="button" value="+" class="plus" style="border-radius:50px;">
</div>
<div class=" text-center my-2 "><a class="btn btn-sm text-white" id="background_color"
href="#">add
to cart</a></div>
</div>
</div>
</div>
</li>
<li class="list-inline-item mb-1" id="product_list">
<div class="product-item mb-1">
<div class="product">
<div class="product_image">
<img src="images/FREEDOM.png" alt="">
</div>
<div class=" text-center mb-0 ">
<h6 class="product_brand"><a class="text-dark" href="single.html">Ashirvad</a></h6>
<h6 class="product_name">
<p class="card-text m-0">
<label> Ahirvad </label>
<button type="button" class="btn btn-sm text-white " id="background_color"
data-toggle="modal" data-target="#myModal1">
1kg
</button>
</p>
</h6>
<p class=" mb-0">
<span>20pc/Box</span> ❙ <span>Min 5 boxes</span>
</p>
<div class="product_price"> <span>MRP : <del>$50</del></span> ❙ <span> <b>
Sale : $40 </b> </span> </div>
<div class="quantity mb-1 ">
<input type="button" value="-" class="minus " style="border-radius:50px;">
<span> 1 </span>
<input type="button" value="+" class="plus" style="border-radius:50px;">
</div>
<div class=" text-center my-2 "><a class="btn btn-sm text-white" id="background_color"
href="#">add
to cart</a></div>
</div>
</div>
</div>
</li>
</ul>
<style>
/* Start to css for product list */
#product_list {width:210px;
margin-right: 0px;
font-size: 14px;}
.product-item
{
width: 100%;
height: 350px;
cursor: pointer;
background-color: #FFFFFF;
}
.product {
width: 100%;
height: auto;
border: solid 2px #e9e9e9;
max-height: 600px;
}
.product_image
{
width: 100%;
text-align: center;
}
.product_image img
{
width: 70%;
height:70%;
}
/* END to css for product list */
</style>
use "d-flex" and "flex-wrap" class for ul tag. and use max-height instead of height.
I hope it would be helpful.

Responsive button thumbnail height and width

I want to create css which will work for responsive button like bootstrap "img-thumbnail". That means, whatever I change the screen size, button's height and width will change accordingly.
Please help me.
It's a bit messy, but are you looking for something like this?
HTML:
<div class="button-panel">
<div class="row button-row">
<div class="col-xs-3 button-container">
<input type="button" class="btn btn-primary btn-responsive" value="Button 1">
</div>
<div class="col-xs-3 button-container">
<input type="button" class="btn btn-primary btn-responsive" value="Button 2">
</div>
<div class="col-xs-3 button-container">
<input type="button" class="btn btn-primary btn-responsive" value="Button 3">
</div>
<div class="col-xs-3 button-container">
<input type="button" class="btn btn-primary btn-responsive" value="Button 4">
</div>
</div>
<div class="row button-row">
<div class="col-xs-3 button-container">
<input type="button" class="btn btn-primary btn-responsive" value="Button 5">
</div>
<div class="col-xs-3 button-container">
<input type="button" class="btn btn-primary btn-responsive" value="Button 6">
</div>
<div class="col-xs-3 button-container">
<input type="button" class="btn btn-primary btn-responsive" value="Button 7">
</div>
<div class="col-xs-3 button-container">
<input type="button" class="btn btn-primary btn-responsive" value="Button 8">
</div>
</div>
<div class="row button-row">
<div class="col-xs-3 button-container">
<input type="button" class="btn btn-primary btn-responsive" value="Button 9">
</div>
<div class="col-xs-3 button-container">
<input type="button" class="btn btn-primary btn-responsive" value="Button 10">
</div>
<div class="col-xs-3 button-container">
<input type="button" class="btn btn-primary btn-responsive" value="Button 11">
</div>
<div class="col-xs-3 button-container">
<input type="button" class="btn btn-primary btn-responsive" value="Button 12">
</div>
</div>
</div>
CSS:
.button-panel {
height: 100vh;
}
.button-row {
height: calc(100% / 3);
}
.button-container {
padding: 0;
height: 100%;
}
.btn-responsive {
width: 100%;
height: 100%;
}
Bootply

Why can't I align content inside bootstrap column?

I've set relative position for my row and then I tried to align my social buttons to the bottom right corner but failed ;(
I've also set absolute position for my social buttons class and it doesn't seem to align properly. Why is this so?
JsFiddle
HTML
<div class="container">
<div class="jumbotron">
<div class="row fixed-height">
<div class="col-xs-4">
<button class="btn btn-primary btn-sm">
<span class="glyphicon glyphicon-ok"></span>
Some button!
</button>
</div>
<div class="col-xs-8">
<div class="social-buttons">
<div class="btn-group-xs">
<button class="btn btn-default">
<span class="glyphicon glyphicon-thumbs-up"></span>
</button>
<button class="btn btn-default">
<span class="glyphicon glyphicon-thumbs-down"></span>
</button>
</div>
</div>
</div>
</div>
</div>
</div>
CSS
.jumbotron {
margin: 10px;
}
.row {
margin: 8px 0;
border: solid;
}
.fixed-height {
height: 100%;
}
.social-buttons{
position: absolute;
bottom: 0;
right: 0;
}
Here is a possible solution:http://jsfiddle.net/cpveg8Lo/5/
CSS
Add position as relative in row css
.row {
margin: 2px 0;
border: solid;
position: relative;
}
and make the following change in social button css
.social-buttons{
position:absolute;
right: 0;
padding-right:0px;
bottom:0;
}
HTML
Update your html as shown below,
<div class="container">
<div class="jumbotron">
<div class="row fixed-height">
<div class="col-xs-4">
<button class="btn btn-primary btn-sm">
<span class="glyphicon glyphicon-ok"></span>
Some button!
</button>
</div>
<div class="col-xs-8 social-buttons">
<div class="pull-right">
<div class="btn-group-xs">
<button class="btn btn-default">
<span class="glyphicon glyphicon-thumbs-up"></span>
</button>
<button class="btn btn-default">
<span class="glyphicon glyphicon-thumbs-down"></span>
</button>
</div>
</div>
</div>
</div>
</div>
</div>
Here check this snippet. This will keep those button vertically centered as well. Try this -
.jumbotron {
margin: 10px;
}
.row {
margin-top: 8px;
margin-bottom: 8px;
border: solid;
}
.fixed-height {
height: 100%;
position:relative;
}
.social-buttons{
position:absolute;
right:15px;
top: 50%;
-moz-transform: translatey(-50%);
-ms-transform: translatey(-50%);
-o-transform: translatey(-50%);
-webkit-transform: translatey(-50%);
transform: translatey(-50%);
}
<link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap.min.css" rel="stylesheet"/>
<div class="container">
<div class="jumbotron">
<div class="row fixed-height">
<div class="col-xs-4">
<button class="btn btn-primary btn-sm">
<span class="glyphicon glyphicon-ok"></span>
Some button!
</button>
</div>
<div class="social-buttons">
<div class="btn-group-xs">
<button class="btn btn-default">
<span class="glyphicon glyphicon-thumbs-up"></span>
</button>
<button class="btn btn-default">
<span class="glyphicon glyphicon-thumbs-down"></span>
</button>
</div>
</div>
</div>
</div>
</div>

Resources