How to reposition a misplaced cursor/blinker in the textarea? - html

I have an issue where the cursor/blinker is right in the top left of the textarea with no margin or whatsoever. I don't know what could be causing this, the other inputs are working fine. Here is a screen shot:
I also wanna know how to change that black border color? I would like the border to stay the same when I click on it. I tried using textarea:focus to get rid of it but it's not working.
Lastly I wanna get rid of this whitish background when a form gets auto-completed, I haven't figured out how to get rid:
HTML:
<form class="form appear appear-hidden" method="post">
<h1>Contact Me</h1>
<div class="name-section">
<input type="name" placeholder="Name" required />
<input type="surname" placeholder="Surname" required />
</div>
<input type="email" placeholder="Email" required />
<textarea
class="message"
type="message"
placeholder="Message"
row="4"
required
></textarea>
<input class="submit" type="submit" placeholder="submit" />
</form>
CSS:
.name-section input {
width: 48%;
margin: 5px;
border: 2px solid white;
padding: 10px;
background-color: transparent;
font-weight: 600;
}
form input {
width: 98%;
margin: 5px;
border: 2px solid white;
padding: 10px;
/* background-color: #000; */
background-color: transparent;
font-weight: 600;
color: white;
font-family: 'Poppins', sans-serif;
}
input::placeholder {
font-family: 'Poppins', sans-serif;
color: white;
font-weight: 600;
}
input:focus {
border: 1px solid white;
}
textarea {
min-height: 100px;
background-color: transparent;
color: white;
font-family: 'Poppins', sans-serif;
width: 98%;
margin: 5px;
border: 2px solid white;
resize: none;
font-weight: 600;
}
textarea::placeholder {
color: white;
padding: 10px;
margin: 10px;
font-weight: 600;
}
Thanks in advance for the help.

You have no padding in your Textaria, try this: remove padding from textarea::placeholder and add padding to .message :
textarea::placeholder {
margin: 10px;
font-weight: 600;
}
.message{
padding:10px;
}
To remove the "black-border-color:
input:focus{
outline:solid 3px blue;
}
I didn't understand what you mean by this: "Lastly I wanna get rid of this whitish background when a form gets auto-completed, I haven't figured out how to get rid:"

Related

Is it possible to style the text font that the user input in a contactform

I ask this because the text that the user inputs in the textarea is different from the another fields.
The font style is different. How can I change to font style of this field area?
First of all I want to fix that and after that if styling is possible I want to learn how.
.contact-form {
background-color: white;
}
input,
select,
textarea {
background-color: #f2f2f2;
display: block;
margin: auto;
font-size: 1em;
padding: 25px;
border: none;
outline: none;
margin-top: 20px;
margin-bottom: 16px;
box-sizing: border-box;
resize: vertical;
}
input[type=submit] {
font-family: avenir_nextdemi_bold;
background-color: #437bff;
font-size: 1.2em;
color: white;
padding: 12px 20px;
border-radius: 30px;
width: 15%;
border: none;
cursor: pointer;
}
input[type=submit]:hover {
background-color: #133edb;
}
::placeholder {
font-family: avenir_nextdemi_bold;
}
textarea {
height: 200px;
}
<form action="/action_page.php">
<input type="text" id="lname" name="lastname" placeholder="Naam" required>
<input type="email" id="email" name="email" placeholder="Email adres" required>
<textarea id="subject" name="subject" placeholder="Vertel ons over je project" required></textarea>
<input type="submit" value="Submit">
</form>
All you need to do is add font-family: sans-serif; Here is how it would look in the code:
input,
select,
textarea {
background-color: #f2f2f2;
display: block;
margin: auto;
font-size: 1em;
padding: 25px;
border: none;
outline: none;
margin-top: 20px;
margin-bottom: 16px;
box-sizing: border-box;
resize: vertical;
font-family: sans-serif;
/* You can change the font if you want but based on what I saw I assumed
you wanted sans-serif. It would also be helpful for you to specify what you mean
style text */
}

How to move typed text inside the input element?

I made some input boxes with 0 20px padding placeholders. However the text I type inside ignores padding and starts from the exact left side (from the left outline). Is there any possibility to position it inside the input field?
HTML:
<div class="input-border">
<label for="sign-login"><i class="fas fa-envelope"></i></label>
<input type="text" name="sign-login" placeholder="Enter your Email">
</div>
CSS:
input::placeholder {
font-size: 16px;
font-family: $font-base;
color: #979797;
padding: 0 20px;
height: 38px;
}
.input-border {
width: 340px;
margin: 10px 0;
border: 1px solid #DEDEDE;
border-radius: 0.5em;
}
I'd like the text I type to start from the same place as my placeholder is
in this case with 0 20px padding.
target the input text input[type=text]{padding:0 20px;}
input::placeholder{
font-size: 16px;
font-family: $font-base;
color: #979797;
padding: 0 20px;
height: 38px;}
.input-border
form .input-container .input-border {
width: 340px;
margin: 10px 0;
border: 1px solid #DEDEDE;
border-radius: 0.5em;}
input[type=text]{padding:0 20px;}
<div class="input-border">
<label for="sign-login"><i class="fas fa-envelope"></i></label>
<input type="text" name="sign-login" placeholder="Enter your Email">
</div>
Use this to add padding to the placeholder.
input::placeholder {
padding: 0 20px;
}
Use this to add padding to input text.
input {
padding: 0 20px;
}
CSS:
.center {
text-align: center;
margin: 0;
}

How can I set the spacing between input elements in CSS?

How can I make the Email and Password fields separated by the exact height of their icons? I tried using line-height but it only seems to work on text.
Of course I could simply look at the height of the icon in Firefox's Web Inspector and then say margin-bottom: xx px, but is that really the best way to do it?
My code looks like this:
<form class="signup-field">
<h1>Enter your email to start.</h1>
<h2>Choose a strong password.</h2>
<div class="input-group">
<span class="input-group-addon"></span>
<input type="text" class="form-control" placeholder="Email" /><br />
</div>
<div class="input-group">
<span class="input-group-addon"></span>
<input type="password" class="form-control" placeholder="Password" /><br />
</div>
<div class="input-group t-c-submit">
<input type="checkbox">I agree to the terms and conditions.
<button type="button" class="button">Get Started</button>
</div>
</form>
and my CSS looks like this:
#font-face {
font-family: "simple-line";
src: url("simple-line-icons-24.woff") format('woff');
}
.container {
max-width: 880px;
}
.signup {
background-color: #48b7d6;
color: #fff;
font-family: Montserrat;
}
.signup h1 {
font-size: 3.2em;
}
.signup h2 {
font-size: 1.188em;
}
.signup-field input {
background: none;
border-left: none;
border-right: none;
border-top: none;
border-bottom: 1px dotted #dce3e7;
margin: 10px;
color: #fff;
}
.signup-field input::placeholder {
color: #fff;
}
.signup-field button {
float:right;
font-size: 1.188em;
background: none;
color: #fff;
border: 1px solid #dce3e7;
margin: 12px;
min-width: 140px
}
.signup-field button:hover {
background-color: #2fa1ba;
}
.signup-field .input-group-addon {
font-family: simple-line;
font-size: 1.188em;
border: 1px solid #dce3e7;
background: none;
border-radius: 0;
color: #fff;
}
/* Bootstrap overrides (also the above 3 lines) */
.input-group {
width: 100%;
line-height: 200%;
}

Font Awesome with easyAutocomplete plugin

I have a form in which I want to show the input text field and submit on the same line. The input text field has two FontAwesome icons which I want to show inside the text field. I can style the form as I want when I don't use the easy Autocomplete plugin. But when I activate the easyAutocomplete plugin, the styling goes haywire.
Here's the code:
HTML:
<form role="search" method="get" id="searchform" class="searchform" action="">
<span class="fa fa-map-marker my-fa"></span>
<input type="text" value="" name="s" id="search-input" class="s" placeholder="Enter your Postcode" autocomplete="off">
<img id="slider-loading" class="loading" src="https://www.imageupload.co.uk/images/2017/02/05/gps2.gif" />
<input type="hidden" value="profile" name="post_type" id="post_type" />
<input type="hidden" value="country" name="taxonomy" />
<input type="submit" id="searchsubmit" value="GO" class="submit btn" />
</form>
jQuery
var options = {
data: ["Cyclops", "Storm", "Mystique", "Wolverine", "Professor X", "Magneto"],
theme: "dark"
};
$("#search-input").easyAutocomplete(options);
CSS:
.searchform {
position: relative;
text-align: center;
}
.searchform input[type="text"] {
width: 400px;
font-size: 15px;
margin: 0px -3px 0px 0px;
text-indent: 18px;
padding: 15px;
text-transform: uppercase;
letter-spacing: 1px;
font-weight: 300;
font-family: 'Raleway', sans-serif;
border: solid 1px #bbb;
overflow: hidden;
border-radius: 4px;
}
.searchform input[type=text],
.searchform input[type=text]:focus {
outline: none;
}
.searchform input[type=text]:focus {
border: none;
}
.searchform input[type="submit"] {
background-color: #f70808;
-webkit-box-shadow: 0 2px 0 #c60606;
-moz-box-shadow: 0 2px 0 #c60606;
box-shadow: 0 2px 0 #c60606;
color: white;
border: none;
letter-spacing: 1px;
padding: 15px;
font-size: 15px;
text-align: center;
}
.searchform input[type="submit"],
.searchform input[type="text"] {
line-height: normal !important;
display: inline-block;
}
.my-fa {
font-family: 'FontAwesome';
position: absolute;
z-index: 2;
color: #f70808;
font-size: 2.8em;
margin-left: 4px;
top: 4px;
}
#slider-loading {
position: relative;
top: 12px;
right: 35px;
}
I want to show the map icon on the left of the input text field and and the loading spinner on the right of the input text field.
JSFiddle - with easyAutocomplete plugin
JsFiddle - without the plugin
You could add the following code to your CSS:
.easy-autocomplete{
display:inline;
}
I think it gives you the desired outcome.
The plugin wraps the input in a div which by default have display:block and it throws the other elements out of line.
You may need to adjust the padding/margin to your preference.
See updated fiddle

css on different input classes

hello i have the following problem:
i do check my form for some php error messages.
in case of no error i simply have my css setting:
.wrapper #frame form fieldset ul input {
color: #f23;
font-size: 10px;
height: 18px;
padding-left: 5px;
margin-top: 3px;
outline:none;
}
and my focus settings:
.wrapper #frame form fieldset ul input:focus{
color:#fff;
font-weight: bold;
border: 2px solid #fff;
}
okay, now i changed this line:
<input type="text" id="normal" name="1" value=""/>
with adding the class of error:
<input class="err" type="text" id="normal" name="1" value=""/>
the problem is that my settings just take place for my class details on the input fields but not on my focus settings:
.err {
color: #444444;
font-size: 10px;
width: 180px;
height: 18px;
padding-left: 5px;
outline:none;
background-image: url(../images/error.png);
}
.err input:focus{
color:#f23;
font-weight: bold;
border: 2px solid #f23;
}
so if there is someone who could tell me why this does not work i really would appreciate. thanks a lot.
You have a class of error in your HTML, and in your CSS you've set the class to err; if you use the same name consistently (whichever you choose) it should work.
Your current HTML:
<input class="error" type="text" id="normal" name="1" value=""/>
...and CSS:
.err {
color: #444444;
font-size: 10px;
width: 180px;
height: 18px;
padding-left: 5px;
outline:none;
background-image: url(../images/error.png);
}
.err input:focus{
color:#f23;
font-weight: bold;
border: 2px solid #f23;
}
Also, in your CSS you're selecting an input that's a descendant of an element with the err class-name, not an input element with that class-name. So, altogether you should use something like:
<input class="err" type="text" id="normal" name="1" value=""/>
input.err {
color: #444444;
font-size: 10px;
width: 180px;
height: 18px;
padding-left: 5px;
outline:none;
background-image: url(../images/error.png);
}
input.err:focus{
color:#f23;
font-weight: bold;
border: 2px solid #f23;
}