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>
Related
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>
I'm using Materialize grid but for some reason I'm getting a gap when my grid is on large screens.
I was using Bootstrap and Materialize and realised it was a bad idea to use both, so I removed Bootstrap grid and redid it in Materialize grid.
However I'm not sure if it's to do with changing over to Materialize grid as I had the same problem on Bootstrap grid. I may have messed with script tags and link tags in my header and footer so that may have messed something up.
Please see the screenshot below and my code for HTML, CSS, header, footer.
#store {
padding: 2%;
background-color: #c8def7;
}
.item-name {
margin-top: 4%;
font-size: 1.4rem;
text-align: left;
}
.item-add {
margin: auto;
padding: 10px;
margin-top: 10px;
display: block;
width: 100%;
background-color: #a8323a;
font-family: 'Open Sans', sans-serif;
}
.item {
margin-top: 4%;
font-family: 'Baloo Tammudu 2', cursive;
padding: 15px;
border-radius: 15px;
}
.price {
color: red;
text-align: center;
float: right;
font-size: 1.4rem;
}
.item-details {
margin-top: 4%;
text-align: center;
}
.item-pic {
width: 100%;
position: relative;
left: 50%;
transform: translateX(-50%);
}
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<link rel="stylesheet" href="/css/styles.css">
<!-- Materialize -->
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/materialize/1.0.0/js/materialize.min.js"></script>
<script type="text/javascript" src="index.js"></script>
<!-- Font Awesome -->
<script defer src="https://use.fontawesome.com/releases/v5.14.0/js/all.js"></script>
<script defer src="https://use.fontawesome.com/releases/v5.14.0/js/v4-shims.js"></script>
<!-- Materialize -->
<link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/materialize/1.0.0/css/materialize.min.css">
<!-- Google Fonts -->
<link href="https://fonts.googleapis.com/css2?family=Pacifico&display=swap" rel="stylesheet">
<link href="https://fonts.googleapis.com/css2?family=Baloo+Tammudu+2:wght#500&display=swap" rel="stylesheet">
<link href="https://fonts.googleapis.com/css2?family=Open+Sans&display=swap" rel="stylesheet">
<link href="https://fonts.googleapis.com/css2?family=Libre+Barcode+128+Text&display=swap" rel="stylesheet">
<title></title>
</head>
<body>
<div class="selling-items">
<div class="row">
<div class="col m4 l3">
<div class="item item-1">
<img class="item-pic item-pic-1" src="images/item-1.jpg" alt="">
<hr />
<div class="item-details">
<span class="item-name">Blue Plaid Shirt</span>
<span class="price">€23.99</span>
<button class="item-add btn btn-lg btn-danger blue darken-4" type="button" name="button">View this item</button>
</div>
</div>
</div>
<div class="col m4 l3">
<div class="item item-2">
<img class="item-pic item-pic-2" src="images/item-2.jpg" alt="">
<hr />
<div class="item-details">
<span class="item-name">Blue Plaid Shirt</span>
<span class="price">€23.99</span>
<button class="item-add btn btn-lg btn-danger blue darken-4" type="button" name="button">View this item</button>
</div>
</div>
</div>
<div class="col m4 l3">
<div class="item item-3">
<img class="item-pic item-pic-3" src="images/item-3.jpg" alt="">
<hr />
<div class="item-details">
<span class="item-name">Blue Plaid Shirt</span>
<span class="price">€23.99</span>
<button class="item-add btn btn-lg btn-danger blue darken-4" type="button" name="button">View this item</button>
</div>
</div>
</div>
<div class="col m4 l3">
<div class="item item-4">
<img class="item-pic item-pic-4" src="images/item-4.jpg" alt="">
<hr />
<div class="item-details">
<span class="item-name">Blue Plaid Shirt</span>
<span class="price">€23.99</span>
<button class="item-add btn btn-lg btn-danger blue darken-4" type="button" name="button">View this item</button>
</div>
</div>
</div>
<div class="col m4 l3">
<div class="item item-5">
<img class="item-pic item-pic-5" src="images/item-5.jpg" alt="">
<hr />
<div class="item-details">
<span class="item-name">Blue Plaid Shirt</span>
<span class="price">€23.99</span>
<button class="item-add btn btn-lg btn-danger blue darken-4" type="button" name="button">View this item</button>
</div>
</div>
</div>
<div class="col m4 l3">
<div class="item item-6">
<img class="item-pic item-pic-6" src="images/item-6.jpg" alt="">
<hr />
<div class="item-details">
<span class="item-name">Blue Plaid Shirt</span>
<span class="price">€23.99</span>
<button class="item-add btn btn-lg btn-danger blue darken-4" type="button" name="button">View this item</button>
</div>
</div>
</div>
<div class="col m4 l3">
<div class="item item-7">
<img class="item-pic item-pic-7" src="images/item-7.jpg" alt="">
<hr />
<div class="item-details">
<span class="item-name">Blue Plaid Shirt</span>
<span class="price">€23.99</span>
<button class="item-add btn btn-lg btn-danger blue darken-4" type="button" name="button">View this item</button>
</div>
</div>
</div>
<div class="col m4 l3">
<div class="item item-8">
<img class="item-pic item-pic-8" src="images/item-8.jpg" alt="">
<hr />
<div class="item-details">
<span class="item-name">Blue Plaid Shirt</span>
<span class="price">€23.99</span>
<button class="item-add btn btn-lg btn-danger blue darken-4" type="button" name="button">View this item</button>
</div>
</div>
</div>
</div>
</div>
</body>
This case needs to standardize the height of the image elements
solution:
edit height of images on photos editor like as photoshop, paint
===================== OR ======================
css:
.item-pic {height: 20vw}
===================== OR ======================
js:
let _height = 0;
$('.item-pic').each(function () {
if ($(this).height() > _height) {
_height = $(this).height();
}
});
$('.item-pic').height(_height);
example: https://codepen.io/Em-An/pen/ExKLZNG
I don't find any fault in the html codes nor the style and even the document i made from this same codes shows proper results that you might be expecting. Try adding browser support and updating your browser.
Or try putting the BR tag after desired products.
I have some buttons on a row, two aligned on the left and one aligned on the right as follows:
html {
position: relative;
min-height: 100%;
}
body {
/* Margin bottom by footer height */
margin-bottom: 60px;
}
.footer {
position: absolute;
bottom: 0;
width: 100%;
/* Set the fixed height of the footer here */
height: 60px;
/* Vertically center the text there */
line-height: 60px;
background-color: #f5f5f5;
}
.fa-arrows-alt {
color: rgb(231, 81, 37);
cursor: pointer;
}
<script src="https://use.fontawesome.com/23ac9aaa92.js"></script>
<link href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/css/bootstrap.min.css" rel="stylesheet" />
<div class="container-fluid">
<div class="row">
<div class="col-12 col-md-12">
A div here
</div>
<div class="col-12 col-md-12">
<button type="button" class="btn btn-outline-dark btn-sm">Edit</button>
<button type="button" class="btn btn-outline-dark btn-sm">Delete</button>
<i class="fa fa-arrows-alt fa-2x float-right"></i>
</div>
</div>
</div>
<footer class="footer">
<div class="container">
<span class="text-muted">Place sticky footer content here.</span>
</div>
</footer>
I would like the buttons to force them to be always on the bottom of the div, above the footer. I tried using bottom: 0 and position absolute, fixed but I received an unexpected result. Any suggestions are welcome.
use bootstrap 4 position-absolute predefined class and add bottom:0
.position-absolute {
bottom: 0;
}
<link href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/css/bootstrap.min.css" rel="stylesheet" />
<div class="container-fluid position-absolute">
<div class="row">
<div class="col-12 col-md-12 btn-row">
<button type="button" class="btn btn-outline-dark btn-sm">Edit</button>
<button type="button" class="btn btn-outline-dark btn-sm">Delete</button>
<button type="button" class="btn btn-outline-dark btn-sm float-right">Full Screen</button>
</div>
</div>
</div>
Use the flexbox classes that are built in to Bootstrap. You just need CSS to make sure the body is display:flex and full height...
https://www.codeply.com/go/lEaF85K1KU
CSS
body {
height:100vh;
display: flex;
flex-direction: column;
}
.flex-fill {
flex: 1 1 auto;
}
HTML
<main class="container-fluid d-flex flex-column flex-fill">
<div class="row flex-column flex-fill">
<div class="col-12 flex-fill">
A div here
</div>
<div class="col-12">
<button type="button" class="btn btn-outline-dark btn-sm">Edit</button>
<button type="button" class="btn btn-outline-dark btn-sm">Delete</button>
<i class="fa fa-arrows-alt fa-2x float-right"></i>
</div>
</div>
</main>
<footer class="container-fluid bg-light py-3">
Sticky Footer
</footer>
Note: The flex-fill utility class will be included in the next Bootstrap 4.1 release. So after that release the extra CSS for flex-fill won't be needed.
To get something to stick to the bottom of the screen, do
<footer class="fixed-bottom">
To get buttons to go left and right give each button a class of “pull-left” or “pull-right”
Hi I have 4 buttons in a row. Button CSS is coming fine in IE11,Chrome and Safari and all other browser except IE10. Here is my code
Hi I have 4 buttons in a row. Button CSS is coming fine in IE11,Chrome and Safari and all other browser except IE10. Here is my code
My HTML
{{actionBarTitle}}
</div>
<div class="action-line col-xs-10 col-md-10 col-sm-10 abc">
<!-- Edit button -->
<div>
<button class="btn btn-large deactivate-btn-large" title="{{::'title.edit' | translate}}" ng-click="showEditUserPanel()" title="" ng-disabled="!actionButtonStatus.EDIT">
<i class="fa fa-pencil-square-o fa-lg"></i>
<span class="action-button-text">{{::'button.edit' | translate}}</span>
</button>
</div>
<div>
<button class="btn btn-large deactivate-btn-large" title="{{::'title.assign.roles' | translate}}" ng-click="showAssignRolesPanel()" title="" ng-disabled="!actionButtonStatus.ASSIGN">
<i class="fa fa-user-secret fa-lg"></i>
<span class="action-button-text">{{::'button.assign' | translate}}</span>
</button>
</div>
<div class="active-send-select" pull-left btn-group>
<button class="btn btn-large dropdown-toggle" data-toggle="dropdown" title="{{::'title.send' | translate}}" ng-disabled="!actionButtonStatus.SENT">
<i class="fa fa-envelope fa-lg"></i>
<span class="action-button-text">{{::'label.button.send' | translate}}</span>
<i class="icon-chevron-down pull-right" style="margin-top:-20px;"></i>
</button>
<ul class="dropdown-menu filter-state dropdown" ng-show="!user.isPeUser">
<li><span class="{{userstatus == 'Complete'? 'resettest': ''}}">{{::'label.dropdown.sendActivation' | translate}}</span></li>
<li>
<span class="{{(userstatus == 'Notified' || userstatus == 'Added')? 'resettest': '' }}">{{::'label.dropdown.resetPassword' | translate}}</span>
</li>
</ul>
<ul class="dropdown-menu filter-state dropdown" ng-show="user.isPeUser">
<li>
{{::'label.send.welcomeEmail' | translate}}
</li>
</ul>
</div>
<div class="action-bar-item" >
<button class="btn btn-large deactivate-btn-large" ng-click="changeUserState()" title={{title}} ng-disabled="!actionButtonStatus.ENABLE">
<i class="fa fa-power-off fa-lg"></i>
<span class="action-button-text">{{getEnableButtonLabel()}}</span>
</button>
</div>
</div>
</div>
<div class="panel-title">
<span>{{panelTitle}}</span>
</div>
</div>
</div>
<div class="row inner-row full-panel" ng-include="'script/item-full-panel/user-select-panel.html'" ng-if="panelSelector.USER_SELECT"></div>
<div class="row inner-row full-panel" ng-include="'script/item-full-panel/user-add-panel.html'" ng-if="panelSelector.USER_ADD"></div>
<div class="row inner-row full-panel" ng-include="'script/item-full-panel/user-edit-panel.html'" ng-if="panelSelector.USER_EDIT"></div>
<div class="row inner-row full-panel" ng-include="'script/item-full-panel/user-detail-panel.html'" ng-if="panelSelector.USER_DETAILS"></div>
<div class="row inner-row full-panel" ng-include="'script/item-full-panel/user-import-panel.html'" ng-if="panelSelector.USER_IMPORT"></div>
<div class="row inner-row full-panel" ng-include="'script/item-full-panel/user-state-change-panel.html'" ng-if="panelSelector.USER_STATE_CHANGE"></div>
<div class="row inner-row full-panel" ng-include="'script/item-full-panel/password-reset-panel.html'" ng-if="panelSelector.USER_PASSWORD_RESET"></div>
<div class="row inner-row full-panel" ng-include="'script/item-full-panel/user-activation-panel.html'" ng-if="panelSelector.USER_ACTIVATE"></div>
<div class="row inner-row full-panel" ng-include="'script/item-full-panel/welcome-email-panel.html'" ng-if="panelSelector.USER_WELCOME_EMAIL"></div>
<div class="row inner-row full-panel" ng-include="'script/assign-roles-panel/assign-roles-panel.html'" ng-if="panelSelector.ASSIGN_ROLES"></div>
<!-- access denied template -->
<div class="row inner-row full-panel" ng-if="panelSelector.ACCESS_DENIED">
<div class="row scrowable" ge-scroll-port>
<div class="access-denied-msg">
Access Denied
</div>
</div>
</div>
</div>
My CSS
.deactivate-btn-large {
width: 90px;
margin-left: 10px;
margin-bottom: 10px;
height: 34px;
border: 1px solid #grayLight;
border-radius: 4px 4px 4px 4px;
margin-right: 10px;
}
.action-button-text {
display: inline-block;
}
.active-send-select {
white-space: nowrap;
width: 90px;
button.btn {
width: 90px;
height: 34px;
padding: 5px 5px;
border-radius: 4px 4px 4px 4px;
margin-left: 10px;
text-align: left;
i {
padding: 5px 0 0 5px;
}
}
.dropdown {
margin-top: -5px;
margin-left: 225px;
}
.active-filter-option {
color: #black;
}
}
.dropdown {
margin-top: -5px;
margin-left: 225px;
}
[This is coming correct][1]
[In IE 10 it is coming like that][2]
[1]: https://i.stack.imgur.com/HWjN2.png
[2]: https://i.stack.imgur.com/CO3BZ.png
Where I am doing wrong. Please let me know. Thanks in advance.
Try using prefixfree, this will help you to put the right prefix for css properties that needs specific prefix for a specific borwser. Just load the js file in the head tag
This is my css and HTML template file.
#wrapper {
display: inline!important;
height: 275px;
max-width: 540px;
}
.box {
margin: 5px;
display: inline-block;
width: 170px;
height: 275px!important;
background-color: #F5FBEF;
text-align: center;
float: left;
}
.ng-repeat {
display: inline-block;
}
HTML File
<br>
<div>
<div ng-if="SearchText.length<3" ng-repeat="product in pc.ProductService.Products | filter:FilterExpr:true |orderBy:['SubCategoryName','BrandName'] | groupBy:['BrandName']" >
<div ng-show="product.group_by_CHANGED"><h2>{{product.BrandName}} </h2></div>
<div id=wrapper>
<div class='box'>
<ng-include src="'commonTemplate.html'"></ng-include>
</div>
</div>
</div>
<!-- template (common piece of code) -->
<script type="text/ng-template" id="commonTemplate.html">
<div class="BrandName"> <b>{{product.BrandName}}</b> </div>
<div class="ProductName"> {{product.ProductName}} </div>
<br>
<div> <img src="http://localhost/{{ product.ProductImagePath }}" alt="" border=3 height=75 width=75></img> </div>
<div class="ProductVariants">
<select class="form-control btn btn-default btn-xs text-center" ng-init="SelectedVariant = product.Variants[0]" ng-model="SelectedVariant" ng-options="variant.VariantName for variant in product.Variants" ng-change="ChangeVariant(product.ProductID, SelectedVariant.VariantID)"></select>
</div>
<div class="Price">
<strike> {{SelectedVariant.MRP}} </strike> {{SelectedVariant.SellPrice}}
</div>
<div class="AddToCart" ng-if="SelectedVariant.InCart==0">
<a class="btn btn-success btn-sm" ng-click="pc.AddToCart(product.ProductID, SelectedVariant.VariantID)">Add to Cart
<span class="glyphicon glyphicon-plus"></span>
</a>
</div>
<div class="AddToCart" ng-if="SelectedVariant.InCart>0">
<a class="btn btn-default btn-xs" ng-click="pc.PlusItem(product.ProductID, SelectedVariant.VariantID)">
<span class="glyphicon glyphicon-plus"></span>
</a>
<button type="button" class="btn btn-sm btn-info disabled">{{SelectedVariant.InCart}} in cart</button>
<a class="btn btn-default btn-xs" ng-click="pc.MinusItem(product.ProductID, SelectedVariant.VariantID)">
<span class="glyphicon glyphicon-minus"></span>
</a>
</div>
</script>
</div>
This is how my page looks like-
What i want when new brand comes say annapurna or panchratan, display that in new line. and then in next line display all the products of that brand.
(similar to aashirvad first brand.)
How to do that?
You have to wrap whole template with outer div that is full width:
<script type="text/ng-template" id="commonTemplate.html">
<div class="brand-wrapper">
<div class="BrandName"> <b>{{product.BrandName}}</b> </div>
...
</div>
</script>
// May be omitted as div already block element.
.brand-wrapper {
clear: both; // if floated
width: 100%;
display: block;
}
Change wrapper:inline to inline-block and it should work. Also put your h2 inside the wrapper.
Also, change the float on the box to float:right;