Align rotated div to right side - html

I am working on a code where I have to make my buttons in vertical and to right side of image, which was placed horizontally on top of image before
My piece of code is :
<div style="display: flex; width:100%; height: 100%;">
<div class="thumbnailSelector" *ngIf="seriesList.length > 1" style="margin-right: 5px;">
<div class="thumbnails list-group" style="height: 100%;">
<a *ngFor="let series of seriesList; let i=index" [ngClass]="{'active': currentSeriesIndex === i}"
class="list-group-item" oncontextmenu="return false" unselectable="on" onselectstart="return false;"
onmousedown="return false;" (click)="showSeries(i)">
<div thumbnail [imageData]="series.imageList[0]" class="csthumbnail" oncontextmenu="return false"
unselectable="on" onselectstart="return false;" onmousedown="return false;">
</div>
</a>
</div>
</div>
<!--container where image will be loaded-->
<div style=" width: 100%; height: 100%;">
<div style="width: 80%; height: calc(100% - 60px);position:relative;display:inline-block;color:white;"
oncontextmenu="return false" class='cornerstone-enabled-image' unselectable='on'
onselectstart='return false;' onmousedown='return false;'>
<div cornerstone
style="width: 100%; height: 100%;top:0px;left:0px;position:absolute;outline:none;margin: 0 auto;"
id="dicomImage">
</div>
{{viewPort.zoomValue | async}}
</div>
<!-- Toolbar in RS -->
<div>
<div class="btn-group" style="transform: rotateZ(90deg);">
<div class="btn-group" *ngIf="enableViewerTools">
<!-- Invert -->
<button type="button" (click)="invertImage()" class="btn btn-sm"
style="font-size: 24pt; color:white;" data-container='body' data-toggle="tooltip"
data-placement="bottom" title="Invert"><span class="fa fa-adjust"></span></button>
<!-- Zoom -->
<button type=" button" (click)="enableZoom()" class="btn btn-sm"
style="font-size: 24pt; color:white;" data-container='body' data-toggle="tooltip"
data-placement="bottom" title="Zoom"><span class="fa fa-search"></span></button>
<!-- Pan -->
<button type="button" (click)="enablePan()" class="btn btn-sm" style="font-size: 24pt; color:white;"
data-container='body' data-toggle="tooltip" data-placement="bottom" title="Pan"><span
class="fa fa-arrows-alt"></span></button>
<!-- Length measurement -->
<button type="button" (click)="enableLength()" class="btn btn-sm"
style="font-size: 24pt; color:white;" data-container='body' data-toggle="tooltip"
data-placement="bottom" title="Length"><span class="fa fa-arrows-alt-v"></span></button>
<!-- Angle measurement -->
<button type="button" (click)="enableAngle()" class="btn btn-sm"
style="font-size: 24pt; color:white;" data-container='body' data-toggle="tooltip"
data-placement="bottom" title="Angle"><span class="fa fa-angle-left"></span></button>
<!-- Pixel probe -->
<button type="button" (click)="enableProbe()" class="btn btn-sm"
style="font-size: 24pt; color:white;" data-container='body' data-toggle="tooltip"
data-placement="bottom" title="Pixel Probe"><span class="fa fa-dot-circle"></span></button>
<!-- Elliptical ROI -->
<button type="button" (click)="enableElliptical()" class="btn btn-sm"
style="font-size: 24pt; color:white;" data-container='body' data-toggle="tooltip"
data-placement="bottom" title="Elliptical ROI"><span class="fa fa-circle"></span></button>
<!-- Rectangle ROI -->
<button type="button" (click)="enableRectangle()" class="btn btn-sm"
style="font-size: 24pt; color:white;" data-container='body' data-toggle="tooltip"
data-placement="bottom" title="Rectangle ROI"><span class="fa fa-square"></span></button>
<!-- Reset Image -->
<button type="button" (click)="resetImage()" class="btn btn-sm"
style="font-size: 24pt; color:white;" data-container='body' data-toggle="tooltip"
data-placement="bottom" title="Reset Image"><span class="fa fa-window-restore"></span></button>
</div>
</div>
</div>
</div>
Now it looks like :
https://imgur.com/a/mxp0uPa
What I want my image to look like is : https://imgur.com/a/KM6UHh4
I am using angular so pardon me for the data binding, in case I am missing anything let me know.

You may take a look at writing-mode.
basic example with flex and writing-mode:
.button-sideway {
writing-mode: vertical-rl;
}
/* flex layout used */
.flex {
display: flex;
height: 100%;
}
figure {
margin: auto;
}
.button-sideway {
margin: 1em 1em 0 auto;
}
/* demo*/
img {
max-height: 70vh;
}
body {
margin: 0;
padding: 0;
height: 100vh;
box-sizing: border-box
}
<div class="flex">
<figure>
<img src="http://dummyimage.com/400">
<figcaption>
<!-- description-->
</figcaption>
</figure>
<nav class="button-sideway">
<button>btn</button>
<button>btn</button>
<button>btn</button>
<button>btn</button>
</nav>
</div>
if it is not about rotating the container, but stacking icon, drop the wrtiting-mode and make your buttons block so they stack on top of each others.

Related

how to make button response in bootstrap

I have a row of buttons in the bootstrap HTML website when I open it in desktop view it works perfectly, but in mobile view, it is a mess.
here is my code :
<div class="creative ">
<div class="container" style=" padding-top: 50px">
<div class="card mt-3" style=" background-color: rgba(255,255,255,.6);">
<div class="mt-1 card-body" id="artical">
{# <h4>El Gouna</h4>#}
<a class="btn btn-primary warn" href="#about">
<span>Divecenter</span>
</a>
<a class="btn btn-primary warn" href="#about">
<span>Hotels</span>
</a>
<a class="btn btn-primary warn" href="{% url 'price_list' %}">
<span>Price & Booking</span>
</a>
<a class="btn btn-primary warn" href="#contact">
<span>Book Hotel</span>
............
You can use block buttons on small devices and use flexbox on larger screens like this.
.wrap {
border: 1px solid black;
max-width: 500px;
padding: 10px;
}
<link href="https://cdn.jsdelivr.net/npm/bootstrap#5.2.0/dist/css/bootstrap.min.css" rel="stylesheet"/>
<div class="wrap d-grid gap-2 d-md-flex">
<button class="btn btn-primary flex-md-fill">
Button
</button>
<button class="btn btn-primary flex-md-fill">
Button
</button>
<button class="btn btn-primary flex-md-fill">
Button
</button>
</div>

How to make a button with an icon on the side bootstrap

The question is simple, i have a button:
<button class="btn btn-warning" style="width: 20%; color: white">
<i class="fa fa-plus-circle">
<h5>
<strong>Añadir sucursal</strong>
</h5>
</i>
</button>
From this:
To something like this:
How can i do that?
Thanks!
try this
<button class="btn btn-warning" style="width: 20%; color: white">
<h5><strong>Añadir sucursal</strong> <i class="fa fa-plus-circle"></h5>
</button>
The button text is below the icon because it is in an <h5> tag, and the <h5> is a block element.
If you want to use the styling of <h5> but keep it on the same line, add the d-inline class to the h5 tag, which will change it into an inline element:
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap#4.6.0/dist/css/bootstrap.css">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.2/css/fontawesome.min.css">
<body class="p-4">
<p>Original button with <h5></p>
<button class="btn btn-warning" style="width: 20%; color: white">
<i class="fa fa-plus-circle">
<h5>
<strong>Añadir sucursal</strong>
</h5>
</i>
</button>
<p class="mt-4">Button with <h5 class="d-inline">:</p>
<button class="btn btn-warning" style="width: 13rem; color: white">
<i class="fa fa-plus-circle">
<h5 class="d-inline">
<strong>Añadir sucursal</strong>
</h5>
</i>
</button>
</body>

Boxes cannot be sorted when using sortable()

I would like to switch the left box with the right box. I am using the function sortable() from jQuery UI. As you see in my code, it works fine for the numbers of 1 and 2 but not for the boxes to switch them left and right.
$(".sort-me").sortable({
connectWith: ".connectedSortable"
});
.title {
background: red;
}
.storename {
background: blue;
}
.row {
margin-top: 1rem;
margin-bottom: 1rem;
}
/* metatag generator relevant */
.mg-item {
display: inline-block;
}
.mg-item-inner {
display: flex;
}
.mg-item-inner .btn-group .btn .name {
margin-right: 1rem;
}
.mg-item-inner>.btn-group:not(.collapsed)>.btn:first-child {
cursor: -webkit-grab;
cursor: grab;
}
.mg-item-inner .input-group-btn:only-child>.btn {
border-radius: 4px;
}
.mg-item-inner>.btn-group,
.mg-item-inner>.input-group {
box-shadow: 0px 0px 1px rgba(0, 0, 0, 0.04), 0px 2px 6px rgba(0, 0, 0, 0.04), 0px 10px 20px rgba(0, 0, 0, 0.04);
}
.mg-item-inner>.btn-group+.input-group,
.mg-item-inner>.input-group+.input-group,
.mg-item-inner>.btn-group+.btn-group,
.mg-item-inner>.input-group+.btn-group {
margin-left: -1px;
}
.mg-item span.add {
background: transparent;
color: #444;
padding-left: 0;
margin-left: 0;
}
.mg-item span.add:active {
box-shadow: unset;
color: #313131;
}
.mg-item span.add .fa-plus-circle {
opacity: 0;
}
.mg-item:hover span.add .fa-plus-circle {
opacity: 1;
}
/*# sourceMappingURL=mg.css.map */
<link href="https://stackpath.bootstrapcdn.com/bootstrap/3.4.1/css/bootstrap.min.css" rel="stylesheet" />
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<script src="https://code.jquery.com/ui/1.12.1/jquery-ui.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.14.0/js/all.min.js"></script>
<div class="container">
<!-- Title -->
<div class="row">
<div draggable="true" class="sort-me title connectedSortable">
<div class="col-md-3">
<div class="mg-item-inner">
<div class="btn-group" role="group">
<button type="button" class="btn btn-default" data-toggle="tooltip" data-placement="bottom" data-container='body' title='Gibt den Seitentitel aus'>
<span class="name">TITLE</span><i class="fas fa-arrows-alt"></i></button>
<button type="button" class="btn btn-default" data-toggle="tooltip" data-placement="bottom" data-container='body' title="Linie Erweitern / Reduzieren">
<i class="fas fa-swatchbook"></i></button>
</div>
<!-- /btn-group -->
<div class="input-group" role="group">
<div class="input-group-btn">
<button type="button" class="btn btn-default dropdown-toggle" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">prefix <i class="fas fa-sort"></i></button>
<ul class="dropdown-menu">
<li>prefix</li>
<li>suffix</li>
<li>none</li>
</ul>
</div>
<!-- /input-btn-group -->
<input type="text" class="form-control">
</div>
<!-- /input-group --><span type="button" class="btn add"><i class="fas fa-plus-circle"></i></span>
</div>
<!-- /mg-item-inner -->
</div>
<!-- /mg-item -->
</div>
<!--STORE NANE -->
<div draggable="true" class="sort-me storename connectedSortable">
<div class="col-md-3">
<div class="mg-item-inner">
<div class="btn-group" role="group">
<button type="button" class="btn btn-default" data-toggle="tooltip" data-placement="bottom" data-container='body' title='Fügt den Storename hinzu'>
<span class="name">STORENAME</span><i class="fas fa-arrows-alt"></i></button>
<button type="button" class="btn btn-default" data-toggle="tooltip" data-placement="bottom" title="Linie Erweitern / Reduzieren">
<i class="fas fa-swatchbook"></i></button>
</div>
<!-- /btn-group -->
<div class="input-group" role="group">
<div class="input-group-btn">
<button type="button" class="btn btn-default dropdown-toggle" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">prefix <i class="fas fa-sort"></i></button>
<ul class="dropdown-menu">
<li>prefix</li>
<li>suffix</li>
<li>none</li>
</ul>
</div>
<!-- /input-btn-group -->
<input type="text" class="form-control">
</div>
<!-- /input-group --><span type="button" class="btn add"><i class="fas fa-plus-circle"></i></span>
</div>
<!-- /mg-item-inner -->
</div>
<!-- /mg-item -->
</div>
</div>
</div>
<div class="sort-me">
<div class="connectedSortable">
<h1>
1
</h1>
</div>
<div class="connectedSortable">
<H1>2</H1>
</div>
</div>
https://jsfiddle.net/mjc9as5L/
What is the reason that the boxes can not be sorted? Is there a CSS issue maybe?
Try to add flex to your row, it might solve your problem.
.container > .row{
display:flex;
flex-direction:row-reverse;
justify-content:start;
}

HTML Displaying value of a <div> as suffixed text in another <div> in HTML

I am trying to merge and display Text with value from another <div> as modal-header but its not happening correctly. On giving a id to modal-header, the *×* symbol is dropped.
I have a modal-header like this:-
<div class="modal-header" style="padding-top: 5px;padding-bottom: 5px;">
<div style="text-align: center; float:center;font-weight: bold;">
Summary -
<?php echo '<script> return $("#show_finyear").html();</script>'; ?>
<button class="close" type="button" style="border-radius: 40%; margin:0; border-color: blue; float: right; color:white; background-color:black;"
data-toggle="tooltip" data-placement="bottom"
title="Close Dashboard" class="btn btn-block btn-warning"
onclick="dbHide();">×
</button>
</div>
The other from where value is to be copied as follows:-
<div class="container" style="display: none;">
<div id="show_finyear" style="display: none;">2017-18</div>
</div>
YES!!! Got It. Just amended the Code like this
<div style="text-align: center; font-weight: bold;">
Summary <script> document.write($("#show_finyear").html());</script>
<button class="close" type="button" style="border-radius: 40%; margin:0; border-color: blue; float: right; color:white; background-color:black;" data-toggle="tooltip"
data-placement="bottom" title="Close Dashboard" class="btn btn-block btn-warning"
onclick="dbHide();">×
</button>
</div>

how to display products side by side

This is my product template file.
<br>
<div>
<div ng-if="SearchText.length<3" ng-repeat="product in pc.ProductService.Products | filter:FilterExpr:true |orderBy:['SubCategoryName','BrandName'] | groupBy:['BrandName']" >
<h2 ng-show="product.group_by_CHANGED">{{product.BrandName}} </h2>
<div class='box'>
<ng-include src="'commonTemplate.html'"></ng-include>
</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>
Box class is defined like this in CSS:
.box {
margin : 5px;
display : inline-block;
width: 170px;
height: 275px;
background-color: #F5FBEF;
text-align:center;
vertical-align: top;
}
When display my product list look like this:
I want to show products side by side.
Can some one help me how to do that?
EDIT:
After changes suggested by Rachel Gallen, it turn out like this:
I want to display brand name in new line when new brand encounters. rest all looks good.
I put in .ng-repeat:display:inline plus a wrapper
#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;
}
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>JS Bin</title>
</head>
<body>
<div>
<div ng-if="SearchText.length<3" ng-repeat="product in pc.ProductService.Products | filter:FilterExpr:true |orderBy:['SubCategoryName','BrandName'] | groupBy:['BrandName']">
<h2 ng-show="product.group_by_CHANGED">{{product.BrandName}} </h2>
<div id=wrapper>
<div class='box'>
<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>
</div>
<div class='box'>
<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>
</div>
</div>
</div>
</body>
</html>
Add property float:left to box class. If that doesn't work, please provide a demo.
Jsfiddle: http://jsfiddle.net/z9jbhmd4/
You can add float in your css:
.box {
margin : 5px;
display : inline-block;
width: 170px;
height: 275px;
background-color: #F5FBEF;
text-align:center;
vertical-align: top;
float: left;
}
And to keep the height of the container, move <div class="box">...</div> inside container like <div class="box-container">.....</div>
Then, add css:
.box-container:after {
content: " ";
display: block;
height: 0;
clear: both;
}