Input field full width on bootstrap 4.0.0 not working - html

I have some problem on Bootstrap 4.0.0 for input field full width across the column col-md-6
Here is my code. I just try to fix full width !
<link href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/css/bootstrap.min.css" rel="stylesheet" />
<div class="row">
<div class="col-md-6 col-sm-6">
<div class="socialMedia d-flex">
<span><img src="https://i.imgur.com/tyO9m6X.png" alt=""></span>
<span>
<input type="text" class="form-control">
</span>
</div>
<div class="socialMedia d-flex">
<span><img src="https://i.imgur.com/tyO9m6X.png" alt=""></span>
<span>
<input type="text" class="form-control">
</span>
</div>
<div class="socialMedia d-flex">
<span><img src="https://i.imgur.com/tyO9m6X.png" alt=""></span>
<span>
<input type="text" class="form-control">
</span>
</div>
<div class="socialMedia d-flex">
<span><img src="https://i.imgur.com/tyO9m6X.png" alt=""></span>
<span>
<input type="text" class="form-control">
</span>
</div>
</div>
<div class="col-md-6 col-sm-6">
<div class="socialMedia d-flex">
<span><img src="https://i.imgur.com/tyO9m6X.png" alt=""></span>
<span>
<input type="text" class="form-control">
</span>
</div>
<div class="socialMedia d-flex">
<span><img src="https://i.imgur.com/tyO9m6X.png" alt=""></span>
<span>
<input type="text" class="form-control">
</span>
</div>
<div class="socialMedia d-flex">
<span><img src="https://i.imgur.com/tyO9m6X.png" alt=""></span>
<span>
<input type="text" class="form-control">
</span>
</div>
<div class="socialMedia d-flex">
<span><img src="https://i.imgur.com/tyO9m6X.png" alt=""></span>
<span>
<input type="text" class="form-control">
</span>
</div>
</div>
</div>
Here is the expected output ! If any markup suggestion for following output, please help me
Thanks in advance

Basically, you have two span elements inside each col-6. one of them should have a fixed size, and the other one (containing the input) should fill the rest of the space
Basically, I used flex to do that. socialMedia was used to make the parent element use the flex box model.
kb-icon was set to not grow or shrink, while kb-input was set to grow, meaning it will take up the rest of the space for each col-6 item
I also changed the spans into divs since (at least with the input) you want the item to have a specific size that is not based on the content of the element. The same could have been achieved by adding display: inline-block or display: block.
.socialMedia {
display: flex;
padding: 2px 0;
}
.kb-icon {
flex-grow: 0;
flex-shrink: 0;
margin: 0 5px;
/* just to make the icon centered */
display: flex;
align-items: center;
justify-content: center;
}
/* this item will act as a pseudo input element
we do that because we can't put a button inside
an actual input */
.kb-input {
flex-grow: 1;
/* I use flex to make the input as
large as possible without setting sized myself */
display: flex;
margin-right: 5px;
/* just to make it look better on small screens */
border: 1px solid grey;
/* imitate the input look */
}
/* this is used to create a focus effect on the fake input. if we use focus and not focus-within, nothing will happen. I use the same method bootstrap uses here */
.kb-input:focus-within {
outline: 0;
box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, .25);
}
.kb-input input {
/* remove the input style to make it "transparent" */
border: 0;
border-radius: 0;
/* this is used to make sure it takes up the entire space */
flex-grow: 1;
}
/* make sure input does not have style on focus */
.kb-input input:focus {
outline: none;
box-shadow: none;
}
/* make the button transparent */
button.kb-close {
border: 0;
background: none;
display: flex;
align-items: center;
justify-content: center;
cursor: pointer;
}
<link href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/css/bootstrap.min.css" rel="stylesheet" />
<link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet">
<div class="row">
<div class="col-md-6 col-sm-6">
<div class="socialMedia d-flex">
<div class="kb-icon"><img src="https://i.imgur.com/tyO9m6X.png" alt=""></div>
<div class="kb-input">
<input type="text" class="form-control ">
<button class="kb-close">
<i class="material-icons">close</i>
</button>
</div>
</div>
<div class="socialMedia d-flex">
<div class="kb-icon"><img src="https://i.imgur.com/tyO9m6X.png" alt=""></div>
<div class="kb-input">
<input type="text" class="form-control ">
<button class="kb-close">
<i class="material-icons">close</i>
</button>
</div>
</div>
<div class="socialMedia d-flex">
<div class="kb-icon"><img src="https://i.imgur.com/tyO9m6X.png" alt=""></div>
<div class="kb-input">
<input type="text" class="form-control ">
<button class="kb-close">
<i class="material-icons">close</i>
</button>
</div>
</div>
<div class="socialMedia d-flex">
<div class="kb-icon"><img src="https://i.imgur.com/tyO9m6X.png" alt=""></div>
<div class="kb-input">
<input type="text" class="form-control ">
<button class="kb-close">
<i class="material-icons">close</i>
</button>
</div>
</div>
</div>
<div class="col-md-6 col-sm-6">
<div class="socialMedia d-flex">
<div class="kb-icon"><img src="https://i.imgur.com/tyO9m6X.png" alt=""></div>
<div class="kb-input">
<input type="text" class="form-control ">
<button class="kb-close">
<i class="material-icons">close</i>
</button>
</div>
</div>
<div class="socialMedia d-flex">
<div class="kb-icon"><img src="https://i.imgur.com/tyO9m6X.png" alt=""></div>
<div class="kb-input">
<input type="text" class="form-control ">
<button class="kb-close">
<i class="material-icons">close</i>
</button>
</div>
</div>
<div class="socialMedia d-flex">
<div class="kb-icon"><img src="https://i.imgur.com/tyO9m6X.png" alt=""></div>
<div class="kb-input">
<input type="text" class="form-control ">
<button class="kb-close">
<i class="material-icons">close</i>
</button>
</div>
</div>
<div class="socialMedia d-flex">
<div class="kb-icon"><img src="https://i.imgur.com/tyO9m6X.png" alt=""></div>
<div class="kb-input">
<input type="text" class="form-control ">
<button class="kb-close">
<i class="material-icons">close</i>
</button>
</div>
</div>
</div>
</div>
I also added some comments in the CSS to explain why I did what I did to add the "clean input" button
basically, .kb-input is used as a pseudo input element (containing the actual input and a button). for more info, check the css.
If you want to remove the outline completely, don't apply the focus-within pseudo class, and make sure you set the following attributes on the element you want to disable it for:
outline: 0;
box-shadow: 0;

You can use the following, using a .form-group
<link href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/css/bootstrap.min.css" rel="stylesheet" />
<div class="row">
<div class="col-md-6 col-sm-6">
<div class="socialMedia form-group row">
<label for="inputEmail3" class="col-1 col-form-label">
<img src="https://i.imgur.com/tyO9m6X.png" alt="">
</label>
<div class="col-sm-10">
<input type="text" class="form-control ">
</div>
</div>
<div class="socialMedia form-group row">
<label for="inputEmail3" class="col-1 col-form-label">
<img src="https://i.imgur.com/tyO9m6X.png" alt="">
</label>
<div class="col-sm-10">
<input type="text" class="form-control ">
</div>
</div>
<div class="socialMedia form-group row">
<label for="inputEmail3" class="col-1 col-form-label">
<img src="https://i.imgur.com/tyO9m6X.png" alt="">
</label>
<div class="col-sm-10">
<input type="text" class="form-control ">
</div>
</div>
<div class="socialMedia form-group row">
<label for="inputEmail3" class="col-1 col-form-label">
<img src="https://i.imgur.com/tyO9m6X.png" alt="">
</label>
<div class="col-sm-10">
<input type="text" class="form-control ">
</div>
</div>
</div>
<div class="col-md-6 col-sm-6">
<div class="socialMedia form-group row">
<label for="inputEmail3" class="col-1 col-form-label">
<img src="https://i.imgur.com/tyO9m6X.png" alt="">
</label>
<div class="col-sm-10">
<input type="text" class="form-control ">
</div>
</div>
<div class="socialMedia form-group row">
<label for="inputEmail3" class="col-1 col-form-label">
<img src="https://i.imgur.com/tyO9m6X.png" alt="">
</label>
<div class="col-sm-10">
<input type="text" class="form-control ">
</div>
</div>
<div class="socialMedia form-group row">
<label for="inputEmail3" class="col-1 col-form-label">
<img src="https://i.imgur.com/tyO9m6X.png" alt="">
</label>
<div class="col-sm-10">
<input type="text" class="form-control ">
</div>
</div>
<div class="socialMedia form-group row">
<label for="inputEmail3" class="col-1 col-form-label">
<img src="https://i.imgur.com/tyO9m6X.png" alt="">
</label>
<div class="col-sm-10">
<input type="text" class="form-control ">
</div>
</div>
</div>
</div>

If you want to center this, read about offsetting:
https://getbootstrap.com/docs/4.0/layout/grid/#offsetting-columns
My proposition:
<link href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/css/bootstrap.min.css" rel="stylesheet" />
<div class="row">
<div class="col-md-3 col-sm-3 offset-sm-3 offset-md-3 col-offset-3">
<div class="socialMedia d-flex">
<span><img src="https://i.imgur.com/tyO9m6X.png" alt=""></span>
<span>
<input type="text" class="form-control ">
</span>
</div>
<div class="socialMedia d-flex">
<span><img src="https://i.imgur.com/tyO9m6X.png" alt=""></span>
<span>
<input type="text" class="form-control">
</span>
</div>
<div class="socialMedia d-flex">
<span><img src="https://i.imgur.com/tyO9m6X.png" alt=""></span>
<span>
<input type="text" class="form-control">
</span>
</div>
<div class="socialMedia d-flex">
<span><img src="https://i.imgur.com/tyO9m6X.png" alt=""></span>
<span>
<input type="text" class="form-control">
</span>
</div>
</div>
<div class="col-md-3 col-sm-3">
<div class="socialMedia d-flex">
<span><img src="https://i.imgur.com/tyO9m6X.png" alt=""></span>
<span>
<input type="text" class="form-control">
</span>
</div>
<div class="socialMedia d-flex">
<span><img src="https://i.imgur.com/tyO9m6X.png" alt=""></span>
<span>
<input type="text" class="form-control">
</span>
</div>
<div class="socialMedia d-flex">
<span><img src="https://i.imgur.com/tyO9m6X.png" alt=""></span>
<span>
<input type="text" class="form-control">
</span>
</div>
<div class="socialMedia d-flex">
<span><img src="https://i.imgur.com/tyO9m6X.png" alt=""></span>
<span>
<input type="text" class="form-control">
</span>
</div>
</div>
</div>

Related

Bootstrap form column alignment

I've created a Bootstrap 4 form with this layout
And the Razor page code to generate it is:
#page
#model HighStreetLeads3.Pages.Leads.EditModel
#{
ViewData["Title"] = "Edit";
Layout = "~/Pages/Shared/_Layout.cshtml";
}
<h1>Edit</h1>
<h4>Lead</h4>
<hr />
<form class="form-inline col-lg-12" method="post">
<div>
<div asp-validation-summary="ModelOnly" class="text-danger"></div>
<input type="hidden" asp-for="Lead.Id" />
</div>
<div class="row col-12">
<div class="col-6">
<div class="form-group">
<div class="col-3">
<label asp-for="Lead.Name" class="control-label float-left">Name</label>
</div>
<div class="col-9">
<input asp-for="Lead.Name" class="form-control mb-2" style="width:100%" />
<span asp-validation-for="Lead.Name" class="text-danger"></span>
</div>
</div>
</div>
<div class="col-6">
<div class="form-group">
<div class="col-3">
<label asp-for="Lead.PhoneNumber" class="control-label float-left">Number</label>
</div>
<div class="col-9">
<input asp-for="Lead.PhoneNumber" class="form-control mb-2" style="width:100%" />
<span asp-validation-for="Lead.PhoneNumber" class="text-danger"></span>
</div>
</div>
</div>
</div>
<div class="row col-12">
<div class="col-6">
<div class="form-group">
<div class="col-3">
<label asp-for="Lead.Status" class="control-label float-left"></label>
</div>
<div class="col-9">
<input asp-for="Lead.Status" class="form-control mb-2" style="width:100%" />
<span asp-validation-for="Lead.Status" class="text-danger"></span>
</div>
</div>
</div>
<div class="col-6">
<div class="form-group">
<div class="col-3">
<label asp-for="Lead.NextAction" class="control-label float-left">Next Action</label>
</div>
<div class="col-9">
<input asp-for="Lead.NextAction" class="form-control mb-2" style="width:100%" />
<span asp-validation-for="Lead.NextAction" class="text-danger"></span>
</div>
</div>
</div>
</div>
<div class="row col-12">
<div class="col-6">
<div class="form-group">
<div class="col-3">
<label asp-for="Lead.WebAddress" class="control-label float-left">URL</label>
</div>
<div class="col-9">
<input asp-for="Lead.WebAddress" class="form-control mb-2" style="width:100%" />
<span asp-validation-for="Lead.WebAddress" class="text-danger"></span>
</div>
</div>
</div>
<div class="col-6">
<div class="form-group">
<div class="col-3">
<label asp-for="Lead.ContactName" class="control-label float-left">Contact</label>
</div>
<div class="col-9">
<input asp-for="Lead.ContactName" class="form-control mb-2" style="width:100%" />
<span asp-validation-for="Lead.ContactName" class="text-danger"></span>
</div>
</div>
</div>
</div>
<div class="row col-12">
<div class="col-6">
<div class="form-group text-left">
<div class="col-3">
<label asp-for="Lead.Where" class="control-label float-left">Address</label>
</div>
<div class="col-9">
<input asp-for="Lead.Where" class="form-control mb-2" style="width:100%" />
<span asp-validation-for="Lead.Where" class="text-danger"></span>
</div>
</div>
</div>
</div>
<div class="row col-12">
<div class="col-12">
<div class="form-group">
<div class="col-1 mr-0 pr-0">
<label asp-for="Lead.Notes" class="control-label col-3 float-left"></label>
</div>
<div class="col-8">
<input asp-for="Lead.Notes" class="form-control mb-2 ml-5" style="width:100%" />
<span asp-validation-for="Lead.Notes" class="text-danger"></span>
</div>
<div class="col-2 ml-5 float-right">
<input type="submit" value="Save" class="btn btn-primary" />
</div>
</div>
</div>
</div>
#*<div class="form-group col-1 offset-11">
<input type="submit" value="Save" class="btn btn-primary" />
</div>*#
I can add the page model in if anyone needs it, but I don't think it's relevant, and the css is the standard bootstrap.
So..... as you can see, the majority of the form is in two columns, but the last field (Notes) takes up more of the screen width. Because of this, I can't get the label or the entry field for Notes to line up with the previous fields. I've tried fiddling about with margins and padding, but I can't get an exact line up. It feels like I need to be able to ask Bootstrap for a width of a fractional column.
Is there a way of getting this last field laid out so it aligns with the previous ones?
Any input gratefully received.
Nick
You use col-3 in <div class="col-6">,so you need to set col-1.5 in <div class="col-12">,but there is no col-1.5,so you can only try to set the css and make it close to col-1.5:
<div class="row col-12">
<div class="col-12">
<div class="form-group">
<div class="col-md-1" style="flex: 0 0 12.15%;max-width: 12.15%;">
<label asp-for="Lead.Notes" class="control-label float-left"></label>
</div>
<div class="col-8">
<input asp-for="Lead.Notes" class="form-control mb-2 ml-5" style="width:100%" />
<span asp-validation-for="Lead.Notes" class="text-danger"></span>
</div>
<div class="col-2 ml-5 float-right">
<input type="submit" value="Save" class="btn btn-primary" />
</div>
</div>
</div>
</div>
result:

Alignment for start date and end date

I have been trying since the morning to correctly align the start date and the end date but without success.
The start and end date do not line up like other blocks.
I do not understand anything...
If you solve my problem, I will be infinitely grateful to you. I really don't understand why the date blocks are not aligned.
<link href="https://cdn.jsdelivr.net/npm/bootstrap#5.1.1/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-F3w7mX95PdgyTmZZMECAngseQB83DfGTowi0iMjiWaeVhAn4FJkqJByhZMI3AhiU" crossorigin="anonymous">
<h1 id="welcome">HTML CSS JS</h1>
<div class="row">
<div class="col-12" *ngIf="currentView == 0">
<div class="card mb-4">
<div class="card-body">
<div class="row">
<div class="col-12 col-lg-4">
<div class="form-group row">
<label for="name" class="col-sm-3 col-form-label">Libellé</label>
<div class="col-12 col-sm-9">
<input id="name" type="text" class="form-control" [(ngModel)]="search.name"
style="background-color: white; max-width: 300px;width: 100%;"
placeholder="Libellé" autofocus>
</div>
</div>
<div class="form-group row">
<label for="ticker" class="col-12 col-sm-3 col-form-label">Bourse</label>
<div class="col-12 col-sm-9">
<input id="ticker" type="text" class="form-control" [(ngModel)]="search.ticker"
style="background-color: white; max-width: 300px;width: 100%;"
placeholder="Bourse" autofocus>
</div>
</div>
</div>
<div class="col-12 col-lg-4">
<div class="form-group row">
<label for="isin" class="col-12 col-sm-3 col-form-label">ISIN</label>
<div class="col-12 col-sm-9">
<input id="isin" type="text" class="form-control" [(ngModel)]="search.isin"
style="background-color: white; max-width: 300px;width: 100%;"
placeholder="ISIN" autofocus>
</div>
</div>
<div class="form-group row">
<label for="filterForMarkets" class="col-12 col-sm-3 col-form-label">Marché</label>
<div class="col-12 col-sm-9">
<select id="filterForMarkets" class="form-control"
style="width:100%; max-width: 300px;"
(change)="filterForMarkets($event.target.value)">
<option value="">--Tous les marchés--</option>
<option *ngFor="let m of markets" value={{m.marketID}}>
{{m.name}}
</option>
</select>
</div>
</div>
</div>
<div class="col-12 col-lg-4">
<div class="form-group" >
<label for="date">Date de départ</label>
<div class="input-group">
<input name="beginDate" id="beginDate" type="text" class="form-control"
style="background-color: white; "
(ngModelChange)="changedBeginDateInput($event)" [(ngModel)]="beginDate">
<input id="picker1" class="form-control" placeholder="dd/mm/yyyy" name="dp1"
ngbDatepicker #dp1="ngbDatepicker" [(ngModel)]="begin.validityDate"
(ngModelChange)="changedBeginDate($event)"
style="position: absolute; left: 0; visibility: hidden">
<div class="input-group-append" (click)="dp1.toggle()">
<span class="input-group-text" id="basic-addon2">
<i class="icon-regular i-Calendar-4"></i>
</span>
</div>
</div>
</div>
</div>
<div class="col-12 col-lg-4">
<div class="form-group" >
<label for="date">Date de fin</label>
<div class="input-group">
<input name="endDate" id="endDate" type="text" class="form-control"
style="background-color: white;"
(ngModelChange)="changedEndDateInput($event)" [(ngModel)]="endDate">
<input id="picker1" class="form-control" placeholder="dd/mm/yyyy" name="dp2"
ngbDatepicker #dp2="ngbDatepicker" [(ngModel)]="end.validityDate"
(ngModelChange)="changedEndDate($event)"
style="position: absolute; left: 0; visibility: hidden">
<div class="input-group-append" (click)="dp2.toggle()">
<span class="input-group-text" id="basic-addon2">
<i class="icon-regular i-Calendar-4"></i>
</span>
</div>
</div>
</div>
</div>
<div class="row">
<div class="col-12 ">
<div class="text-right">
<button type="button" class="btn btn-primary" (click)="launchSearch(modalConfirm)">
Rechercher
</button>
<button type="button" class=" ml-1 btn btn-primary" (click)="getTransactions(0)">
Affichez tous les mouvements
</button>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
Using flex property of CSS will solve your problem, it's very beneficial in aligning things as we want.
Try this:
.form-group {
display: flex;
}
And then you could obviously add margin and other properties for aligning all your items together.

Vertical scroll is not working in my app in angular 10

I have this template from angular 10. The problem is the scrollbar doesn´t work even if I add the css style on the main container overflow: auto;
The HTML and scss codes are as following, as you can see I include the overflow property to the main container "cont", but is not working:
Anyone can help with this? Thank you!
.cont{
overflow: auto;
}
<div class="cont">
<div class="card-body">
<form name="formEmpresa">
<div class="container-background">
<div class="container-fluid">
<div class="form-group">
<div class="row">
<div class="col-sm-6">
<div class="input-group flex-nowrap">
<div class="input-group-prepend">
<span class="input-group-text" id="addon-wrapping"><i class="fa fa-building"></i></span>
</div>
<input type="text" class="form-control" placeholder="J123456789" name="Rif" required>
</div>
</div>
<div class="col-sm-6"></div>
<div class="col-sm-12">
<hr style="border: none">
<div class="input-group flex-nowrap">
<span class="input-group-text" id="addon-wrapping"><i class="fa fa-institution"></i></span>
<input type="text" class="form-control" placeholder="Razón Social" name="Razosoci" required ng-maxlength="150">
</div>
</div>
<div class="col-sm-12">
<hr style="border: none">
<label>Dirección fiscal</label>
<textarea class="form-control" rows="3" placeholder="Entre ..." name="Dir" ng-maxlength="200" required></textarea>
</div>
<div class="col-sm-12">
<hr style="border: none">
<div class="row justify-content-center">
<button class="btn btn-warning" style="width: 20%;">
<i class="fa fa-plus-circle" style="color: white;"></i> <h5 style="color: white;"><strong>Añadir sucursal</strong></h5>
</button>
</div>
</div>
<div class="col-sm-12">
<hr style="border: none">
<div class="card">
<div class="card-header" style="background-color: #ffc107; color: white;">
<strong>Nueva surcursal</strong>
</div>
<div class="card-body">
<div class="row">
<div class="col-sm-12">
<div class="input-group flex-nowrap">
<div class="input-group-prepend">
<span class="input-group-text" id="addon-wrapping"><i class="fa fa-building"></i></span>
</div>
<input type="text" class="form-control" placeholder="Nombre Sucursal" name="sucursal" required>
</div>
</div>
<div class="col-sm-6">
<hr style="border: none">
<div class="input-group flex-nowrap">
<div class="input-group-prepend">
<span class="input-group-text" id="addon-wrapping"><i class="fa fa-phone"></i></span>
</div>
<input type="text" class="form-control" placeholder="Teléfono" name="phone" required>
</div>
</div>
<div class="col-sm-6">
<hr style="border: none">
<div class="input-group flex-nowrap">
<div class="input-group-prepend">
<span class="input-group-text" id="addon-wrapping"><i class="fa fa-qrcode"></i></span>
</div>
<input type="text" class="form-control" placeholder="Código Postal" name="postal_code" required>
</div>
</div>
<div class="col-sm-12">
<hr style="border: none">
<textarea class="form-control" rows="3" placeholder="Dirección" name="Dir" ng-maxlength="200" required></textarea>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</form>
</div>
</div>
You need to give some height to .cont class to add scroll to that div.

How to make a drop down button float along side of a list item using html & css?

please have a look at the attached image.
What I want to do is align the drop down button to be aligned (something like it will overlap on the items following the 1st list item) with the first item of the repeating list. I can do it by adding the drop down button in a column inside repeating list, but in that case the gap between 1st & 2nd items got very large. Any ideas will be greatly appreciated.
I am using HTML, CSS Bootstrap
Edit
The code is large thats why I choose not to provide it on the 1st go. However, here it is:
<div class="packaging-task-section">
<div class="row packaging-items-header" style="margin-left: 1px;">
<div class="col-md-2 small-padding-right-only">
<label class="control-label">Item</label>
</div>
<div class="col-md-1 small-padding-right-only">
<label class="control-label">Unit</label>
</div>
<div class="col-md-1 small-padding-right-only">
<label class="control-label">No Of Unit</label>
</div>
<div class="col-md-1 small-padding-right-only">
<label class="control-label">Unit Cost</label>
</div>
<div class="col-md-2 small-padding-right-only">
<label class="control-label">Unit Sell</label>
</div>
<div class="col-md-2 small-padding-right-only">
<label class="control-label">Total Sell</label>
</div>
<div class="col-md-1">
</div>
<div class="col-md-2 table-condensed table-packaging nopadding padding-right-5">
<div class="pull-right margin-top-10" style="width: 185px; margin-right: 8px;">
some control
</div>
</div>
</div>
<div ng-repeat="item in someList" class="handle-package-item row" style="margin-left: 2px;">
<div class="col-md-2 small-padding-right-only">
custom directive
<span class="glyphicon glyphicon-remove-sign form-control-feedback right-5-top-5" aria-hidden="true"></span>
</div>
<div class="col-md-1 small-padding-right-only">
<input class="form-control input-sm handle-package-task-item-unit-{{$index}}" data-ng-disabled="true" data-ng-model="packageTaskItem.unitName" />
</div>
<div class="col-md-1 small-padding-right-only">
<input type="text" class="form-control input-sm handle-package-task-item-no-{{$index}} padding-right-0"
data-ng-model="packageTaskItem.numberOfUnits"
ng-change="method()" only-digitals />
</div>
<div class="col-md-1 small-padding-right-only">
<input class="form-control handle-package-task-item-cost-{{$index}} input-sm" data-ng-disabled="true" data-ng-model="packageTaskItem.cost" money-value />
</div>
<div class="col-md-2 small-padding-right-only">
<div class="col-md-12 nopadding input-icon">
<i class="fa fa-dollar"></i>
<input money-value placeholder="0.00" data-ng-disabled="!packageTaskItem.packagingItemKey" name="packaging-item-sell-{{$index}}"
class="form-control handle-package-task-item-sell-{{$index}} padding-right-0 input-sm"
min="0" data-ng-model=" packageTaskItem.sell" />
</div>
</div>
<div class="col-md-2 small-padding-right-only">
<input required class="form-control input-sm" disabled data-ng-model="packageTaskItem.itemTotalSell" money-value />
</div>
<div class="col-md-1 small-padding-right-only">
<div class="checkbox-inline">
<a href="javascript:;" class="font-red handle-package-item-remove">
<i class="fa fa-times font-icon"></i>
</a>
</div>
</div>
<div class="col-md-2">
</div>
</div>
<div class="table-condensed table-packaging row nopadding padding-right-5">
<div class="col-md-7 small-padding-right-only" style="display: table-cell;">
<label class="control-label pull-right bold">Total Amount</label>
</div>
<div class="col-md-2 small-padding-right-only" style="display: table-cell;">
<div class="col-md-12" style="width: auto;">
<input class="form-control input-sm" value="" disabled data-ng-model="vm.packagingTotal" money-value />
</div>
</div>
<div class="col-md-1 small-padding-right-only" style="display: table-cell;">
<label class="pull-right bold">Actual Charge</label>
</div>
<div class="col-md-2 small-padding-right-only" style="display: table-cell;">
<div class="col-md-12 nopadding input-icon right">
some custom directive
</div>
</div>
</div>
</div>
<div class="clearfix">
</div>
Edit 2
Where the gap between 1st and 2nd row (or as in the 1st image, header & 1st row) will not be affected by the height of the drop down.

Div vertically align

I have three <div> like this:
<div class="col-xs-12 col-md-4 ">
<img src="custom_images/logo3.png" />
</div>
<div class="col-xs-6 col-md-4 text-center">
<div class="input-group">
<input type="text" class="form-control header_search" placeholder="Search Here....." aria-describedby="basic-addon1">
<span class="input-group-addon search_span" id="basic-addon1" ><i class="fa fa-search "></i> </span>
</div>
<%--<div class="">
<input type="search" placeholder="Search Here...." />
<span style="background-color:#000;padding:10px;">
<img src="custom_images/search.png" /></span>
</div>--%>
</div>
<div class="col-xs-6 col-md-4 text-right">
<button class="cart_button"><span>Items in your cart</span> <span style="margin-left:25px;"><img src="custom_images/cart_item.png" /></span></button>
<span class="cart_items">15</span>
</div>
I am not able to vertically align them in a line. I want all of them to be like vertically-align: middle.
Here is how it looks right now:
Please help me into this.
I believe that the logo is of fixed height. You can use margin-top on the top <div> using this:
<div class="col-xs-6 col-md-4 text-center adjust-top-height">
<div class="input-group">
<input type="text" class="form-control header_search" placeholder="Search Here....." aria-describedby="basic-addon1">
<span class="input-group-addon search_span" id="basic-addon1" ><i class="fa fa-search "></i> </span>
</div>
<div class="">
<input type="search" placeholder="Search Here...." />
<span style="background-color:#000;padding:10px;">
<img src="custom_images/search.png" /></span>
</div>
</div>
<div class="col-xs-6 col-md-4 text-right adjust-top-height">
<button class="cart_button"><span>Items in your cart</span> <span style="margin-left:25px;"><img src="custom_images/cart_item.png" /></span></button>
<span class="cart_items">15</span>
</div>
And in the CSS
.adjust-top-height {margin-top: 15px;}
If you give the parent element the following CSS, you should be fine:
element{
display: flex;
justify-content: space-between;
align-items: center;
}
HTML:
<div class="header">
<div class="col-xs-12 col-md-4 header-element">
<img src="custom_images/logo3.png" />
</div>
<div class="col-xs-6 col-md-4 text-center header-element">
<div class="input-group">
<input type="text" class="form-control header_search" placeholder="Search Here....." aria-describedby="basic-addon1">
<span class="input-group-addon search_span" id="basic-addon1"><i class="fa fa-search "></i> </span>
</div>
</div>
<div class="col-xs-6 col-md-4 text-right">
<button class="cart_button"><span>Items in your cart</span> <span style="margin-left:25px;"><img src="custom_images/cart_item.png" /></span></button>
<span class="cart_items">15</span>
</div>
</div>
CSS:
.header-element{
position: relative;
top: 50%;
transform: translateY(-50%);
}