i'm trying display close icon inside input text. struggling with CSS issue. my code was
<div class="input-group">
<input type="text" class="form-control" />
<i class="fa fa-times-circle ng-hide"></i>
<span class="input-group-btn">
<button type="button" class="btn btn-default">
<span class="fa fa-search"></span> Search
</button>
</span>
</div>
that shows underneath the text box control instead of showing inside the text box could you please help me to fix the css issue
here is the sample plunker
Make the icon position: absolute and position with right and top.
The input-group is already position:relative and the icon will position itself in relation to it.
z-index: 2 places the icon above the text input.
It will now look like this:
or without the input group and button:
Examples
In this example I have placed an additional class (.inside) on the icon element so that it will only apply to specified icons.
With input-group
Note .input-group .inside { right: 100px; }. This ensures that when there is a button (inside the input group), then the close button gets extra space on the right.
.inside {
position: absolute;
top: 10px;
right: 20px;
z-index: 2;
}
.input-group .inside {
right: 100px;
}
<link data-require="bootstrap#*" data-semver="3.2.0" rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.2.0/css/bootstrap.css" />
<link data-require="font-awesome#*" data-semver="4.2.0" rel="stylesheet" href="//cdnjs.cloudflare.com/ajax/libs/font-awesome/4.2.0/css/font-awesome.css" />
<script data-require="bootstrap#*" data-semver="3.2.0" src="https://maxcdn.bootstrapcdn.com/bootstrap/3.2.0/js/bootstrap.js"></script>
<script data-require="jquery#*" data-semver="2.1.1" src="//cdnjs.cloudflare.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<div class="panel panel-default">
<div class="panel-body">
<div class="form-group">
<div class="row">
<div class="col-sm-4">
<div class="input-group">
<input type="text" class="form-control" />
<i class="fa fa-times-circle ng-hide inside"></i>
<span class="input-group-btn">
<button type="button" class="btn btn-default">
<span class="fa fa-search"></span> Search
</button>
</span>
</div>
</div>
</div>
</div>
</div>
</div>
Without input-group
body {
padding-top: 50px; /* ignore this. It is just for this example*/
}
.inside {
position: absolute;
top: 10px;
right: 20px;
z-index: 2;
}
.input-group .inside {
right: 100px;
}
<link data-require="bootstrap#*" data-semver="3.2.0" rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.2.0/css/bootstrap.css" />
<link data-require="font-awesome#*" data-semver="4.2.0" rel="stylesheet" href="//cdnjs.cloudflare.com/ajax/libs/font-awesome/4.2.0/css/font-awesome.css" />
<script data-require="bootstrap#*" data-semver="3.2.0" src="https://maxcdn.bootstrapcdn.com/bootstrap/3.2.0/js/bootstrap.js"></script>
<script data-require="jquery#*" data-semver="2.1.1" src="//cdnjs.cloudflare.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<div class="panel panel-default">
<div class="panel-body">
<div class="form-group">
<div class="row">
<div class="col-sm-4">
<input type="text" class="form-control" />
<i class="fa fa-times-circle ng-hide inside"></i>
</div>
</div>
</div>
</div>
</div>
Demo
You need to add following css
.fa-times-circle:before {
content:"\f057";
position: absolute;
right: 90px;
z-index: 2;
top: 10px;
}
Add relative position for input-group and than move close icon with position: relative;
.input-group {
position: relative;
}
.close-icon {
position: absolute;
top: 10px;
right: 100px;
z-index: 6;
}
/* Styles go here */
/**********************/
/* prevent text from appearing underneath the icon */
input[reset-field] {
padding-right: 19px;
}
/* hide the built-in IE10+ clear field icon */
input[reset-field]::-ms-clear {
display: none;
}
/* hide cancel icon for search type */
input[reset-field]::-webkit-search-cancel-button {
-webkit-appearance: none;
}
/* icon styles */
input[reset-field] + .fa {
position: absolute;
right: 100px;
top: 10px;
color: #C0C0C0;
cursor: default;
display: inline;
z-index: 9999;
}
/* animations for ngAnimate */
input[reset-field] + .fa.ng-hide-add {
display: inline!important;
-webkit-animation: 0.3s fadeOut;
-moz-animation: 0.3s fadeOut;
-ms-animation: 0.3s fadeOut;
animation: 0.3s fadeOut;
}
input[reset-field] + .fa.ng-hide-remove {
-webkit-animation: 0.5s fadeIn;
-moz-animation: 0.5s fadeIn;
-ms-animation: 0.5s fadeIn;
animation: 0.5s fadeIn;
}
.input-group {
position: relative;
}
.close-icon {
position: absolute;
top: 10px;
right: 100px;
z-index: 6;
}
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<link data-require="bootstrap#*" data-semver="3.2.0" rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.2.0/css/bootstrap.css" />
<link data-require="font-awesome#*" data-semver="4.2.0" rel="stylesheet" href="//cdnjs.cloudflare.com/ajax/libs/font-awesome/4.2.0/css/font-awesome.css" />
<script data-require="bootstrap#*" data-semver="3.2.0" src="https://maxcdn.bootstrapcdn.com/bootstrap/3.2.0/js/bootstrap.js"></script>
<div class="panel panel-default">
<div class="panel-body">
<div class="form-group">
<div class="row">
<div class="col-sm-4">
<div class="input-group">
<input type="text" class="form-control" />
<i class="fa fa-times-circle ng-hide close-icon"></i>
<span class="input-group-btn">
<button type="button" class="btn btn-default">
<span class="fa fa-search"></span> Search
</button>
</span>
</div>
</div>
</div>
</div>
</div>
</div>
Code Below Will Work For you
There are modification to your code only.
<!DOCTYPE html>
<html>
<head>
<link data-require="bootstrap#*" data-semver="3.2.0" rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.2.0/css/bootstrap.css" />
<link data-require="font-awesome#*" data-semver="4.2.0" rel="stylesheet" href="//cdnjs.cloudflare.com/ajax/libs/font-awesome/4.2.0/css/font-awesome.css" />
<script data-require="bootstrap#*" data-semver="3.2.0" src="https://maxcdn.bootstrapcdn.com/bootstrap/3.2.0/js/bootstrap.js"></script>
<script data-require="jquery#*" data-semver="2.1.1" src="//cdnjs.cloudflare.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<link rel="stylesheet" href="style.css" />
<script src="script.js"></script>
</head>
<body>
<div class="panel panel-default">
<div class="panel-body">
<div class="form-group">
<div class="row">
<div class="col-sm-4">
<div class="input-group">
<div class="search-wrapper">
<form>
<input type="text" name="focus" required class="search-box" placeholder="Enter search term" />
<button class="close-icon" type="reset"></button>
</form>
</div>
<span class="input-group-btn">
<button type="button" class="btn btn-default">
<span class="fa fa-search"></span> Search
</button>
</span>
</div>
</div>
</div>
</div>
</div>
</div>
<style>
body {
background-color: #f1f1f1;
font-family: Helvetica,Arial,Verdana;
}
h1 {
color: green;
text-align: center;
}
.redfamily {
color: red;
}
.search-box,.close-icon,.search-wrapper {
position: relative;
padding: 10px;
}
.search-wrapper {
width: 500px;
margin: auto;
margin-top: 50px;
}
.search-box {
width: 80%;
border: 1px solid #ccc;
outline: 0;
border-radius: 15px;
}
.search-box:focus {
box-shadow: 0 0 15px 5px #b0e0ee;
border: 2px solid #bebede;
}
.close-icon {
border:1px solid transparent;
background-color: transparent;
display: inline-block;
vertical-align: middle;
outline: 0;
cursor: pointer;
}
.close-icon:after {
content: "X";
display: block;
width: 15px;
height: 15px;
position: absolute;
background-color: #FA9595;
z-index:1;
right: 35px;
top: 0;
bottom: 0;
margin: auto;
padding: 2px;
border-radius: 50%;
text-align: center;
color: white;
font-weight: normal;
font-size: 12px;
box-shadow: 0 0 2px #E50F0F;
cursor: pointer;
}
.search-box:not(:valid) ~ .close-icon {
display: none;
}
</style>
</body>
</html>
Related
I want to add a search icon on the left side of the input text and a speaker icon on the right side.
Something like this
Currently my I have :
Here is my code :
.search-bar {
width: 20%;
position: relative;
}
.search-bar input {
width: 100%;
height: 30px;
text-align: center;
border: none;
border-radius: 18px;
outline: none;
}
.search-ico {
position: absolute;
left: 10px;
}
<!--Search Bar-->
<div class="search-bar">
<input type="text" name="search" placeholder="Search" />
<i class="fa-solid fa-magnifying-glass search-ico"></i>
</div>
How can I achieve this? Thanks.
In addition to the answer above you can add pointer for the icon for simulate mouse with cursor:pointer; like:
body {
background: #333;
marging: 0;
}
.search-bar {
width: 30%;
position: relative;
}
.search-bar input {
width: calc(100% - 60px);
height: 30px;
text-align: center;
border: none;
border-radius: 18px;
outline: none;
padding: 0 30px;
}
.search-ico {
position: absolute;
left: 10px;
top:8px;
cursor: pointer; // add cursor
}
.microphone-ico {
position: absolute;
right: 10px;
top: 8px;
cursor: pointer; // add cursor
}
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css">
<!--Search Bar-->
<div class="search-bar">
<input type="text" name="search" placeholder="Search" />
<i class="fa fa-search search-ico"></i>
<i class="fa fa-microphone microphone-ico"></i>
</div>
If you use bootstrap 4 you can use input group like:
.input-group-text i{
cursor:pointer;
}
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css">
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/css/bootstrap.min.css" integrity="sha384-Gn5384xqQ1aoWXA+058RXPxPg6fy4IWvTNh0E263XmFcJlSAwiGgFAW/dAiS6JXm" crossorigin="anonymous">
<div class="input-group mb-3">
<div class="input-group-prepend">
<span class="input-group-text"><i class="fa fa-search search-ico"></i></span>
</div>
<input type="text" class="form-control" aria-label="Search here">
<div class="input-group-append">
<span class="input-group-text"><i class="fa fa-microphone microphone-ico"></i></span>
</div>
</div>
<script src="https://code.jquery.com/jquery-3.2.1.slim.min.js" integrity="sha384-KJ3o2DKtIkvYIK3UENzmM7KCkRr/rE9/Qpg6aAZGJwFDMVNA/GpGFF93hXpG5KkN" crossorigin="anonymous"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.12.9/umd/popper.min.js" integrity="sha384-ApNbgh9B+Y1QKtv3Rn7W3mgPxhU9K/ScQsAP7hUibX39j7fakFPskvXusvfa0b4Q" crossorigin="anonymous"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/js/bootstrap.min.js" integrity="sha384-JZR6Spejh4U02d8jOt6vLEHfe/JQGiRRSQQxSfFWpi1MquVdAyjUar5+76PVCmYl" crossorigin="anonymous"></script>
You are going the right way, using position: absolute set the icons
body {
background: #333;
marging: 0;
}
.search-bar {
width: 30%;
position: relative;
}
.search-bar input {
width: calc(100% - 60px);
height: 30px;
text-align: center;
border: none;
border-radius: 18px;
outline: none;
padding: 0 30px;
}
.search-ico {
position: absolute;
left: 10px;
top:8px;
}
.microphone-ico {
position: absolute;
right: 10px;
top: 8px;
}
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css">
<!--Search Bar-->
<div class="search-bar">
<input type="text" name="search" placeholder="Search" />
<i class="fa fa-search search-ico"></i>
<i class="fa fa-microphone microphone-ico"></i>
</div>
I've been working in a page that works with bootstrap, contains just css and html and printing a box with a picture, but i'm stucking in a little creepy thing, and it is that the box only prints horizontally tried overflow-wrap: wrap; but no luck same thing with max-width, any one know what's the problem?
My Expected Thing: To Print Like 4 Boxes And Then Heads To Next Line
.modal-content {
width: 750px;
margin-left: 125px;
}
.modal-dialog {
margin: 105px;
}
.button {
display: block;
margin :30px;
}
body {
font-family: 'Roboto', sans-serif;
background-color: #eee;
display: inline-flex;
flex-direction: row;
overflow-wrap: wrap;
overflow-y: hidden;
max-width: 100px;
min-height: 500px;
}
.contain {
display: flex;
flex-direction: row;
}
.stage {
background: #fff;
height: 150px;
width: 200px;
margin : 40px;
flex-wrap: wrap;
background-color: red;
box-shadow: 1px 4px 11px #aaa, inset 1px 3px 6px #ccc;
padding: 1em 0 3em;
position: relative;
}
.stage-content {
background-repeat: no-repeat;
background-size: contain;
width: 200px;
height: 150px;
background-position: top
margin-bottom: 10px;
padding-top: 60%;
background-image: url("data:image/jpeg;base64,/9j/4AAQSkZJRgABAQAAAQABAAD/2wCEAAkGBxIQEhURERIVFRUVFRYVFRUYFhUVFRYXFxUWFxcVFRUYHSggGBolHRUVITEhJSkrLi4uGB8zODMsNygtLisBCgoKDg0OFxAQGi0dHSUrLSstLS0tLS0tLS0tLS0tLS0tKy0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tKy0tLTc3Lf/AABEIALMBGgMBIgACEQEDEQH/xAAbAAABBQEBAAAAAAAAAAAAAAAAAQIDBQYEB//EADwQAAEDAgIHBgQDCAIDAAAAAAEAAhEDIQQxBRJBUWFxgQYTIpGhsTLB0fBCUuEHFHKCkrLC8WLSI3Oi/8QAGQEAAwEBAQAAAAAAAAAAAAAAAAECBAM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hfHxDMqj7J6RtqOIkHwznGccRmts0aw4dbrPZca442ZYvP8TSrUyHPvq7RumcvJcGI0gTkbERnyJ5XkrdaYpBgc4gwATG79OC85xIdJLhEmd3ouuHbPzT2+EoxTtpsbbLgJtetrOkDkuUhK1dNM+6e55Mk7c+KbKCUgTISlbmPvakT2C480AoNuKlYy8EbJkZ5So6fwnmPmulvxR/x/wASlXfDHZ7WbcxvGf8AME2phwRPqLjruTxZo/iPsE94hzotE+hhErv7JZ3FfVoFuy29Qqxc6wIETs2bNnVQ1WAzaIT2z58WvDkQpHUyE3VTcNaNKROLUkIACJSIRsHgKZiEII9T00ITCU2CbTuJOaEJ134fk1+QO0zfohufQn3QhQ0w4OP/AM/RSD4mjl9UIU12xNb+H/2fRO/AP4j7BCEjw+U9TN/Nv9wXBpAeHqPVqEJxPP8ApksezWBp1KGLqObL6VNrqZlw1SXxMAwbb1uuz1QljJvOrPVt0IXPk8uXp/0cfbC2Hqxsj+4LzBxkoQnxeHH1HmFqCEgQhdWcFOOzohCAYFIM+n+KVCBDqfwfzfRd1IeI8j7FCFNauL4OA8LeZ+SWt8T+v9wQhDT8IXZN+9pUT8jz+qEJuORjs+nyTQhCcZsyOUSEJuRpSoQkH//Z");
}
.stage-content:after {
content: 'mamamia';
text-align: center;
display: block;
font-size:10px;
text-transform: uppercase;
transform: translateY(0.5em);
}
.curtain-container {
position: absolute;
top: 0;
left: 0;
bottom: 0;
right: 0;
}
.curtain-panel {
display: flex;
height: 150px;
width: 100%;
cursor: pointer;
overflow: hidden;
}
.curtain-panel .curtain {
width: 100%;
background-color: orange;
height: 150px;
position: relative;
transition: transform 0.5s ease-out;
display: flex;
align-items: center;
overflow: hidden;
}
.curtain-panel .curtain:before {
content: attr(data-title);
font-size:10px;
text-align: center;
width: 200%;
position: absolute;
top: 50%;
line-height: 0;
text-shadow: 1px 1px 3px #ccc;
}
.curtain-panel .left-curtain:before {
left: 0;
}
.curtain-panel .right-curtain:before {
right: 0;
}
.curtain-panel .curtain:after {
content: '';
background-size: 20px 20px;
background-image: radial-gradient(circle at 10px -5px, rgba(0, 0, 0, 0) 12px, #fff 13px);
display: block;
position: absolute;
bottom: 0;
left: 0;
right: 0;
}
.curtain-trigger {
visibility: hidden;
position: absolute;
}
.curtain-trigger:hover ~ .left-curtain {
transform: translateX(calc(-100% + 2em));;
}
.curtain-trigger:hover ~ .right-curtain {
transform: translateX(calc(100% - 2em));
}
<html>
<head>
<title>Testing</title>
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.5.1/css/bootstrap.min.css">
<script src="https://code.jquery.com/jquery-3.5.1.slim.min.js" integrity="sha384-DfXdz2htPH0lsSSs5nCTpuj/zy4C+OGpamoFVy38MVBnE+IbbVYUew+OrCXaRkfj" crossorigin="anonymous"></script>
<script src="https://cdn.jsdelivr.net/npm/popper.js#1.16.1/dist/umd/popper.min.js" integrity="sha384-9/reFTGAW83EW2RDu2S0VKaIzap3H66lZH81PoYlFhbGU+6BZp6G7niu735Sk7lN" crossorigin="anonymous"></script>
<script src="https://stackpath.bootstrapcdn.com/bootstrap/4.5.1/js/bootstrap.min.js" integrity="sha384-XEerZL0cuoUbHE4nZReLT7nx9gQrQreJekYhJD9WNWhH8nEW+0c5qq7aIo2Wl30J" crossorigin="anonymous"></script>
</head>
<body>
<div class="contain"><div class="stage">
<div class="stage-content"><span class="button"><button type="button" class="btn btn-primary" data-toggle="modal" data-target="#staticBackdrop0">
Launch static backdrop modal
</button></span></div>
<label class="curtain-container">
<div class="curtain-panel">
<input type="checkbox" class="curtain-trigger" />
<div class="left-curtain curtain" data-title="Marwan Moussa"></div>
<div class="right-curtain curtain" data-title="Marwan Moussa"></div>
</div>
</label>
</div><div class="stage">
<div class="stage-content"><span class="button"><button type="button" class="btn btn-primary" data-toggle="modal" data-target="#staticBackdrop1">
Launch static backdrop modal
</button></span></div>
<label class="curtain-container">
<div class="curtain-panel">
<input type="checkbox" class="curtain-trigger" />
<div class="left-curtain curtain" data-title="Final Maro Trying"></div>
</div>
</div>
<div class="right-curtain curtain" data-title="Final Maro Trying"></div>
</div>
</label>
</div><div class="stage">
<div class="stage-content"><span class="button"><button type="button" class="btn btn-primary" data-toggle="modal" data-target="#staticBackdrop2">
Launch static backdrop modal
</button></span></div>
<label class="curtain-container">
<div class="curtain-panel">
<input type="checkbox" class="curtain-trigger" />
<div class="left-curtain curtain" data-title="Marwaaaaan"></div>
</div>
</div>
<div class="right-curtain curtain" data-title="Marwaaaaan"></div>
</div>
</label>
</div><div class="stage">
<div class="stage-content"><span class="button"><button type="button" class="btn btn-primary" data-toggle="modal" data-target="#staticBackdrop3">
Launch static backdrop modal
</button></span></div>
<label class="curtain-container">
<div class="curtain-panel">
<input type="checkbox" class="curtain-trigger" />
<div class="left-curtain curtain" data-title="Omar"></div>
</div>
</div>
</div>
<div class="right-curtain curtain" data-title="Omar"></div>
</div>
</label>
</div><div class="stage">
<div class="stage-content"><span class="button"><button type="button" class="btn btn-primary" data-toggle="modal" data-target="#staticBackdrop4">
Launch static backdrop modal
</button></span></div>
<label class="curtain-container">
<div class="curtain-panel">
<input type="checkbox" class="curtain-trigger" />
<div class="left-curtain curtain" data-title="Marorooor"></div>
</div>
</div>
</div>
<div class="right-curtain curtain" data-title="Marorooor"></div>
</div>
</label>
</div></div></body>
</html></body>
I have trouble making my button full width in the form.
Also I want the button to be aligned with the forms bottom, so it takes 100% of white space in width and in the bottom.
I suppose Im having some sort of trouble with some of the containers so it cant be scaled properly with standard full width options?
body {
font-family: 'Open Sans', sans-serif;
width: 100%;
text-align: center;
margin: 20px 0px 20px 0px;
}
.forma {
margin: 0 auto 0 auto;
max-width: 450px;
width: 450px;
height: 700px;
}
.fa-container {
float: left;
background-color: #0975BB;
width: 10%;
height: calc(1.5em + .75rem + 2px);
position: relative;
}
i {
color: white;
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
}
.form-control {
border-radius: 0%;
float: left;
width: 90%;
margin-bottom: 25px;
}
.btn {
border-radius: 0%;
width: 100%;
background-color: #0975BB;
border-style: hidden;
}
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.4.1/css/bootstrap.min.css" integrity="sha384-Vkoo8x4CGsO3+Hhxv8T/Q5PaXtkKtu6ug5TOeNV6gBiFeWPGFN9MuhOf23Q9Ifjh" crossorigin="anonymous">
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css" type="text/css " integrity="sha384-wvfXpqpZZVQGK6TAh5PVlGOfQNHSoD2xbE+QkPxCAFlNEevoEH3Sl0sibVcOQVnN" crossorigin="anonymous">
<link rel="stylesheet" href="styles.css" type="text/css">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.4/jquery.min.js"></script>
<script src="js/script.js"></script>
<script src="https://code.jquery.com/jquery-3.4.1.slim.min.js" integrity="sha384-J6qa4849blE2+poT4WnyKhv5vZF5SrPo0iEjwBvKU7imGFAV0wwj1yYfoRSJoZ+n" crossorigin="anonymous"></script>
<script src="https://cdn.jsdelivr.net/npm/popper.js#1.16.0/dist/umd/popper.min.js" integrity="sha384-Q6E9RHvbIyZFJoft+2mJbHaEWldlvI9IOYy5n3zV9zzTtmI3UksdQRVvoxMfooAo" crossorigin="anonymous"></script>
<script src="https://stackpath.bootstrapcdn.com/bootstrap/4.4.1/js/bootstrap.min.js" integrity="sha384-wfSDF2E50Y2D1uUdj0O3uMBJnjuUD4Ih7YwaYd1iqfktj0Uod8GCExl3Og8ifwB6" crossorigin="anonymous"></script>
<script src='https://kit.fontawesome.com/a076d05399.js'></script>
<div class="forma shadow p-3 mb-5 bg-white rounded">
<img class="top-logo" src="images/csd.png">
<form>
<div class="form-group">
<div class="fa-container">
<i class="fas fa-key"></i>
</div>
<input type="email" class="form-control" id="exampleInputEmail1" aria-describedby="emailHelp" placeholder="Šifra">
</div>
<div class="form-group">
<div class="fa-container">
<i class="fas fa-lock"></i>
</div>
<input type="password" class="form-control btn-block" id="exampleInputPassword1" placeholder="Lozinka">
</div>
<button type="button" class="btn btn-primary ">Sign In</button>
</form>
</div>
Bootstrap 4 has a class pre-defined for this add "btn-block" to the button class
btn-block adds the below CSS styles
display: block;
width: 100%;
Below is an example of how to get it close to what you have linked
body {
font-family: 'Open Sans', sans-serif;
width: 100%;
text-align: center;
margin: 20px 0px 20px 0px;
}
.forma {
margin: 0 auto 0 auto;
max-width: 450px;
width: 450px;
height: 300px;
}
.fa-container {
float: left;
background-color: #0975BB;
width: 10%;
height: calc(1.5em + .75rem + 2px);
position: relative;
}
i {
color: white;
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
}
.form-control {
border-radius: 0%;
float: left;
width: 90%;
margin-bottom: 25px;
}
.btn {
border-radius: 0%;
width: 100%;
background-color: #0975BB;
border-style: hidden;
}
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.4.1/css/bootstrap.min.css" integrity="sha384-Vkoo8x4CGsO3+Hhxv8T/Q5PaXtkKtu6ug5TOeNV6gBiFeWPGFN9MuhOf23Q9Ifjh" crossorigin="anonymous">
<body style="margin-top: 200px;">
<div class="forma shadow mb-5 bg-white rounded">
<img class="top-logo" src="images/csd.png">
<form>
<div class="form-group p-3">
<div class="fa-container">
<i class="fas fa-key"></i>
</div>
<input type="email" class="form-control" id="exampleInputEmail1" aria-describedby="emailHelp"
placeholder="Šifra">
</div>
<div class="form-group p-3">
<div class="fa-container">
<i class="fas fa-lock"></i>
</div>
<input type="password" class="form-control btn-block" id="exampleInputPassword1" placeholder="Lozinka">
</div>
<button type="button" class="btn btn-primary ">Sign In</button>
</form>
</div>
The CSS should be written in an <style> tag or in a separate file.
The code is working fine. The button if full width too.
Check it out live here: https://codepen.io/manaskhandelwal1/pen/rNVWEEX
EDIT
To do so remove p-3 and mb-5 class from the div with class .forma.
And do not give the form a fixed height.
See here: https://codepen.io/manaskhandelwal1/pen/zYGogBG
I have made a checkbox and When it's checked Collapse element comes out with a background color.Element comes out first then the background color changed.I want this should happen together.I have made a fiddle
https://jsfiddle.net/Priom/ad3m7nsk/8/
Here Is the markup----
<div class="container-fluid">
<div class="col-md-12">
<h1>I am an experienced Engineer because</h1>
</div>
<div class="col-md-12">
<label>
<h3>1) I have an engineering degree
<span><input type="checkbox" class="check1" data-toggle='collapse' data-target='#collapsediv1' aria-expanded="false" aria-controls="collapsediv1"></span></h3>
</label>
<div class="col-md-12 collapse" id="collapsediv1" aria-expanded="false">
<p>Sorry engineering degree is useles.Please wait for your practilal engineering training</p>
</div>
</div>
<div class="col-md-12">
<label>
<h3>2) I have an engineering job
<span><input type="checkbox" class="check2" data-toggle='collapse' data-target='#collapsediv2' aria-expanded="false" aria-controls="collapsediv2"></span></h3>
</label>
<div class="col-md-12 collapse" id="collapsediv2" aria-expanded="false">
<p>Having jsut an Engineering degree is just not good enough</p>
</div>
</div>
</div>
Here is the CSS
::-webkit-scrollbar {
width: 0px !important;
}
.pad {
padding-top: 8px;
}
.back {
background-color: #E9ECEF;
padding-top: 13%;
padding-bottom: 13%;
}
h1 {
color: #0000FE;
font-weight: bold;
font-size: 30px;
}
.collapse p {
padding: 10px;
margin-left: 5px;
margin-right: 5px;
border: 1px #FFEEBA solid;
background-color: #F2DEDE;
}
h3 {
font-weight: bold;
}
Thanks in advance.
Problem comes because on click, the collapsing class is attached to the element. And the collpasing class have a different padding and no background color.
A quick fix is to change this
.collapse p {
padding: 10px;
margin-left: 5px;
margin-right: 5px;
border: 1px #FFEEBA solid;
background-color: #F2DEDE;
/*-webkit-transition: 0.5s ease-out;*/
}
Into this
.collapse p, .collapsing p {
padding: 10px;
margin-left: 5px;
margin-right: 5px;
border: 1px #FFEEBA solid;
background-color: #F2DEDE;
/*-webkit-transition: 0.5s ease-out;*/
}
#import url('https://fonts.googleapis.com/css?family=Arial');
::-webkit-scrollbar {
width: 0px !important;
}
.pad {
padding-top: 8px;
}
.back {
background-color: #E9ECEF;
padding-top: 13%;
padding-bottom: 13%;
}
h1 {
color: #0000FE;
font-weight: bold;
font-size: 30px;
}
.collapse {
/*-webkit-transition: 0.5s ease-out;*/
}
.collapse p, .collapsing p {
padding: 10px;
margin-left: 5px;
margin-right: 5px;
border: 1px #FFEEBA solid;
background-color: #F2DEDE;
/*-webkit-transition: 0.5s ease-out;*/
}
h3 {
font-weight: bold;
}
<!DOCTYPE html>
<html>
<head>
<title>Company</title>
<meta name="viewport" content="width=device-width, initial-scale=1">
<!-- <link rel="stylesheet" type="text/css" href="css/bootstrap-lumen.min.css"> -->
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" integrity="sha384-BVYiiSIFeK1dGmJRAkycuHAHRg32OmUcww7on3RYdg4Va+PmSTsz/K68vbdEjh4u" crossorigin="anonymous">
<link rel="stylesheet" type="text/css" href="css/custom.css">
<link rel="stylesheet" type="text/css" href="css/font-awesome.css">
<link href="https://fonts.googleapis.com/css?family=Pacifico" rel="stylesheet">
<script src='https://www.google.com/recaptcha/api.js'></script>
</head>
<body>
<div class="container-fluid">
<div class="col-md-12">
<h1>I am an experienced Engineer because</h1>
</div>
<div class="col-md-12">
<label>
<h3>1) I have an engineering degree
<span><input type="checkbox" class="check1" data-toggle='collapse' data-target='#collapsediv1' aria-expanded="false" aria-controls="collapsediv1"></span></h3>
</label>
<div class="col-md-12 collapse" id="collapsediv1" aria-expanded="false">
<p>Sorry engineering degree is useles.Please wait for your practilal engineering training</p>
</div>
</div>
<div class="col-md-12">
<label>
<h3>2) I have an engineering job
<span><input type="checkbox" class="check2" data-toggle='collapse' data-target='#collapsediv2' aria-expanded="false" aria-controls="collapsediv2"></span></h3>
</label>
<div class="col-md-12 collapse" id="collapsediv2" aria-expanded="false">
<p>Having jsut an Engineering degree is just not good enough</p>
</div>
</div>
</div>
<script src="https://code.jquery.com/jquery-3.3.1.min.js" integrity="sha256-FgpCb/KJQlLNfOu91ta32o/NMZxltwRo8QtmkMRdAu8=" crossorigin="anonymous"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js" integrity="sha384-Tc5IQib027qvyjSMfHjOMaLkfuWVxZxUPnCJA7l2mCWNIpG9mGCD8wGNIcPD7Txa" crossorigin="anonymous"></script>
</body>
</html>
Hello I have a project I am working on. I am using a sidebar template from StartBootstrap and am having some issues with it on mobile. I have a button that triggers the sidebar and when on mobile the button disappears once the sidebar is toggled because it shifts everything over. How can I keep the button on the edge of the sidebar at all times (for easy open / close)?
You can test it Here on my live page. Set your window width to that of a mobile device and you will see the issue.
Sidebar CSS:
/*!
* Start Bootstrap - Simple Sidebar (http://startbootstrap.com/)
* Copyright 2013-2016 Start Bootstrap
* Licensed under MIT (https://github.com/BlackrockDigital/startbootstrap/blob/gh-pages/LICENSE)
*/
body {
overflow-x: hidden;
}
/* Toggle Styles */
#wrapper {
padding-left: 0;
-webkit-transition: all 0.5s ease;
-moz-transition: all 0.5s ease;
-o-transition: all 0.5s ease;
transition: all 0.5s ease;
}
#wrapper.toggled {
padding-left: 250px;
}
#sidebar-wrapper {
z-index: 1000;
position: fixed;
left: 250px;
width: 0;
height: 100%;
margin-left: -250px;
overflow-y: auto;
background: #000;
-webkit-transition: all 0.5s ease;
-moz-transition: all 0.5s ease;
-o-transition: all 0.5s ease;
transition: all 0.5s ease;
}
#wrapper.toggled #sidebar-wrapper {
width: 300px;
}
#page-content-wrapper {
width: 100%;
position: absolute;
padding: 15px;
}
#wrapper.toggled #page-content-wrapper {
position: absolute;
margin-right: -300px;
}
/* Sidebar Styles */
.sidebar-nav {
position: absolute;
top: 0;
width: 300px;
margin: 0;
padding: 0;
list-style: none;
}
.sidebar-nav li {
text-indent: 20px;
line-height: 40px;
}
.sidebar-nav li a {
display: block;
text-decoration: none;
color: #999999;
}
.sidebar-nav li a:hover {
text-decoration: none;
color: #fff;
background: rgba(255,255,255,0.2);
}
.sidebar-nav li a:active,
.sidebar-nav li a:focus {
text-decoration: none;
}
.sidebar-nav > .sidebar-brand {
height: 65px;
font-size: 18px;
line-height: 60px;
}
.sidebar-nav > .sidebar-brand a {
color: white;
}
.sidebar-nav > .sidebar-brand a:hover {
color: #fff;
background: none;
}
#media(min-width:768px) {
#wrapper {
padding-left: 0;
}
#wrapper.toggled {
padding-left: 300px;
}
#sidebar-wrapper {
width: 0;
}
#wrapper.toggled #sidebar-wrapper {
width: 300px;
}
#page-content-wrapper {
padding: 20px;
position: relative;
}
#wrapper.toggled #page-content-wrapper {
position: relative;
margin-right: -300px;
}
}
My HTML:
<head>
<!-- META TAGS -->
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<!-- Enable iOS web app formatting -->
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="apple-mobile-web-app-status-bar-style" content="translucent black">
<meta name="appl-mobile-web-app-title" content="Vamp Weather">
<!-- Bootstrap -->
<link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" rel="stylesheet">
<!-- FONT AWESOME -->
<script src="https://use.fontawesome.com/c60112b331.js"></script>
<!-- TAB TITLE -->
<title>Weather App</title>
<!-- CSS -->
<link href="weather.css" type="text/css" rel="stylesheet">
<link href="simple-sidebar.css" type="text/css" rel="stylesheet">
<!-- iOS web app icon -->
<link href="Images/ios10-weather-app-icon.png" rel="apple-touch-icon">
<!-- iOS web app splash screen -->
<link href="" rel="apple-touch-startup-image">
</head>
<body>
<div id="wrapper">
<!-- Sidebar courtesy of StartBootstrap.com -->
<div id="sidebar-wrapper">
<ul class="sidebar-nav text-center sidebar-nav-fixed" style="color:white;">
<li class="sidebar-brand">
<a href="#">
Weather Display Options
</a>
</li>
<li>
<div class="row">
<div class="col-xs-8" style="margin-right: -50px">
Celsius
</div>
<div class="col-xs-4" style="margin-right: -20px">
<label class="switch">
<input id="Units_Switch" type="checkbox">
<div class="slider round"></div>
</label>
</div>
</div>
</li>
<li>
<div class="row">
<div class="col-xs-8" style="margin-right: -50px">
Actual Temperature
</div>
<div class="col-xs-4" style="margin-right: -20px">
<label class="switch">
<input id="Actual_Switch" type="checkbox" checked="checked">
<div class="slider round"></div>
</label>
</div>
</div>
</li>
<li>
<div class="row">
<div class="col-xs-8" style="margin-right: -50px">
Feels Like Temperature
</div>
<div class="col-xs-4" style="margin-right: -20px">
<label class="switch">
<input id="Feels_Like_Switch" type="checkbox">
<div class="slider round"></div>
</label>
</div>
</div>
</li>
<li>
<div class="row">
<div class="col-xs-8 " style="margin-right: -50px">
Humidity
</div>
<div class="col-xs-4" style="margin-right: -20px">
<label class="switch">
<input id="Humidity_Switch" type="checkbox" checked="checked">
<div class="slider round"></div>
</label>
</div>
</div>
</li>
<li>
<div class="row">
<div class="col-xs-8 " style="margin-right: -50px">
Cloud Coverage
</div>
<div class="col-xs-4" style="margin-right: -20px">
<label class="switch">
<input id="Cloud_Switch" type="checkbox" checked="checked">
<div class="slider round"></div>
</label>
</div>
</div>
</li>
<li>
<div class="row">
<div class="col-xs-8 " style="margin-right: -50px">
Experimental Feature
</div>
<div class="col-xs-4" style="margin-right: -20px">
<label class="switch">
<input id="Experimental_Switch" type="checkbox">
<div class="slider round"></div>
</label>
</div>
</div>
</li>
<li>
</li>
<button id="apply_settings" class="btn btn-block btn-primary" style="margin-top: 20px">Apply Settings</button>
</ul>
</div>
<!-- /#sidebar-wrapper -->
<!-- Page Content -->
<!-- content -->
<div id="page-content-wrapper">
<!-- sidebar toggle button -->
<button id="sidebar_button"
style="margin: 10px 0px 0px 10px; border: none; outline: none; background: none; color: white;
text-shadow: -1px 0 black, 0 1px black, 1px 0 black, 0 -1px black, 1px 1px yellow, -1px 0 black, 0 1px black, 1px 0 black, 0 -1px black;">
<i id="button_icon" class="fa fa-caret-right fa-2x"></i>
</button>
<div class="container-fluid" style="margin-top: 50px">
<div class="row">
<div class="col-md-4"></div>
<div class="col-md-4">
<div id="jumbotron" class="jumbotron" style="background-color: rgba(0,0,0,0.2)">
<div id="loading_div" class="text-center" style="align-content: center; justify-content: center"></div>
<div id="conditions_row" class="row text-center" style="color:white;">
<div id="location"></div>
<div>
<img id="condition_icon" src="" style="">
</div>
<div id="condition_text"></div>
<div id="temperature"></div>
<div id="feels_like_temperature"></div>
<div id="humidity"></div>
<div id="cloud_coverage"></div>
</div>
</div>
</div>
</div>
</div> <!-- // end main container -->
</div> <!-- // end page content -->
</div> <!-- // end wrapper -->
<!-- SCRIPT CODE BELOW THIS LINE -->
<!-- jQuery (necessary for Bootstrap's JavaScript plugins) -->
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.4/jquery.min.js"></script>
<!-- jQuery UI -->
<script
src="https://code.jquery.com/ui/1.11.3/jquery-ui.min.js"
integrity="sha256-xI/qyl9vpwWFOXz7+x/9WkG5j/SVnSw21viy8fWwbeE="
crossorigin="anonymous">
</script>
<!-- Include all compiled plugins (below), or include individual files as needed -->
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script>
<script src="weather.js"></script>
</body>
</html>
I finally fixed it myself.
Added the following media queries and padding-left changes to accommodate the button.
/* added media queries for smaller screens to display button properly on sidebar toggle */
#media(min-width:480px) {
#wrapper {
padding-left: 0;
}
#wrapper.toggled {
padding-left: 330px;
}
#sidebar-wrapper {
width: 0;
}
#wrapper.toggled #sidebar-wrapper {
width: 300px;
}
#page-content-wrapper {
padding: 20px;
position: relative;
}
#wrapper.toggled #page-content-wrapper {
position: relative;
margin-right: -300px;
}
}
#media(min-width:320px) {
#wrapper {
padding-left: 0;
}
#wrapper.toggled {
padding-left: 330px;
}
#sidebar-wrapper {
width: 0;
}
#wrapper.toggled #sidebar-wrapper {
width: 300px;
}
#page-content-wrapper {
padding: 20px;
position: relative;
}
#wrapper.toggled #page-content-wrapper {
position: relative;
margin-right: -300px;
}
}