<link href="//maxcdn.bootstrapcdn.com/bootstrap/4.0.0/css/bootstrap.min.css" rel="stylesheet" id="bootstrap-css">
<script src="//maxcdn.bootstrapcdn.com/bootstrap/4.0.0/js/bootstrap.min.js"></script>
<script src="//cdnjs.cloudflare.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script>
<!------ Include the above in your HEAD tag ---------->
<div class="container">
<h2>Create new customer</h2>
<p class="lead">Dropdown appears at width less than or equal to 768px</p>
<div class="row">
<div class="col-sm-3">
<a href="#" class="nav-tabs-dropdown btn btn-block btn-primary">Tabs</a>
<ul id="nav-tabs-wrapper" class="nav nav-tabs nav-pills nav-stacked well">
<li class="active"><a href="#vtab1" data-toggle="tab">End customer</a></li>
<li><a href="#vtab2" data-toggle="tab">Domain name CSP</a></li>
<!--<li><a href="#vtab3" data-toggle="tab">Tab 3</a></li>-->
</ul>
</div>
<div class="col-sm-9">
<div class="tab-content">
<div role="tabpanel" class="tab-pane fade in active" id="vtab1">
<h3>Tab 1</h3>
<form class="form-horizontal">
<fieldset>
<!-- Form Name -->
<legend>Create a new End customer</legend>
<!-- Text input-->
<div class="form-group">
<label class="col-md-4 control-label" for="textinput">Name</label>
<div class="col-md-4">
<input id="textinput" name="textinput" type="text" placeholder="" class="form-control input-md" required="">
</div>
</div>
<!-- Text input-->
<div class="form-group">
<label class="col-md-4 control-label" for="textinput2">Phone</label>
<div class="col-md-4">
<input id="textinput2" name="textinput2" type="text" placeholder="" class="form-control input-md">
</div>
</div>
<!-- Text input-->
<div class="form-group">
<label class="col-md-4 control-label" for="textinput">Address</label>
<div class="col-md-4">
<input id="textinput" name="textinput" type="text" placeholder="" class="form-control input-md" required="">
</div>
</div>
<!-- Text input-->
<div class="form-group">
<label class="col-md-4 control-label" for="textinput">City</label>
<div class="col-md-4">
<input id="textinput" name="textinput" type="text" placeholder="" class="form-control input-md">
</div>
</div>
<!-- Text input-->
<div class="form-group">
<label class="col-md-4 control-label" for="textinput">Zip code</label>
<div class="col-md-4">
<input id="textinput" name="textinput" type="text" placeholder="" class="form-control input-md" required="">
</div>
</div>
<!-- Select Basic -->
<div class="form-group">
<label class="col-md-4 control-label" for="selectbasic">Country</label>
<div class="col-md-4">
<select id="selectbasic" name="selectbasic" class="form-control">
<option value="1">France</option>
<option value="2">United States</option>
</select>
</div>
</div>
</fieldset>
</form>
</div>
<div role="tabpanel" class="tab-pane fade" id="vtab2">
<h3>Tab 2</h3>
<p> Mauris imperdiet dignissim ante, in efficitur mauris elementum sed. Cras vulputate malesuada magna. Morbi tincidunt eros a dui cursus, vitae dignissim nulla scelerisque. Duis pharetra scelerisque mi vel luctus. Cras eu purus efficitur, blandit nisi id, fringilla nulla.</p>
</div>
<div role="tabpanel" class="tab-pane fade in" id="vtab3">
<h3>Tab 3</h3>
<p>Etiam id pharetra quam. Morbi tristique nunc vel sapien dapibus, sit amet imperdiet quam venenatis. Vestibulum et suscipit urna. Suspendisse volutpat quis est eu volutpat. Nulla non tortor venenatis turpis congue aliquet. Vivamus at elit vel massa elementum tempor sit amet sed odio. Nullam placerat, arcu sed ullamcorper ornare, erat erat placerat quam, in feugiat nulla purus in nunc. Maecenas vitae erat auctor, aliquam tellus et, vulputate eros.</p>
</div>
</div>
</div>
</div>
</div>
.nav-tabs-dropdown {
display: none;
border-bottom-left-radius: 0;
border-bottom-right-radius: 0;
}
.nav-tabs-dropdown:before {
content: "\e114";
font-family: 'Glyphicons Halflings';
position: absolute;
right: 30px;
}
@media screen and (min-width: 769px) {
#nav-tabs-wrapper {
display: block!important;
}
}
@media screen and (max-width: 768px) {
.nav-tabs-dropdown {
display: block;
}
#nav-tabs-wrapper {
display: none;
border-top-left-radius: 0;
border-top-right-radius: 0;
text-align: center;
}
.nav-tabs-horizontal {
min-height: 20px;
padding: 19px;
margin-bottom: 20px;
background-color: #f5f5f5;
border: 1px solid #e3e3e3;
border-radius: 4px;
-webkit-box-shadow: inset 0 1px 1px rgba(0,0,0,.05);
box-shadow: inset 0 1px 1px rgba(0,0,0,.05);
}
.nav-tabs-horizontal > li {
float: none;
}
.nav-tabs-horizontal > li + li {
margin-left: 2px;
}
.nav-tabs-horizontal > li,
.nav-tabs-horizontal > li > a {
background: transparent;
width: 100%;
}
.nav-tabs-horizontal > li > a {
border-radius: 4px;
}
.nav-tabs-horizontal > li.active > a,
.nav-tabs-horizontal > li.active > a:hover,
.nav-tabs-horizontal > li.active > a:focus {
color: #ffffff;
background-color: #428bca;
}
}
$('.nav-tabs-dropdown').each(function(i, elm) {
$(elm).text($(elm).next('ul').find('li.active a').text());
});
$('.nav-tabs-dropdown').on('click', function(e) {
e.preventDefault();
$(e.target).toggleClass('open').next('ul').slideToggle();
});
$('#nav-tabs-wrapper a[data-toggle="tab"]').on('click', function(e) {
e.preventDefault();
$(e.target).closest('ul').hide().prev('a').removeClass('open').text($(this).text());
});