I was trying to create exactly the same search bar like this:
And I use textbox and button to recreate it using the ff: codes:
<input type="text" class="google-mail-search"><button class="google-search-btn"></button>
And here's the CSS:
.google-search-btn{
background-color: #4486F7;
background-image: url('http://i.imgur.com/UWlZaD6.png');
width: 30px;
height: 40px;
}
.google-mail-search{
border: none;
padding: 6px;
margin: 0px;
height: auto;
width: 100%;
transparent;
position: absolute;
z-index: 6;
left: 0px;
}
HERE'S MY JSFIDDLE: https://jsfiddle.net/hzbh6zya/4/
What should I fixed on my codes specifically to attain the same exact search bar?
Please help!
<div class="wrap">
<div class="search">
<input type="text" class="searchTerm" placeholder="What are you looking for?">
<button type="submit" class="searchButton">
<i class="fa fa-search"></i>
</button>
</div>
</div>
.search {
width: 100%;
position: relative
}
.searchTerm {
float: left;
width: 100%;
border: 3px solid #00B4CC;
padding: 5px;
height: 20px;
border-radius: 5px;
outline: none;
color: #9DBFAF;
}
.searchTerm:focus{
color: #00B4CC;
}
.searchButton {
position: absolute;
right: -50px;
width: 40px;
height: 36px;
border: 1px solid #00B4CC;
background: #00B4CC;
text-align: center;
color: #fff;
border-radius: 5px;
cursor: pointer;
font-size: 20px;
}
/*Resize the wrap to see the search bar change!*/
.wrap{
width: 30%;
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
}
Try with this code it may help you
Html
<div class="input-group" id="adv-search">
<input type="text" class="form-control" />
<div class="input-group-btn">
<div class="btn-group" role="group">
<div class="dropdown dropdown-lg">
<button type="button" class="btn btn-default dropdown-toggle" data-toggle="dropdown" aria-expanded="false"><span class="caret"></span></button>
<div class="dropdown-menu dropdown-menu-right" role="menu">
<option value="0" selected>All</option>
<option value="1">Featured</option>
<option value="2">Most popular</option>
<option value="3">Top rated</option>
<option value="4">Most commented</option>
</div>
</div>
<button type="button" class="btn btn-primary"><span class="glyphicon glyphicon-search" aria-hidden="true"></span></button>
</div>
</div>
</div>
css
.dropdown.dropdown-lg .dropdown-menu {
margin-top: -1px;
padding: 6px 20px;
}
.input-group-btn .btn-group {
display: flex !important;
}
.btn-group .btn {
border-radius: 0;
margin-left: -1px;
}
.btn-group .btn:last-child {
border-top-right-radius: 4px;
border-bottom-right-radius: 4px;
}
.btn-group .form-horizontal .btn[type="submit"] {
border-top-left-radius: 4px;
border-bottom-left-radius: 4px;
}
.form-horizontal .form-group {
margin-left: 0;
margin-right: 0;
}
.form-group .form-control:last-child {
border-top-left-radius: 4px;
border-bottom-left-radius: 4px;
}
#media screen and (min-width: 768px) {
#adv-search {
width: 500px;
margin: 0 auto;
}
.dropdown.dropdown-lg {
position: static !important;
}
.dropdown.dropdown-lg .dropdown-menu {
min-width: 500px;
}
}
Using bootstrap
<div class="input-group">
<select class="form-control">
<option value="">Default select</option>
<option value="">Default select</option>
<option value="">Default select</option>
</select> <span class="input-group-btn"> <button class="btn btn-default" type="button">Go!</button> </span> </div>
Fiidler https://jsfiddle.net/zr61h343/1/
Related
I'm trying to make this:
But for now I have this:
I don't understand how I can resize input with icon on right... I am on col-md-12...
You can look my code here:
.form {
margin-top: 8px;
margin-left: 13px;
display: flex;
flex-direction: row;
}
.search-field {
padding: 10px 35px 10px 15px;
color: #fff;
border-color: #d4e0e0;
border-radius: 15px;
outline: none;
background: #FFFFFF 0% 0% no-repeat padding-box;
box-shadow: inset 0px 3px 6px #0000000D;
border: 1px solid #D4E0E0;
width: auto;
color: #000;
}
.search-button {
z-index: 1;
float: inline-end;
background: transparent;
border: none;
outline: none;
margin-top: -2px;
margin-left: -45px;
}
.search-button img {
width: 20px;
height: 20px;
object-fit: cover;
}
<div class="container">
<div class="list row">
<span class="font-link-bold" style={{ fontSize: "26px" }}>
<span class="title-card font-link-blue-bold">Mes </span>Conseils
</span>
<div class="button-create">
<IconCreate /> Créer un nouveau conseil
</div>
<br />
<br />
<span
class="font-link"
style={{ fontSize: "16px", color: "#657273" }}
>
Saisir vos mots-clés ou coller un texte :
</span>
</div>
<div class="row">
<div class="col-md-12">
<form action="/" method="GET" class="form">
<input
type="search"
placeholder="Search"
class="search-field"
/>
<button type="submit" class="search-button">
<img src={IconLoupe} alt="" />
</button>
</form>
</div>
</div>
</div>
In my html you can see "col-md-12" and the other col-md-12 take all space... just input take an col-md-3 or 6...
Try giving width 100% to .search-field
.search-field {
width: 100% !important;
}
It should work or you can also try giving position to your icon
parent{
position: relative;
}
child{
position: absolute;
top: 5px;
right: 20px;
}
image image2I'm trying to build a profile card in Bootstrap 3 and I'm having trouble getting the image to fit into the card. I think I can do this easier if I link to image in the css but I have many profile cards with all different people so I think keeping the image link in the HTML is better in this case.
Here's how I'd like it:
Any help is greatly appreciated. Thanks!
body {
font-family: 'Poppins';
overflow: hidden;
}
.navbar-inverse {
background-color: #fff !important;
border-color: #ffffff !important;
border-bottom: 1px solid #979797 !important;
}
#media (min-width: 768px){
.navbar {
border-radius: 0px !important;
}
}
.color-1{
color: #FCB900;
}
.sidebar{
color: #FCB900;
font-size: 21px;
float: left;
padding: 10px 5px;
cursor: pointer;
margin: 0 10px;
}
.logo a{
color: #424242 !important;
}
.logo{
background: white;
margin: 10px;
border: 1px solid #979797;
padding: 5px 20px;
font-size: 14px;
font-weight: 600;
}
.logo-a{
padding: 0 !important;
font-size: 13px !important;
}
/* Sidebar CSS */
.sidebar-logo{
background: white;
margin: 10px;
border: 1px solid #979797;
padding: 10px 20px;
font-size: 14px;
width: 50%;
margin-left: 10%;
text-align: center;
font-weight: 600;
}
.sidebar-title{
margin-left: 10%;
font-size: 12px;
}
.sidenav {
height: 100%;
width: 0;
position: fixed;
z-index: 1;
top: 0;
left: 0;
background-color: #fcb900;
overflow-x: hidden;
transition: 0.5s;
padding-top: 60px;
}
.sidenav a {
padding: 12px 8px 10px 25px;
text-decoration: none;
font-size: 14px;
color: #101010;
display: block;
transition: 0.3s;
}
.sidenav a:hover {
color: #101010;
}
.sidenav .closebtn {
position: absolute;
top: 0;
right: 15px;
font-size: 25px;
margin-left: 50px;
}
.cart-icon{
font-size: 16px;
}
/*------------------------Profile Account----------------------------*/
.widget-author {
margin-bottom: 58px;
}
.author-card {
position: relative;
padding-bottom: 48px;
background-color: #fff;
box-shadow: 0 12px 20px 1px rgba(64, 64, 64, .09);
}
.author-card .author-card-cover {
position: relative;
width: 100%;
height: 100px;
background-position: center;
background-repeat: no-repeat;
background-size: cover;
}
.author-card .author-card-cover::after {
display: block;
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
content: '';
opacity: 0.5;
}
.author-card .author-card-cover > .btn {
position: absolute;
top: 12px;
right: 12px;
padding: 0 10px;
}
.author-card .author-card-profile {
display: table;
position: relative;
margin-top: -85px;
padding-right: 15px;
padding-bottom: 16px;
padding-left: 20px;
z-index: 5;
}
.author-card .author-card-profile .author-card-avatar, .author-card .author-card-profile .author-card-details {
display: table-cell;
vertical-align: middle;
}
.author-card .author-card-profile .author-card-avatar {
width: 85px;
border-radius: 50%;
box-shadow: 0 8px 20px 0 rgba(0, 0, 0, .15);
overflow: hidden;
}
.author-card .author-card-profile .author-card-avatar > img {
display: block;
width: 100%;
}
.author-card .author-card-profile .author-card-details {
padding-top: 50px;
padding-left: 15px;
}
.author-card .author-card-profile .author-card-name {
margin-bottom: 2px;
font-size: 14px;
font-weight: bold;
}
.author-card .author-card-profile .author-card-position {
display: block;
color: #8c8c8c;
font-size: 12px;
font-weight: 600;
}
.author-card .author-card-info {
margin-bottom: 0;
padding: 0 25px;
font-size: 13px;
}
.author-card .author-card-social-bar-wrap {
position: absolute;
bottom: -18px;
left: 0;
width: 100%;
}
.author-card .author-card-social-bar-wrap .author-card-social-bar {
display: table;
margin: auto;
background-color: #fff;
box-shadow: 0 12px 20px 1px rgba(64, 64, 64, .11);
}
.btn-style-1.btn-white {
background-color: #fff;
}
.list-group-item i {
display: inline-block;
margin-top: -1px;
margin-right: 8px;
font-size: 1.2em;
vertical-align: middle;
}
.mr-1, .mx-1 {
margin-right: .25rem !important;
}
.list-group-item.active:not(.disabled) {
border-color: #e7e7e7;
background: #fff;
color: #ac32e4;
cursor: default;
pointer-events: none;
}
.list-group-flush:last-child .list-group-item:last-child {
border-bottom: 0;
}
.list-group-flush .list-group-item {
border-right: 0 !important;
border-left: 0 !important;
}
.list-group-flush .list-group-item {
border-right: 0;
border-left: 0;
border-radius: 0;
}
.list-group-item.active {
z-index: 2;
color: #fff;
background-color: #007bff;
border-color: #007bff;
}
.list-group-item:last-child {
margin-bottom: 0;
border-bottom-right-radius: .25rem;
border-bottom-left-radius: .25rem;
}
a.list-group-item, .list-group-item-action {
color: #404040;
font-weight: 600;
}
.list-group-item {
padding-top: 16px;
padding-bottom: 16px;
-webkit-transition: all .3s;
transition: all .3s;
border: 1px solid #e7e7e7 !important;
border-radius: 0 !important;
color: #404040;
font-size: 12px;
font-weight: 600;
letter-spacing: .08em;
text-transform: uppercase;
text-decoration: none;
}
.list-group-item {
position: relative;
display: block;
padding: .75rem 1.25rem;
margin-bottom: -1px;
background-color: #fff;
border: 1px solid rgba(0,0,0,0.125);
}
.list-group-item.active:not(.disabled)::before {
background-color: #ac32e4;
}
.list-group-item::before {
display: block;
position: absolute;
top: 0;
left: 0;
width: 3px;
height: 100%;
background-color: transparent;
content: '';
}
#media screen and (max-height: 450px) {
.sidenav {
padding-top: 15px;
}
.sidenav a {
font-size: 15px;
}
}
#exTab1 .tab-content {
color : #FCB900;
background-color: #fff;
padding : 5px 15px;
}
#exTab2 h3 {
color : #FCB900;
background-color: #428bca;
padding : 5px 15px;
}
/* remove border radius for the tab */
#exTab1 .nav-pills > li > a {
border-radius: 0;
}
/* change border radius for the tab , apply corners on top*/
#exTab3 .nav-pills > li > a {
border-radius: 4px 4px 0 0 ;
}
#exTab3 .tab-content {
color : white;
background-color: #428bca;
padding : 5px 15px;
}
/* Sidebar CSS */
.navbar-inverse .navbar-nav>li>a:hover {
color: #333;
}
.banner{
background-image: url('img/banner.jpg');
background-position: center center;
background-size: 100%;
margin: 0;
width: 100%;
height: 250px;
}
#media (min-width: 320px) and (max-width: 600px) {
.logo{
border: 1px solid #fff;
}
.head{
border-bottom: 0px solid #fff !important;
}
.header-right{
display: none !important;
}
.logo-media{
background: white;
border: 1px solid #979797;
padding: 5px 20px;
font-size: 14px;
width: 50%;
text-align: center;
font-weight: 600;
}
.no-margin{
margin-top: 0px !important;
margin-bottom: 0px;
}
.icon{
position: absolute !important;
top: 11px;
right: 0px;
}
}
<!DOCTYPE html>
<html lang="en">
<head>
<title>Travelling | Account Settings </title>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.4.0/css/bootstrap.min.css">
<link rel="stylesheet" href="css/css.css">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.4.1/jquery.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.4.0/js/bootstrap.min.js"></script>
<link href='https://fonts.googleapis.com/css?family=Poppins' rel='stylesheet'>
<link rel="stylesheet" type="text/css" href="fonts/font-awesome-4.7.0/css/font-awesome.min.css">
<link rel="stylesheet" type="text/css" href="css/util.css">
<link rel="stylesheet" type="text/css" href="css/main.css">
</head>
<body>
<nav class="navbar navbar-inverse head">
<div class="container-fluid">
<span style="" onclick="openNav()" class="sidebar">☰</span>
<div class="navbar-header logo">
<a class="logo-media" href="#">Logo</a>
</div>
<div id="mySidenav" class="sidenav">
×
<div class="sidebar-logo">
<a class="logo-a" href="#">Logo</a>
</div>
<span class="sidebar-title">My Account</span>
<span class="glyphicon glyphicon-home p-r-10"></span> Home
<span class="glyphicon glyphicon-road p-r-10"></span> My Booking
<span class="glyphicon glyphicon-envelope p-r-10"></span> Messages
<span class="glyphicon glyphicon-user p-r-10"></span> Account
<hr style="display: block; height: 1px;border: 0; border-top: 1px solid black;margin: 1em 0; padding: 0; }">
<span class="sidebar-title">Settings</span>
Language
<hr style="display: block; height: 1px;border: 0; border-top: 1px solid black;margin: 1em 0; padding: 0; }">
<span class="sidebar-title">Information</span>
Customer Service
<hr style="display: block; height: 1px;border: 0; border-top: 1px solid black;margin: 1em 0; padding: 0; }">
<span class="fa fa-sign-in p-r-10" aria-hidden="true"></span>Login
<span class="fa fa-user-o p-r-10" aria-hidden="true"></span>Sign Up!
</div>
<ul class="nav navbar-nav navbar-right no-margin">
<li class="icon"><span class="glyphicon glyphicon-shopping-cart color-1 cart-icon "></span></li>
<li class="header-right">Login</li>
<li class="header-right">Sign Up</li>
</ul>
</div>
</nav>
<div class="container mt-5">
<div class="row">
<div class="col-lg-4 pb-5">
<!-- Account Sidebar-->
<div class="author-card pb-3">
<div class="author-card-cover">
<!-- <a class="btn btn-style-1 btn-white btn-sm" href="#" data-toggle="tooltip" title="" data-original-title="You currently have 290 Reward points to spend"><i class="fa fa-award text-md"></i> 290 points</a> --></div>
<div class="author-card-profile">
<div class="author-card-avatar"><img src="https://bootdey.com/img/Content/avatar/avatar1.png" alt="Daniel Adams">
</div>
<div class="author-card-details">
<h5 class="author-card-name text-lg">Daniel Adams</h5><span class="author-card-position">Joined February 06, 2017</span>
</div>
</div>
</div>
<div class="wizard">
<nav class="list-group list-group-flush">
<a class="list-group-item" href="#">
<div class="d-flex justify-content-between align-items-center">
<div><i class="fe-icon-heart mr-1 text-muted"></i>
<div class="d-inline-block font-weight-medium text-uppercase">Account Setting</div>
</div>
</div>
</a>
<a class="list-group-item" href="#">
<div class="d-flex justify-content-between align-items-center">
<div><i class="fe-icon-heart mr-1 text-muted"></i>
<div class="d-inline-block font-weight-medium text-uppercase">My Booking</div>
</div>
</div>
</a>
<a class="list-group-item" href="#">
<div class="d-flex justify-content-between align-items-center">
<div><i class="fe-icon-tag mr-1 text-muted"></i>
<div class="d-inline-block font-weight-medium text-uppercase">Wish List</div>
</div>
</div>
</a>
</nav>
</div>
</div>
<!-- Profile Settings-->
<div class="col-lg-8 pb-5">
<!-- <form class="row">
<div class="col-md-6">
<div class="form-group">
<label for="account-fn">First Name</label>
<input class="form-control" type="text" id="account-fn" value="Daniel" required="">
</div>
</div>
<div class="col-md-6">
<div class="form-group">
<label for="account-ln">Last Name</label>
<input class="form-control" type="text" id="account-ln" value="Adams" required="">
</div>
</div>
<div class="col-md-6">
<div class="form-group">
<label for="account-email">E-mail Address</label>
<input class="form-control" type="email" id="account-email" value="daniel.adams#example.com" disabled="">
</div>
</div>
<div class="col-md-6">
<div class="form-group">
<label for="account-phone">Phone Number</label>
<input class="form-control" type="text" id="account-phone" value="+7 (805) 348 95 72" required="">
</div>
</div>
<div class="col-md-6">
<div class="form-group">
<label for="account-pass">New Password</label>
<input class="form-control" type="password" id="account-pass">
</div>
</div>
<div class="col-md-6">
<div class="form-group">
<label for="account-confirm-pass">Confirm Password</label>
<input class="form-control" type="password" id="account-confirm-pass">
</div>
</div>
<div class="col-12">
<hr class="mt-2 mb-3">
<div class="d-flex flex-wrap justify-content-between align-items-center">
<div class="custom-control custom-checkbox d-block">
<input class="custom-control-input" type="checkbox" id="subscribe_me" checked="">
<label class="custom-control-label" for="subscribe_me">Subscribe me to Newsletter</label>
</div>
<button class="btn btn-style-1 btn-primary" type="button" data-toast="" data-toast-position="topRight" data-toast-type="success" data-toast-icon="fe-icon-check-circle" data-toast-title="Success!" data-toast-message="Your profile updated successfuly.">Update Profile</button>
</div>
</div>
</form> -->
<h1>Account Settings </h1>
<div id="exTab1">
<ul class="nav nav-pills">
<li>
Personal Information
</li>
<li>Travel
</li>
<li>Security
</li>
</ul>
<div class="tab-content clearfix">
<div class="tab-pane" id="1a">
<form class="row">
<div class="col-md-4">
<div class="form-group">
<label for="First Name">First Name*</label>
<input class="form-control" type="text" id="account-fn" placeholder="First Name" required="">
</div>
</div>
<div class="col-md-4">
<div class="form-group">
<label for="Last Name">Last Name*</label>
<input class="form-control" type="text" id="account-ln" placeholder="Last Name" required="">
</div>
</div>
<div class="col-md-4">
<div class="form-group">
<label for="gender">Gender</label>
<select class="form-control" id="sel1" placeholder="Gender">
<option>Male</option>
<option>Female</option>
</select>
</div>
</div>
<div class="col-md-4">
<div class="form-group">
<label for="First Name">First Name*</label>
<input class="form-control" type="text" id="account-fn" placeholder="First Name*" required="">
</div>
</div>
<div class="col-md-4">
<div class="form-group">
<label for="Last Name">Last Name*</label>
<input class="form-control" type="text" id="account-ln" placeholder="Last Name*" required="">
</div>
</div>
<div class="col-md-4">
<div class="form-group">
<label for="Passport No.">Passport No.</label>
<input class="form-control" type="password" id="account-pass">
</div>
</div>
<div class="col-md-6">
<div class="form-group">
<label for="Date of Birth">Date of Birth</label>
<input class="form-control" type="date" value="2011-08-19" id="example-date-input">
</div>
</div>
<div class="col-md-6">
<div class="form-group">
<label for="Country">Country</label>
<select class="selectpicker countrypicker form-control" data-flag="true" ></select>
</div>
</div>
<div class="col-12">
<hr class="mt-2 mb-3">
<div class="d-flex flex-wrap justify-content-between align-items-center">
<button class="btn btn-style-1 btn-primary" type="button" data-toast="" data-toast-position="topRight" data-toast-type="success" data-toast-icon="fe-icon-check-circle" data-toast-title="Success!" data-toast-message="Your profile updated successfuly.">Update Profile</button>
</div>
</div>
</form>
</div>
<div class="tab-pane" id="2a">
<h3>We use the class nav-pills instead of nav-tabs which automatically creates a background color for the tab</h3>
</div>
<div class="tab-pane" id="3a">
<h4> Change Password </h4>
<form>
<div class="form-group">
<label for="email" style="color:#2EC4B6">Current Password *</label>
<input type="password" class="form-control" id="exampleInputPassword1" placeholder="Current Password">
</div>
<div class="form-group">
<label for="email" style="color:#2EC4B6">New Password *</label>
<input type="password" class="form-control" id="exampleInputPassword1" placeholder="Password">
</div>
<div class="form-group">
<input type="password" class="form-control" id="exampleInputPassword1" placeholder="Confirm Password">
</div>
<button type="submit" class="btn" style="background: #FCB900; color:#fff;">Submit</button>
</form>
</div>
</div>
</div>
</div>
</div>
</div>
<script>
function openNav() {
document.getElementById("mySidenav").style.width = "250px";
}
function closeNav() {
document.getElementById("mySidenav").style.width = "0";
}
</script>
<script type="text/javascript">
$(function () {
$('#datetimepicker1').datetimepicker();
});
</script>
</body>
</html>
Maybe you should consider something like this! :)
.author-card-shape {
width: 85px;
height: 85px;
border-radius: 50%;
overflow: hidden;
}
.author-card-img {
max-width: 100%;
height: auto;
}
<figure class="author-card-shape">
<img class="author-card-img" src="https://bootdey.com/img/Content/avatar/avatar1.png" alt="Daniel Adams">
</figure>
I've a login page that contains of sign in fields (email/password) and sign in buttons.
Initial look
I want the buttons New account and Forgot password to be next to the button Login, but still above each other like this
This is my code Fiddle
page-login {
background-size: 100%;
background-position-y: 50%;
.logo {
display: block;
width: 1050px;
margin-left: auto;
margin-right: auto
}
button {
padding: 10px;
margin: 7px;
border: none;
}
.facebook-btn,
.google-btn {
display: block;
clear: both;
border: none;
background: #939393;
}
#btn button {
padding: 3px;
display: block;
clear: both;
background-color: Transparent;
color: black;
}
#btn {
overflow: hidden;
}
.norm-login-textfield {
display: block;
text-align: center;
margin: auto;
width: 50%;
margin-bottom: 5px;
height: 5%;
}
.norm-login-field {
display: block;
margin: auto;
width: 55%;
margin-bottom: 5px;
height: 5%;
}
.icons {
margin-right: 10px;
}
.error {
margin-top: 20px;
width: 100%;
text-align: center;
background-color: rgb(217, 74, 87);
p {
color: white;
font-weight: bold;
}
}
.invalid {
border-bottom: 1px solid #FF6153;
}
ion-input {
padding: 5px;
}
}
<ion-content padding>
<form [formGroup]="loginForm" (submit)="loginUser()" novalidate>
<ion-item>
<ion-input formControlName="email" type="email" placeholder="Email address" [class.invalid]="!loginForm.controls.email.valid && loginForm.controls.email.dirty"></ion-input>
<ion-icon name="ios-mail-outline" item-left></ion-icon>
</ion-item>
<ion-item class="error-message" *ngIf="!loginForm.controls.email.valid && loginForm.controls.email.dirty">
<p>Please enter a valid email.</p>
</ion-item>
<ion-item>
<ion-input formControlName="password" type="password" placeholder="Password" [class.invalid]="!loginForm.controls.password.valid && loginForm.controls.password.dirty"></ion-input>
<ion-icon name="ios-key-outline" item-left></ion-icon>
</ion-item>
<ion-item class="error-message" *ngIf="!loginForm.controls.password.valid && loginForm.controls.password.dirty">
<p>Your password needs more than 6 characters.</p>
</ion-item>
<button ion-button block type="submit" [disabled]="!loginForm.valid" style="margin:0 auto;width:100px;height:100px;">
Login
</button>
</form>
<div id="btn">
<button ion-button clear (click)="goToSignup()" style="margin:0 auto;">
New account
</button>
<button ion-button clear (click)="goToResetPassword()" style="margin:0 auto;">
Forgot password
</button>
</div>
<button ion-button block class="facebook-btn" (click)="facebookLogin()">
<ion-icon name="logo-facebook" class="icons"> </ion-icon>
Login with Facebook</button>
<button ion-button block class="google-btn" (click)="googleLogin()">
<ion-icon name="logo-google" class="icons"></ion-icon>
Login with Google</button>
</ion-content>
Try below code
angular.module('ionicApp', ['ionic'])
.config(function($stateProvider, $urlRouterProvider) {
$stateProvider
.state('login', {
url: "/login",
templateUrl: "templates/login.html",
controller: "LoginCtrl"
})
$urlRouterProvider.otherwise('/login');
})
.controller('LoginCtrl', function($scope) {
$scope.user = {};
$scope.login = function (user) {
console.log('Logging In', user);
};
})
page-login {
background-size: 100%;
background-position-y: 50%;
.logo {
display: block;
width: 1050px;
margin-left: auto;
margin-right: auto
}
button {
padding: 10px;
margin: 7px;
border: none;
}
.facebook-btn,
.google-btn {
display: block;
clear: both;
border: none;
background: #939393;
}
#btn button {
padding: 3px;
display: block;
clear: both;
background-color: Transparent;
color: black;
}
#btn {
overflow: hidden;
}
.norm-login-textfield {
display: block;
text-align: center;
margin: auto;
width: 50%;
margin-bottom: 5px;
height: 5%;
}
.norm-login-field {
display: block;
margin: auto;
width: 55%;
margin-bottom: 5px;
height: 5%;
}
.icons {
margin-right: 10px;
}
.error {
margin-top: 20px;
width: 100%;
text-align: center;
background-color: rgb(217, 74, 87);
p {
color: white;
font-weight: bold;
}
}
.invalid {
border-bottom: 1px solid #FF6153;
}
ion-input {
padding: 5px;
}
}
form,div#btn {
display: inline-block;
}
#btn button,button.google-btn,button.facebook-btn {
display: block;
}
ion-content.scroll-content.ionic-scroll.scroll-content-false {
width: 300px;
margin: 0 auto;
}
#btn button, button.google-btn, button.facebook-btn {
display: block;
background: none;
box-shadow: none;
border: none;
line-height: 14px;
}
form, div#btn {
display: inline-block;
padding: 10px;
vertical-align: sub;
}
button.button.button-block.button-outline.button-positive {
background: orange;
border: none;
color: #fff;
}
.padding.login {
width: 150px;
display: inline-block;
vertical-align: middle;
}
<html ng-app="ionicApp"><head><style type="text/css">#charset "UTF-8";[ng\:cloak],[ng-cloak],[data-ng-cloak],[x-ng-cloak],.ng-cloak,.x-ng-cloak,.ng-hide:not(.ng-hide-animate){display:none !important;}ng\:form{display:block;}</style>
</head>
<body ng-app="ionicApp" class="grade-a platform-browser platform-win32 platform-ready">
<meta charset="utf-8">
<meta name="viewport" content="initial-scale=1, maximum-scale=1, user-scalable=no, width=device-width">
<title>Login Example</title>
<link href="//code.ionicframework.com/1.0.0-beta.14/css/ionic.min.css" rel="stylesheet">
<script src="//code.ionicframework.com/1.0.0-beta.14/js/ionic.bundle.min.js"></script>
<ion-nav-view class="view-container" nav-view-transition="ios" nav-view-direction="none"><ion-view class="pane" nav-view="active" style="opacity: 1; transform: translate3d(0%, 0px, 0px);">
<ion-content scroll="false" class="scroll-content ionic-scroll scroll-content-false">
<form ng-submit="login(user)" class="ng-pristine ng-valid ng-valid-email ng-submitted">
<div class="list">
<label class="item item-input">
<i class="icon ion-email placeholder-icon"></i>
<input type="email" placeholder="Email" ng-model="user.email" class="ng-pristine ng-untouched ng-valid ng-valid-email">
</label>
<label class="item item-input">
<i class="icon ion-search placeholder-icon"></i>
<input type="text" placeholder="password">
</label>
</div>
<div class="padding login">
<button type="submit" class="button button-block button-outline button-positive">
<i class="icon"></i>
Log in
</button>
</div><div id="btn">
<button ion-button="" clear="" (click)="goToSignup()">
New account
</button>
<button ion-button="" clear="" (click)="goToResetPassword()">
Forgot password
</button>
</div>
</form>
</ion-content>
</ion-view></ion-nav-view>
<script id="templates/login.html" type="text/ng-template">
<ion-view title="Login">
<ion-content scroll="false">
<form ng-submit="login(user)">
<div class="list">
<label class="item item-input">
<i class="icon ion-email placeholder-icon"></i>
<input type="email" placeholder="Email" ng-model="user.email">
</label>
<label class="item item-input">
<i class="icon ion-search placeholder-icon"></i>
<input type="text" placeholder="Search">
</label>
</div>
<div class="padding login">
<button type="submit" class="button button-block button-outline button-positive">
<i class="icon"></i>
Log in
</button>
</div>
</form>
<div id="btn">
<button ion-button clear (click)="goToSignup()">
New account
</button>
<button ion-button clear (click)="goToResetPassword()" >
Forgot password
</button>
</div>
</ion-content>
</ion-view>
</body></html>
To have them together and centered place them in a div and give it the
margin: 0 auto;
then give the login button an id (eg. #login-button) and use
display: inline-block;
on both #login-button and #btn
Place all three of the buttons in a div with:
margin:0 auto; width:200px;
Give the buttons the following styles:
1st button:
float:left; width:100px; height:100px;
2nd + 3rd buttons:
float:right; width:100px; // or fewer pixels - adjust to fit padding/margins
I need to position the textbox and button inline and that's correct. But when I try different view example tablet view the textbox fit but the button stay in the position. Please see the image.
<input id="search" class="form-control" type="text" placeholder="Search Location" style="margin-left: 100px; margin-top: 10px; position: absolute; width: 30%; z-index: 1;">
<input type="button" class="btn btn-default" onclick="location.reload();" style="margin-left: 700px; width: 10%; margin-top: 10px; position: absolute; z-index: 1; background-color: #ffffff; border: 1px solid #dce4ec; color: #2c3e50" value="Refresh" />
<div id="map" style="position: relative;"></div>
using this #chaitz9:
<input id="search" class="form-control" placeholder="Search Location" style="margin-top: 10px; width: 30%; z-index: 1; margin-left: 100px;" type="text">
<input class="btn btn-default" onclick="location.reload();" style="margin-top: 10px; z-index: 1; background-color: rgb(255, 255, 255); border: 1px solid rgb(220, 228, 236); color: rgb(44, 62, 80); width: 15%;" value="Refresh" type="button">
<div id="map" style="position: relative;"></div>
the output:
Edited: Try using this CSS. I have now wrapped the input fields into a div and given the div property of display: table. And to the input fields display: table-cell
.loc_div{
display: table !important;
width:100%;
}
#search{
margin-left: 100px;
margin-top: 10px;
width: 30%;
z-index: 1;
position:relative;
display:table-cell;
}
.btn {
background-color: #ffffff;
border: 1px solid #dce4ec;
color: #2c3e50;
margin-top: 10px;
width: 20%;
z-index: 1;
margin-left: 10px;
display:table-cell;
}
<div class="loc_div">
<input id="search" class="form-control" placeholder="Search Location" type="text">
<input class="btn btn-default" onclick="location.reload();" value="Refresh" type="button">
</div>
<div id="map" style="position: relative;"></div>
Basically I'm trying to make the chat messages scrollable. However as of right now the content doesn't seem to be scrollable. When the "chat-messages-wrapper" class was relative it'd scroll just fine however I want the chat messages to appear at the bottom initially which is why I switched it to absolute.
Html:
<div class="chat-widget">
<div class="header">Social Chat</div>
<div class="chat-messages-wrapper">
<div class="chat-message">
<img class="profile-image" src="../Content/images/facebook-profile.png" /> <span class="header-1">
<img class="logo" src="../Content/images/facebook-logo.png" />
<span class="username">Jens Olsen says:</span>
</span> <span class="header-2">
<button class="reply btn btn-primary btn-xs">Reply</button>
<button class="like btn btn-success btn-xs">Like</button>
<button class="spam btn btn-danger btn-xs">Spam</button>
<span class="date">5:03PM</span>
</span>
<div class="text">This is the chat message. This is the chat message.</div>
</div>
<div class="chat-message">
<img class="profile-image" src="../Content/images/facebook-profile.png" /> <span class="header-1">
<img class="logo" src="../Content/images/twitter-logo.png" />
<span class="username">Jens Olsen says:</span>
</span> <span class="header-2">
<button class="reply btn btn-primary btn-xs">Reply</button>
<button class="like btn btn-success btn-xs">Like</button>
<button class="spam btn btn-danger btn-xs">Spam</button>
<span class="date">5:03PM</span>
</span>
<div class="text">This is the chat message. This is the chat message.</div>
</div>
<div class="chat-message">
<img class="profile-image" src="../Content/images/default-avatar.png" /> <span class="header-1">
<span class="username">Jens Olsen says:</span>
</span> <span class="header-2">
<button class="reply btn btn-primary btn-xs">Reply</button>
<button class="like btn btn-success btn-xs">Like</button>
<button class="spam btn btn-danger btn-xs">Spam</button>
<span class="date">5:03PM</span>
</span>
<div class="text">This is the chat message. This is the chat message.</div>
</div>
</div>
<div class="reply-box">
<input class="reply-text" placeholder="Type your message here..." />
<button class="btn btn-primary reply-button">Send</button>
</div>
</div>
Css:
.chat-widget {
position: fixed;
right: 5px;
bottom: 5px;
height: 95%;
width: 300px;
background-color: #FFF;
border: solid 3px #3B5998;
overflow: hidden;
}
.chat-widget .header {
text-align: center;
font-size: 18px;
color: #FFF;
background-color: #3B5998;
font-weight: bold;
padding-top: 5px;
padding-bottom: 5px;
}
.header {
position: relative;
z-index: 2;
width: 100%;
}
.chat-messages-wrapper {
position: absolute;
bottom: 40px;
padding-left: 7px;
padding-right: 7px;
height: auto;
overflow-y: auto;
}
.chat-message {
padding-top: 5px;
position: relative;
border-bottom: solid 1px #000;
overflow-y: auto;
}
.chat-message .profile-image {
height: 48px;
width: 48px;
border: solid 1px #000;
margin-right: 5px;
}
.chat-message > .header-1 {
position: absolute;
height: 20px;
}
.chat-message > .header-1 .logo {
width: 75px;
height: 20px;
}
.chat-message > .header-1 .username {
font-weight: bold;
}
.chat-message > .header-2 {
position: absolute;
top: 30px;
height: 20px;
}
.chat-message > .header-2 > .reply {
width: 50px;
}
.chat-message > .header-2 > .like {
width: 50px;
}
.chat-message > .header-2 > .spam {
width: 50px;
}
.chat-message > .header-2 .date {
font-style: italic;
position: relative;
right: 0px;
}
.chat-message .text {
position: relative;
margin: 5px;
}
.chat-message:last-child {
border-bottom: 0px;
}
.reply-box {
overflow-y: auto;
position: absolute;
bottom: 5px;
}
.reply-box .reply-text {
width: 70%;
height: 32px;
}
.reply-box .reply-button {
width: 25%;
}
Here's a JSFiddle with the entire code:
http://jsfiddle.net/5GCE5/1/
In order to get overflow-y to work, you need to specify an explicit (min/max) height for the .chat-messages-wrapper element.
However, since the box is positioned absolutely, you could play with top and bottom properties to achieve the same effect:
Example Here
.chat-messages-wrapper {
position: absolute;
padding-left: 7px;
padding-right: 7px;
/* height: auto; */
bottom: 40px; /* = height of bottom element */
top: 32px; /* = height of top element */
overflow-y: auto;
}
You need to give .chat-messages-wrapper a max-height
http://jsfiddle.net/5GCE5/6/