css footer doesn't remain at the end of the content - html

I have a website and I want to put a footer at the end of each page.
The page login has content, but the footer doesn't remain at the end of it.
login
<div class="login">
<form id="loginForm" method="POST" action="<?php echo URL; ?>Login/run">
<li>
<label>
Username:
</label>
<input type="text" name="username"/>
<span class="errorMessage"></span>
</li>
<li>
<label>
Password:
</label>
<input type="text" name="password"/>
<span class="errorMessage"></span>
</li>
<li>
<label>
Type:
</label>
<select name="typeOfUser">
<option value="1">Restaurant</option>
<option value="2">Customer</option>
</select>
</li>
<li>
<label></label>
<input type="submit" value="Login"/>
</li>
</form>
</div>
css
.login{
position: relative;top: 100px;
margin-left: 280px;
}
.login li{
list-style: none;
padding-bottom: 10px;
}
.login label{
color: blue;
display: inline-block;
width: 100px;
}
.login input{
padding: 0.4em;
}
.login select{
padding: 0.4em;
}
footer
#footerContent{
position: relative;
bottom: 0px;
width: 100%;
height: 48px;
background-color: #646467;
}

change your login div css to
.login{
position: relative;
margin-top: 100px;
margin-left: 280px;
}
and footer will come after login div.
Check this jsfiddle
hope it helps

try this
#footerContent{
position: absolute;
bottom: 0;
width: 100%;
height: 48px;
background-color: #646467;
}

Related

Why can I click on a link outside of its text element?

I'm building a forum and I have a link that can be clicked outside of its text, how can I undo it?
I also have an image inside a tag that can be clicked outside of its image, I want to undo that too.
I have tried - position: relative; but it didn't work.
Here is the HTML code of the image.
<div class="nav-list">
<a class="home_A"href="Home.php">
<img class="homeIcon" src="photos/icon.png">
</a>
</div>
CSS of the image
.homeIcon{
width: 200px;
display:block;
margin:auto;
margin: 0 auto;
}
CSS of the <a> link
.signinForm a{
margin: auto;
display:block;
text-align:center;
margin-top: 7px;
color: #006db6;
font-size: 20px;
}
HTML of the <a> link
<form method="POST" class="signinForm">
<ul>
<li> <h1 class="signinH1">sign in</h1></li>
<li> <input type="text" placeholder="User name"name="username_login"class="username" value="<?php if(isset($_POST['username_login'])){echo $_POST['username_login'];}?>" required></li>
<li> <input type="password" placeholder="Password" name="password_login" class="password" value="<?php if(isset($_POST['password_login'])){echo $_POST['password_login'];}?>" required></li>
<li> <input type="submit" value="Log in"class="signinbutton"></li>
<li>Sign up</li>
</ul>
</form>
Thanks all.
It might have to do with your CSS styles for <a> tags and/or <img> tags.
My guess is that something like the following might fix your issue
.homeIcon {
display: inline-block;
}
Try with something like:
img.homeIcon {
display: inline-block;
}
div.home_A {
align-content:center;
margin: 0 auto;
text-align: center; // Not mandatory but useful
}
Assign display: inline-block of course, also use object-fit:contain on <img> and set the line-height: of <a> to 1 to 1.25 depending on how your font is setup but there's very little play in the value.
:root {
font: 1ch/1 'Segoe UI'
}
body {
font-size: 2ch;
}
a {
font-size: 2.5rem;
line-height: 1.15;
}
a,
img {
display: inline-block;
}
img {
object-fit: contain;
width: 3rem;
height: 3rem;
margin-bottom: -3px;
}
<div class='frame'>
<a class="zOne" href="https://stackoverflow.com/users/2813224/zer00ne">
..::Zer00ne::..
<img src='https://i.ibb.co/Kx33pSY/01.jpg'></a>
</div>
<!--HTML_CODE-->
<div class="nav-list">
<a class="home_A"href="Home.php">
<img class="homeIcon" src="photos/icon.png">
</a>
</div>
<form method="POST" class="signinForm">
<ul>
<li> <h1 class="signinH1">sign in</h1></li>
<li> <input type="text" placeholder="User
name"name="username_login"class="username" value="<?php
if(isset($_POST['username_login'])){echo $_POST['username_login'];}?>" required>
</li>
<li> <input type="password" placeholder="Password" name="password_login"
class="password" value="<?php if(isset($_POST['password_login'])){echo
$_POST['password_login'];}?>" required></li>
<li> <input type="submit" value="Log in"class="signinbutton"></li>
<div class="signUp-block">
<li>Sign up</li></div>
</ul>
</form>
/*CSS_CODE*/
.homeIcon{
width: 200px;
display:block;
margin:auto;
margin: 0 auto;
}
.signUp-block{
display: flex;
flex-direction: row;
justify-content: center;
}
.signinForm a{
margin: auto;
display:inline-block;
text-align:center;
margin-top: 7px;
color: #006db6;
font-size: 20px;
}
.homeIcon {
display: inline-block;
}

Clickable image inside input field - position not working

I know this question has been asked and aswered before, but for some reason, the answers are not working for me; so any help is much appreciated.
I'm creating a hybrid mobile app and I need to add an clickable icon (SVG) inside an input field. Even though I have managed to add the icon, when I test my design in different screens, the icon doesn't not respect the position I need it to be in.
Here are some shots: This is how it's supposed to look in all screens and this is what it looks like in landscape mode, for example.
Here's my code: https://codepen.io/paulamourad/pen/djXvxq
CSS:
.wallet-body {
width: 100%;
margin: 0 auto;
}
.form-group {
position: relative;
}
.form-group input {
border: 1px solid #2C2C2C;
height: 48px;
}
.qr-scanner-img {
float: left;
width: 11%;
margin-top: -39px;
margin-left: 120px;
position: relative;
}
HTML:
<div class="wallet-body">
<form class="form-pagar">
<div class="form-group">
<input type="amount" class="form-control" id="amount" placeholder="Monto">
</div>
<div class="form-group">
<input type="IDuser" class="form-control" id="IDuser" placeholder="Email del destinatario">
<a href="#">
<img class="qr-scanner-img" src="img/qr.svg" alt="qr"></a>
</a>
</div>
</form>
</div>
.wallet-body {
width: fit-content;
margin: 0 auto;
float: left;
}
.form-group{
position: relative;
}
.form-group input {
border: 1px solid #2C2C2C;
height: 48px;
}
.qr-scanner-img {
width: 11%;
position: absolute;
top: 50%;
right: 0;
transform: translateY(-50%);
}
<div class="wallet-body">
<form class="form-pagar">
<div class="form-group">
<input type="amount" class="form-control" id="amount" placeholder="Monto">
</div>
<div class="form-group">
<input type="IDuser" class="form-control" id="IDuser" placeholder="Email del destinatario">
<a href="#">
<img class="qr-scanner-img" src="img/qr.svg" alt="qr"></a>
</a>
</div>
</form>
</div>

Make textbox be on both sides

I want to have something like this
instead I
My html code is this
`
<div id="myModal" class="modal">
<!-- Modal content -->
<div class="modal-content">
<div class="modal-header">
<form class="quote" action="javascript:void(0);">
<span class="close">×</span>
<article class="goright">
<input type="name" name="Name" placeholder="" style="width: 140px"><br>
<input type="lastname" name="lastname" placeholder="" style="width: 140px"><br>
<input type="Place" name="Place" placeholder="" style="width: 140px"><br>
</article>
<aside id="sidebar">
<textarea type="name" name="Name" placeholder="" style="height: 80px"></textarea> <br>
</aside>
</form>
</div>
</div>
</div>
And this is my CSS
.modal {
display: none;
position: relative;
z-index: 1;
padding-top: 100px;
left: 0;
top: -300px;
float: right;
width: 40%;
height: 40%;
overflow: auto;
}
.modal-content {
position: relative;
background-color: #fefefe;
margin:auto;
padding: 0;
border: 1px solid #888;
width: 80%;
-webkit-animation-name: animatetop;
-webkit-animation-duration: 0.4s;
animation-name: animatetop;
animation-duration: 0.4;
overflow: hidden;
}
article#goright
{
float: right;
}
aside#sidebar
{
float: left;
}
aside#sidebar .quote input, aside#sidebar .quote textarea
{
width: 90%;
padding: 5px;
}
so I tried to look up this thing here but I could not find an answer that works for me, I tried a lot of variations but nothing really works and I can not get the result, I only managed to get one side that is floated right and aside bar that is left but aside is under previous bar.
So, can you give me a hint or code that can help me achieve the desired result ?
You don't need to use <aside> and other CSS tweaks to achieve the structure.
Just move the <textarea> above the <input> tags and add a float:left class and float:right class to them respectively.
The width of the form is inherited from the .modal class.
Also <input> tags type attribute used are invalid. Supporting type attributes are as mentioned in: https://www.w3schools.com/tags/att_input_type.asp
Also <textarea> does not have a type attribute by default.
.modal {
width: 40%;
height: 40%;
overflow: auto;
}
.align-right {
float: right;
}
.align-left {
float: left;
}
.modal-content {
background-color: #fefefe;
-webkit-animation-name: animatetop;
-webkit-animation-duration: 0.4s;
animation-name: animatetop;
animation-duration: 0.4;
}
input {
margin-bottom: 5px;
}
<div id="myModal" class="modal">
<div class="modal-content">
<div class="modal-header">
<form class="quote" action="javascript:void(0);">
<textarea name="Name" placeholder="Textarea" style="height: 80px" class="align-left"></textarea>
<input type="text" name="Name" placeholder="Input A" style="width: 140px" class="align-right" />
<input type="text" name="lastname" placeholder="Input B" style="width: 140px" class="align-right" />
<input type="text" name="Place" placeholder="Input C" style="width: 140px" class="align-right" />
</form>
</div>
</div>
</div>
Here's an example of what you're trying to achieve -
.wrapper {
max-width: 500px;
}
.textarea-wrapper,
.input-wrapper {
float: left;
width: calc(50% - 10px);
}
.textarea-wrapper {
margin-right: 20px;
}
.textarea {
width: 100%;
height: 90px;
}
.input {
margin-bottom: 16px;
}
<div class="wrapper">
<div class="textarea-wrapper">
<textarea class="textarea"></textarea>
</div>
<div class="input-wrapper">
<input type="text" class="input" placeholder="Text 1">
<input type="text" class="input" placeholder="Text 2">
<input type="text" class="input" placeholder="Text 2">
</div>
</div>
Here's a link.
https://codepen.io/aphextwix/pen/MmZxjR
Take a look at this fiddle: https://jsfiddle.net/5xw7ssa4/
But you have some mistakes in your css:
Height should not be in %.
Both container must float to right.
Do not forget to clear:both after last floating element.
article#goright must be article.goright
In your html you have type="name" for example. It must be type="text".
Hi there you should review both your html markup and css as well bellow are my suggestions
css
.modal {
position: relative;
z-index: 1;
padding-top: inherit;
width: 50%;
height: 123px;
margin: 0 auto;
margin-top: 20px;
}
.modal-content {
position: relative;
background-color: #fefefe;
margin:auto;
padding: 0;
border: 1px solid #888;
width: 80%;
-webkit-animation-name: animatetop;
-webkit-animation-duration: 0.4s;
animation-name: animatetop;
animation-duration: 0.4;
}
form {
width: 100%;
padding: 10px 0px;
}
.close{
position: absolute;
right: 0;
color: #fff;
background: #000;
padding: 5px;
z-index: 3;
}
/*a classis identified by a "." an id is identified by an "#" so article#goright is wrong you should have wrote article.goright*/
article.goright {
float: left;
width: 50%;
}
aside#sidebar {
float: left;
width: 50%;
}
/* .quote is the form class aside is inside the form so instead of aside#sidebar .quote textarea you should write .quote aside#sidebar textarea */
.quote aside#sidebar input, .quote aside#sidebar textarea
{
width: 90%;
padding: 5px;
}
article.goright input {
width: 80%;
margin-bottom: 5px;
height: 20px;
}
/*very important to solve the issue*/
.clear{
width: 100%;
height: 0;
clear: both;
float: none;
}
html
<!DOCTYPE html>
<html>
<head>
<link rel="stylesheet" type="text/css" href="style.css">
<title>Testing Page</title>
</head>
<body style="width:100%; margin: 0 auto; padding: 0; text-align: center;">
<div id="myModal" class="modal">
<!-- Modal content -->
<div class="modal-content">
<div class="modal-header">
<form class="quote" action="javascript:void(0);">
<span class="close">×</span>
<aside id="sidebar">
<textarea type="name" name="Name" placeholder="" style="height: 80px"></textarea> <br>
</aside>
<article class="goright">
<input type="name" name="Name" placeholder=""><br>
<input type="lastname" name="lastname" placeholder=""><br>
<input type="Place" name="Place" placeholder=""><br>
</article>
<!-- this is the div you need to have myModal div cover the div inside it since they are floating left -->
<div class="clear"></div>
</form>
</div>
</div>
</div>
</body>
</html>

CSS alignment issue in different screen resolution

I have a header containing an image and search box. Both header area and results area are separate divs .
Search box is in header area. In left side of results div there are some menu items. I need to align my search box with results start area.
In .tk-bl-header I have added margin-left=5em to work. But when I move to different screen resolution it gets misaligned.
.tk-bl-header .tk-header-search-area {
display: inline-block;
float: left;
width: 43.75%;
padding-left: 1.5625%;
padding-right: 1.5625%;
position: relative;
color: black;
margin-left: 5em;
}
.searchform-container .searchform {
margin-bottom: 1em;
}
header .tk-bl-header h1 #logo a {
text-decoration: none;
}
a.library-logo {
background: url("../abc.jpg") no-repeat scroll left top transparent;
width: 110px;
height: 100px;
}
a.logo-name {
margin-top: 10px;
font-size: 20px;
}
div#second-header {
display: inline-block;
height: 65px;
position: relative;
width: 100%;
/* overflow: hidden; */
}
<header class="tk-bl-header">
<div id="second-header">
<h1 id="logo">
ABCD
</h1>
<div class="tk-header-search-area">
<div class="tk-header-search-form">
<div class="searchform-container ">
<form id="" class="searchform" action="" method="get" data-filters="">
<fieldset>
<legend>Search</legend>
<input type="text" name="q" class="query" value='${query.value.display}' placeholder="Search documents.." autocomplete="off" autocorrect="off" autocapitalize="off" spellcheck="false" required>
<input type="submit" class="submit" value="Search">
</fieldset>
</form>
</div>
</div>
</div>
<div id="col-right-top" class="sidebar col"></div>
</div>
</header>

centering div not working

I am trying to center the text and form field inputs in the #registration-code-entry .registration-code-entry-content div
Not sure what I am doing wrong.
http://jsfiddle.net/yLX4F/
<div id="registration-code-entry">
<div class="registration-code-entry-header"></div>
<div class="registration-code-entry-middle">
<div class="registration-code-entry-content">
<form class="registration-form">
<div class="field">
<input type="text" name="first_name" placeholder="*First Name" class="required" />
</div>
<div class="field">
<input type="text" name="last_name" placeholder="*Last Name" class="required" />
</div>
<div class="field">
<input type="email" name="email" placeholder="*Email Address" class="required" />
</div>
<div class="field">
<input type="text" name="phone" placeholder="Phone Number" />
</div>
<div class="field">
<input type="checkbox" name="optin">
<label for="optin" />Yes, I would like to receive more information</label>
</div>
<div class="field">
<input type="checkbox" name="accept" class="required" />
<label for="accept">*I accept the Official Rules.</label>
</div>
<input type="submit" class="submit-btn" value="">
</form>
</div>
</div>
<div class="registration-code-entry-footer"></div>
</div>
css
#registration-code-entry {
height: 100px;
width: 359px;
position: absolute;
top: 100px;
right: 20px;
background: transparent;
.registration-code-entry-header {
top: 0;
background: transparent url('../images/form-header.png') no-repeat;
width: 359px;
height: 17px;
}
.registration-code-entry-middle {
background: #713487;
.registration-code-entry-content {
border: 1px solid red;
width: 350px;
margin: 0 auto;
color: #fff;
form {
display: inline-block;
margin: 0 auto;
.field {
margin: 10px 0;
input[type="email"], input[type="text"] {
padding: 5px;
}
}
input.submit-btn {
background: transparent url('../images/submit-btn.png') no-repeat;
width: 168px;
height: 59px;
display: block;
border: 0;
}
}
}
}
.registration-code-entry-footer {
display: block;
bottom: 0;
background: transparent url('../images/form-footer.png') no-repeat;
width: 359px;
height: 11px;
}
}
You can add text-align: centerto .field. You can also change to display: block for form to make the form expand to the full width of the parent.
jsfiddle
Centering the input ?
This will centering it :
.field input[type="text"], .field input[type="email"] {
display:block;
margin: auto;
}
Check This
Just change youre less :
...
.field {
margin: 10px 0;
input[type="email"], input[type="text"] {
padding: 5px;
display:block;
margin:0 auto;
}
}
...