match the design to iphone4 & iphone 5 - css

I have problem to match the buttons to iphone 4 and iphone 5 only.
all the other platform design phones looks good and responsive but only iphone 4 & 5 little strange.
as you can see in nexus, galaxy and iphone 6 it looks good
but in iphone 4 i need to scroll down and the forgot password and create account is one on the other.
<div class="popup popup-login modal-{{popupLogin}}" style="display: block;background:transparent">
<div class="content-block" >
<div class="login-view-box page page-login-wrapper" style="background:transparent;background:#009688">
<div class="text-center" >
<div class="logo sd" ></div>
<div class="company-text">company name</div>
</div>
<div class="list login-form-box">
<form name="loginForm"
novalidate ="novalidate"
ng-submit="loginForm.$valid && performLogin()" style="margin:20px auto;">
<label class="item item-input" >
<svg version="1.1" xmlns="http://www.w3.org/2000/svg"
fill="#000000"></path>
</svg>
<input type="email" placeholder="Email" name="email" ng-model="email" ng-class="{submitted:submitted}" required/>
</label>
<div ng-messages="loginForm.email.$error" ng-if="loginForm.email.$touched || submitted" class="input-error-small item item-input">
<div ng-message="required">{{ClientMessages.ThisFieldCannotBeEmpty}}</div>
<div ng-message="email">{{ClientMessages.InvalidEmailInput}}</div>
</div>
<br />
<label class="item item-input">
<svg version="1.1" xmlns="http://www.w3.org/2000/svg"
xmlns:xlink="http://www.w3.org/1999/xlink" width="20" height="20" viewBox="0 0 20 20">
<path d="M14.5 8h-0.5v-1.5c0-2.481-2.019-4.5-4.5-4.5s-4.5 2.019-4.5 4.5v1.5h-0.5c-0.827 0-1.5 0.673-1.5 1.5v8c0 0.827 0.673 1.5 1.5 1.5h10c0.827 0 1.5-0.673 1.5-1.5v-8c0-0.827-0.673-1.5-1.5-1.5zM6 6.5c0-1.93 1.57-3.5 3.5-3.5s3.5 1.57 3.5 3.5v1.5h-7v-1.5zM15 17.5c0 0.276-0.224 0.5-0.5 0.5h-10c-0.276 0-0.5-0.224-0.5-0.5v-8c0-0.276 0.224-0.5 0.5-0.5h10c0.276 0 0.5 0.224 0.5 0.5v8z"
fill="#000000"></path>
</svg>
<input type="password" placeholder="Password" name="password" ng-model="password" ng-class="{submitted:submitted}" required/>
</label>
<div ng-messages="loginForm.password.$error" ng-if="loginForm.password.$touched || submitted" class="input-error-small item item-input">
<div ng-message="required">{{ClientMessages.ThisFieldCannotBeEmpty}}</div>
</div>
<button type="submit"
class="button button-block button-positive"
id="login-button"
ng-click="loginSubmit()"
<i class="icon ion-loading-c"></i>
<span>Sign In</span>
</button>
<div class="item item-input list-block" style="background-color:transparent;border:0;margin-top:8px;" ng-click="toggleStayLoggedCheck();" >
<label class="label-checkbox">
<input type="checkbox" name="stayLoggedCheckbox" ng-model="stayLoggedCheckbox" value="StayLogged" >
<div class="item-media" style="padding-left:20%">
<i class="icon icon-form-checkbox" style="border-radius:0"></i>
<span style="padding-left:10px;color:white">Stay Logged In</span>
</div>
</label>
</div>
</form>
<button class="button btn-account">
Create an account
</button>
</div>
<!-- Big Button -->
<div class="footer-link text-center" style="margin-top:20px;">
<div class="text-center" style:"margin-top:20px;">
<a href="#" class="open-popup" data-popup=".popup-forgotpassword" style="color:white;">
Forgot Password?!
</a>
</div>
<!-- <a href="#" class="open-popup" data-popup=".popup-register" >
I don't have a APP account.
</a>-->
</div>
<div class="text-center crt"
style="position: absolute;
background: #4bd46b;
border-radius: 20px;
height: 40px;
width: 40px;
bottom:10px;
right:10px;
font-size: 18px;">
<span class="fa fa-envelope-o df-color" style="font-size:20px;top:8px;position:relative;"></span>
</div>
</div>
</div>
</div>
the problem area
<button class="button btn-account">
Create an account
</button>
</div>
<!-- Big Button -->
<div class="footer-link text-center" style="margin-top:20px;">
<div class="text-center" style:"margin-top:20px;">
<a href="#" class="open-popup" data-popup=".popup-forgotpassword" style="color:white;">
Forgot Password?!
</a>
</div>
<!-- <a href="#" class="open-popup" data-popup=".popup-register" >
I don't have a APP account.
</a>-->
</div>
<div class="text-center crt"
style="position: absolute;
background: #4bd46b;
border-radius: 20px;
height: 40px;
width: 40px;
bottom:10px;
right:10px;
font-size: 18px;">
<span class="fa fa-envelope-o SAMGray-color" style="font-size:20px;top:8px;position:relative;"></span>
</div>

Has your class .footer-link a position: absolute and bottom: 0 properties or something ?
I'd suggest to create a media query like below, to target iphones 4 & 5.
#media only screen and (max-width: 320px) {
/* your iphone 4 & 5 styles */
}
Then, switch your .footer-link class to position: relative (and maybe float: left, depending on your other blocks' float).
The final code should looks like this:
#media only screen and (max-width: 320px) {
.footer-link {
position: relative;
/* float: left; if needed */
}
}
This should position the "forgot password" and fab below the "create account" button and in the meantime apply that margin-top: 20px which is useless in absolute positionning.
Your view will have to be scrolled to see the "forgot password" link though. So you might want to add more styles to the media query in order to reduce some margins, paddings or font-sizes and get the desired view as a result.
However, in this layout your fab link will be messed up. As its absolute positionning would be relative to the .footer-link. I suggest you move it outside of the footer (right before the </body> tag, for example).
Hope this helps!

I'd try switching the position properties. When positioning something absolute, the parent should be "position:relative". When you were resizing in Chrome's mobile spoofer, it was pushing that absolute positioned item up and into the other content. It isn't mimicking any other specs when you're spoofing the view, just the view dimensions. Hope this helps!
<div class="text-center crt" style="position: relative;
background: #4bd46b;
border-radius: 20px;
height: 40px;
width: 40px;
bottom:10px;
right:10px;
font-size: 18px;">
<span class="fa fa-envelope-o df-color" style="font-size:20px;top:8px;position: absolute;"></span>
</div>

Related

Bootstrap dynamic pills only work once?

I'm creating a Sign in/up form. If the login form is displayed then there is a button below Sign up and if you click it then the login form fades and the Sign up form fades in. Then once the Sign up form is displayed clicking Sign in would make the login form be displayed.
However, it only works one time. My client sent me a website template they purchased and wanted me to modify. There are custom CSS files thousands of lines long and it came with it's own version of Bootstrap (CSS and JavaScript) and I'm not sure how they may have modified it. I'm hoping the problem is me and not the template because that would be a nightmare.
Here is my login form/dynamic pill:
<!-- SIGN IN/UP FORM -->
<div class="form-custom text-center container bg-white">
<img src="images/logo.png" alt="">
<!-- TAB CONTENT -->
<div class="tab-content">
<div id="signin" class="tab-pane fade in active">
<!--SIGN IN-->
<form action="" method="post" class="mb-3">
<div class="container px-4">
<input class="form-style" type="email" name="email" placeholder="Email">
<input class="form-style" type="password" name="password" placeholder="Password">
</div>
</form>
<!--SIGN IN-->
</div>
<div id="signup" class="tab-pane fade">
<!--SIGN UP-->
<form action="" method="post" class="mb-3">
<div class="container px-4">
<input class="form-style" type="text" name="first_name" placeholder="First Name">
<input class="form-style" type="text" name="last_name" placeholder="Last Name">
<input class="form-style" type="email" name="email" placeholder="Email">
<input class="form-style" type="password" name="password" placeholder="Password">
</div>
</form>
<!--SIGN UP-->
</div>
</div>
<!-- TAB CONTENT -->
<ul class="nav nav-pills">
<div class="container">
<div class="d-flex flex-row justify-content-center">
<li class="active">
<button data-toggle="pill" href="#signin" class="btn btn-sign">Sign in</button>
</li>
<li>
<button data-toggle="pill" href="#signup" class="btn btn-sign">Sign up</button>
</li>
</div>
</div>
</ul>
</div>
<!-- SIGN IN/UP FORM -->
And then my own style classes compiled from Sass:
.form-custom {
position: absolute;
top: 35vh;
left: calc(90vw - 475px);
width: 475px;
z-index: 5000;
}
#media (max-width: 575.98px) {
.form-custom {
width: 420px;
left: calc(90vw - 420px);
}
}
#media (max-width: 500px) {
.form-custom {
width: 375px;
left: calc(90vw - 375px);
}
}
#media (max-width: 400px) {
.form-custom {
width: 275px;
left: calc(90vw - 275px);
}
}
.form-style {
display: block;
width: 100%;
border-top: 0px;
border-right: 0px;
border-left: 0px;
font-size: 1rem;
}
.form-style:focus {
outline-color: transparent;
}
.btn-sign {
display: inline;
margin: 0px 20px 0px 20px;
border-radius: 0px;
width: 180px;
}
#media (max-width: 575.98px) {
.btn-sign {
width: 162px;
}
}
#media (max-width: 500px) {
.btn-sign {
width: 126px;
}
}
#media (max-width: 400px) {
.btn-sign {
width: 90px;
}
}
Any help would be much appreciated. If additional details are needed please let me know. Thanks.
I commented out the container and flex div's and that fixed the problem.
<ul class="nav nav-pills">
<li class="active">
<button data-toggle="pill" href="#signin" class="btn btn-sign">Sign in</button>
</li>
<li>
<button data-toggle="pill" href="#signup" class="btn btn-sign">Sign up</button>
</li>
</ul>

PrimeNG - styling size and alignment of p-panel

I am creating a login page using a PrimeNG p-panel component:
https://www.primefaces.org/primeng/#/panel
The panel takes the whole row of the screen, but I would like to make the whole panel be about 30% wide and centralized so I don't get a lot of empty space in my panel as I have only these two fields and a button.
I have the following page:
login.componennt.html
<p-panel header="Login">
<div class="ui-g">
<div class="ui-lg-2 ui-md-2 ui-sm-2">
<input type="text" pInputText placeholder="user" [(ngModel)]="user"/>
</div>
</div>
<div class="ui-g">
<div class="ui-lg-2 ui-md-2 ui-sm-2">
<input type="password" pPassword placeholder="password" [(ngModel)]="password"/>
</div>
</div>
<div class="ui-g">
<div class="ui-lg-2 ui-md-2 ui-sm-2">
<button pButton type="button" label="Login" (click)="doLogin()"></button>
</div>
</div>
</p-panel>
So I tried this:
<p-panel header="Login" styleClass="center-div">
...
login.component.css
.center-div {
width: 30%;
margin: 0 auto;
}
Which doesn't work.
I have the screen like this:
So I've inspected the code, Chrome Dev Tools, and I got:
<p-panel _ngcontent-c1="" header="Login" styleclass="center-div" ng-reflect-header="Login" ng-reflect-style-class="center-div">
<div class="center-div ui-panel ui-widget ui-widget-content ui-corner-all" ng-reflect-klass="center-div" ng-reflect-ng-class="ui-panel ui-widget ui-widget-c">
<div class="ui-panel-titlebar ui-widget-header ui-helper-clearfix ui-corner-all">
<span class="ui-panel-title">Login</span>
</div>
<div class="ui-panel-content-wrapper" ng-reflect-klass="ui-panel-content-wrapper" ng-reflect-ng-class="[object Object]">
<div class="ui-panel-content ui-widget-content">
<div _ngcontent-c1="" class="ui-g">
<div _ngcontent-c1="" class="ui-lg-2 ui-md-2 ui-sm-2">
<input _ngcontent-c1="" pinputtext="" placeholder="user" type="text" class="ng-untouched ng-pristine ng-valid ui-inputtext ui-corner-all ui-state-default ui-widget">
</div>
</div> ...
So I can see my css class 'center-div' in the right place, just before the actual panel content, but why it doesn't affect the content style?
here:
<div class="center-div ui-panel ui-widget ui-widget-content ui-corner-all" ng-reflect-klass="center-div" ng-reflect-ng-class="ui-panel ui-widget ui-widget-c">
So in Chrome Dev Tools if I change the ui-panel class to
width: 30%;
margin: 0 auto;
It does work, then I get the page I want:
So one question is, why my center-div class doesn't affect the content but ui-panel does?
Should I then css select ui-panel and do changes there? I've been trying to, but I have been failed.
Any help?
Cheers!
I quit the idea of trying to affect the PrimeNG css classes, so I added the panel in a div container, so I can affect the behavior of that container, which works much better.
So I created a center-login class and I also used media query to work on the width and margins, to make it responsive... here's what I've done:
login.component.html
<div class="ui-g">
<div class="ui-lg-12 ui-md-12 ui-sm-12 center-login">
<p-panel header="Login">
<div class="ui-g">
<div class="ui-lg-12 ui-md-12 ui-sm-12">
<h4 class="first in-label">User</h4>
<input type="text" pInputText [(ngModel)]="user"/>
</div>
</div>
...
login.component.css
#media screen and (min-width: 600px) {
.center-login {
width: 600px;
margin: 0 auto;
}
}
So when my screen is 600px wide or less I just let it take the space, but when the screen gets bigger I centralize it and fix the width at 600px.
You should use next selector in CSS
.center-div.ui-panel{
width: 30%;
margin: 0 auto;
}

How to make a span with glyphicon as a hyperlink?

I have some form with glyphicon question mark for field inline tooltip on right:
<div class="form-group required">
<label for="username" class="col-sm-2 control-label">User Name:</label>
<div class="col-sm-3 tooltip-box">
<input id="username" type="text" class="form-control" placeholder="username"/>
<div class="row tooltip-block"><a href="#" data-toggle="popover" data-trigger="hover" data-placement="auto right" data-content="Test tooltip.">
<span class="glyphicon glyphicon-question-sign"></span></a>
</div>
</div>
</div>
In full screen it looks as I need:
But on mobile devices or small screens it works only with hovering some very small area within my glyphicon mark and the tooltip overlays it:
Also when I inspect the corresponding a element in Chrome's developer tools, it points to some area outside the span element:
Here is the fiddle: https://jsfiddle.net/r2cm9c9u/
How is it possible to make the whole span with glyphicon as a hyperlink for tooltip?
I would move the positioning to the actual link and make the link and glyphicon a block element:
I have added a class to the link below
<div class="form-group required">
<label for="username" class="col-sm-2 control-label">User Name:</label>
<div class="col-sm-3 tooltip-box">
<input id="username" type="text" class="form-control" placeholder="username" />
<div class="row tooltip-block">
<a href="#" data-toggle="popover" data-trigger="hover" data-placement="auto right" data-content="Test tooltip." class="glyphicon-holder">
<span class="glyphicon glyphicon-question-sign"></span></a>
</div>
</div>
</div>
And changed your classes:
.tooltip-box .glyphicon-holder {
position: absolute;
top: 8px;
right: 22px;
font-size: 1.25em;
display: block;
}
.tooltip-box .glyphicon-holder:hover {
text-decoration: none;
}
.glyphicon.glyphicon-question-sign {
color: gray;
display: block;
}
Updated fiddle
You can do it with pure css.
If you have:
<div class="col-sm-3 tooltip-box">
<input id="username" type="text" class="form-control" placeholder="username"/>
<div class="row tooltip-block"><a href="#" data-toggle="popover" data-trigger="hover" data-placement="auto right" data-content="Test tooltip.">
<span class="glyphicon glyphicon-question-sign"></span></a>
</div>
</div>
You don't need 'a' first of all. What you can do with CSS is:
.tooltip-block span {
display: none;
}
.tooltip-block:hover + span {
display: block;
}
Whats gonna happen is, when you hover over .tooltip-block following span element will display block. Definitely don't need javascript for a thing like this.
Then if you want that tooltip to be clickable you can use javascript for that.
<div class="col-sm-3 tooltip-box">
<input id="username" type="text" class="form-control" placeholder="username"/>
<div class="row tooltip-block" onclick="doSomething()"><a href="#" data-toggle="popover" data-trigger="hover" data-placement="auto right" data-content="Test tooltip.">
<span class="glyphicon glyphicon-question-sign"></span></a>
</div>
</div>

Background image resize by itself

I'm a little bit desesparate, i have tried multiple things and nothing is working. So my issue is the following :
Everytime i click on a input field, the background resize by himself, i have a blank space on the bottom and on the top.
I have added :
cordova.plugins.Keyboard.disableScroll(true);
.run(function($ionicPlatform) {
$ionicPlatform.ready(function() {
// Hide the accessory bar by default (remove this to show the accessory bar above the keyboard
// for form inputs)
cordova.plugins.Keyboard.disableScroll(true);
if (window.cordova && window.cordova.plugins.Keyboard) {
cordova.plugins.Keyboard.hideKeyboardAccessoryBar(true);
}
if (window.StatusBar) {
// org.apache.cordova.statusbar required
StatusBar.styleDefault();
}
});
})
login.html
<ion-view view-title="Login" align-title="left">
<ion-content class="background">
<div class="hero no-header flat">
<div class="content" style="bottom: 0px;">
<div class="app-icon"></div>
<h1 style="text-transform: uppercase;">App</h1>
</div>
</div>
<div class="list padding" style="margin-top: 25px;">
<label style="margin-bottom: 20px; display: block;">
<input type="text" placeholder="Adresse e-mail" ng-model="data.email" class="customInput">
</label>
<label style="margin-bottom: 20px; display: block;">
<input type="password" placeholder="Mot de passe" ng-model="data.password" class="customInput">
</label>
</div>
<div class="button-bar padding">
<button class="button button-small button-border icon-left ion-social-google button-assertive-900" ng-click="login(data)">Connexion</button>
<button class="button button-small button-border icon-left ion-social-facebook button-positive-900">Facebook</button>
</div>
<div class="padding">
<button class="button button-full button-register ink" ui-sref="app.register">Créer votre compte</button>
</div>
</ion-content>
.background.scroll-content {
background: url('../img/login.jpg') no-repeat;
background-size: cover;
background-position: center;
margin: auto;
z-index: 2;
}
The issue is that when the keyboard is shown the background resizes or the keyboard pushes the background image up.
Hmm, please explain better. I've tried your code here: http://play.ionic.io/app/e9abbb2a5670 but I dont se anything wrong.

Css - Div causing white space at the top of a page

I have narrowed down the culprit to either a SPAN or a DIV in lines 27-33 but cant quite get it... if i remove the span that makes the font below the press muted, it fixes the spacing issue at the top of the page but makes that text way to large
u.neighborrow.com/items/indexb
<div id="slide_one" class="bg"><!--slide #1-->
<div class="slide-content">
<div class="nhome">
<div style="margin-top:22px;color:#000;font-size:30px;margin-left:200px;width:408px">
The cheaper, greener, easier, better way to have stuff.
<span style="font-size: 13px; position: relative; top: -2px"> <br /></span>
<?php echo $form->create('Item', array('controller' => 'items', 'action' => 'recent/2')); ?>
<div class="input text required">
<label for="ItemItem"></label><input type="text" id="ItemItem" value="" maxlength="255" style="font-size: 25px; width: 200px; margin: 5px 0pt;" name="data[Item][item]">
<input type="submit" value="Search" style="font-size: 22px" />
</div>
<?php echo $form->end(); ?>
<div style="font-size: 13px; position: relative; top: -2px; line-height: 1.4em;"> <strong>Search Tips:</strong> Need a camera or a book for a trip? Want to try an iPAD before you buy it? Need a tool for a project or a tent for an event? <br />
Borrow these things from your neighbors, The <i>owner</i>-ship has SAILED!</div>
<span style="font-weight:normal;color:#ccc;font-size:14px;line-height:20px">Still not sure what to borrow? <br />
Browse the borrowables or <br />
Lend something safely and securely<br />
</span>
<div>
<div style="padding:5px;text-align:center"><img src="/images/press_wide.jpg"></div>
<span style="font-weight:normal;color:#ccc;font-size:14px;line-height:20px"> The media adores us, our users love us,our friends <i>like us</i>,
<center><iframe src="http://www.facebook.com/plugins/like.php?href=www.neighborrow.com&layout=standard&show_faces=false&width=350&action=like&colorscheme=light" scrolling="no" frameborder="0" allowTransparency="true" style="border:none; overflow:hidden; width:450px; height: 30px; text-align: center;margin-top:0px;"></iframe></center>
(oh yeah, and mother earth has a crush on us:)</div></span>
<hr color="#CCC" />
</div>
</div>
</div>
</div>
</div>
and i know i need to get rid of the inline styles:)
got some crazy margins:
<div class="main-content" style="margin-top:200px">
It's in div class="main content" style="margin-top: 200px"> It seems to be inline on line 325

Resources