Form - cannot select or high-light text in Field - html

I am having this really weird issue where I cannot highlight my text in my form fields.
I cannot seem to figure out what the issue is, since everything but that seems to be working correctly.
I can't seem to understand where the problem lies - it doesn't work on Chrome or Safari.
{
position:relative;
width:100%;
margin-bottom:-20px;
}
.outerForm img {
width:800px;
text-align: center;
margin-left: auto;
margin-right: auto;
}
form {
display: table;
position:absolute;
top:0px;
left:0px;
right:0px;
margin-left: auto;
margin-right: auto;
color:black;
width:600px;;
height:300px;
margin-top: 100px;
}
.innerForm > input, .innerForm > label {
display: inline-block;
vertical-align: top;
margin-left: 5px;
margin-top: 25px;
margin-right: 5px;
}
.innerForm > label {
width:70px;
text-align: left;
}
#messageLabel {
}
input[type="text"] {
width:200px;
height:30px;
border:none;
outline:none;
box-shadow: none;
background-color:transparent;
border-bottom: 1px solid black;
}
textarea {
resize: vertical;
width:85%;
border:none;
outline:none;
box-shadow: none;
background-color: transparent;
padding-bottom: 18%;
border-bottom: 1px solid black;
margin-top: 20px;
}
textarea:focus {
border:none;
outline:none;
background-color: transparent;
box-shadow: none;
border-bottom: 1px solid red;
}
.innerForm > h4 {
margin-bottom:-10px;
text-transform:none;
font-family: 'Novecento sans wide';
}
input[type="text"]:focus, input[type="textarea"] {
border:none;
outline:none;
background-color:transparent;
box-shadow: none;
border-bottom:1px solid red;
}
#submitBtn {
background-color:transparent;
color:black;
font-weight:400;
border:none;
outline:none;
border:2px solid white;
padding:10px 20px 10px 20px;
font-size: 15px;
margin-top:15px;
transition: all 0.5s ease;
}
#submitBtn:hover {
background-color: #0080ff;
color:white;
}
<div class="outerForm">
<img id="cardImage" class="img-responsive" src="PlayingCardTemplate.png"/>
<form id="contactForm" action="Contact.php" method="POST">
<div class="innerForm">
<h4>Arshdeep Soni</h4>
<label id="nameLabel" for="name">Name:</label>
<input id="name" name="name" type="text"/>
<label id="phoneLabel" for="phone">Phone:</label>
<input id="phone" name="phone" type="text"/>
<label id="emailLabel" for="email">Email:</label>
<input id="email" name="email" type="text"/>
<label id="occasionLabel" for="occasion">Occasion:</label>
<input id="occasion" type="text" name="occasion"/>
<label id="messageLabel" for="message">Message:</label>
<textarea id="message" name="message" ></textarea>
<input type="submit" value="Submit" id="submitBtn" name="submit"/>
</div>
<p id="feedback"></p>
</form>
</div>

Look for ::selection inside the CSS Stylesheet.
An imported stylesheet or a theme might be include ::selection{background:transparent
for multiple reasons.
looking for that class and editing it can be solve the issue.
Also you can add color: in order to color the text inside your selection.
For mozilla use ::-moz-selection

Related

How can I stop my form overlaping my header

<?php
// Start the session
session_start();
?>
<html>
<head>
<title>Student Registeration</title>
<link rel="stylesheet" src="text/css" >
<style>
.login-box
{
width:280px;
position:relative;
top:30%;
left:50%;
transform: translate(-50%,-50%);
color:black;
}
h1
{
margin: 0;
float:left;
font-size:38px;
border-bottom: 6px solid gold;
margin-bottom: 40px;
padding:0 0 20px;
text-align:center;
}
.login-box p
{
margin: 0;
padding: 0;
font-size: 18px;
}
.login-box input
{
width: 100%;
overflow: hidden;
margin-bottom: 20px;
margin: 8px 0;
padding:9px 0;
}
.login-box input\[type="text"\], input\[type="password"\], input\[type="email"\]
{
border: none;
outline: none;
border-bottom: 1px solid gold;
background: none;
color:gold;
font-size: 16px;
width:100%;
float:left;
}
.button
{
font-family: century gothic;
border: none;
color: white;
padding: 15px 30px;
text-align: center;
text-decoration: none;
display: inline-block;
font-size: 16px;
margin: 10px 2px;
cursor: pointer;
border-radius: 19px;
background-image: linear-gradient(to right, gold , black);
}
</style>
</head>
<body>
<?php
include'header.php';
?>
<div class="login-box">
<form method="post" action="authen.php" <?php echo $_SERVER\['PHP_SELF'\]; ?>>
<h1>Create Account</h1>
<p><b>Full Name : </b></p>
<input type="text" class="textarea" id="fname" name=" fname" placeholder="Full Name" style="width:100%;" name="fname" pattern="\[A-Za-z \]+" required >
<p><b>Email :</b></p>
<input type="email" class="textarea" id="email" placeholder="Email" style="width:100%;" name="email" pattern="\[a-z0-9._%+-\]+#\[a-z0-9.-\]+\.\[a-z\]{2,}$" required>
<p><b>Username :</b></p>
<input type="text" id="user" class="textarea" placeholder="Username" style="width:100%;" name="user" pattern="\[A-Za-z0-9\]{5,}" required>
<p><b>Phone :</b></p>
<input type="text" id="phno" class="textarea" placeholder="Phone Number" style="width:100%;" name="phno" pattern="\[0-9\]{10}" required>
<p><b>Password :</b></p>
<input type="password" id="pass" placeholder="Password" class="textarea" style="width:100%;" name="pass" pattern="\[A-Za-z0-9\]{6,}" required>
<p><b>Confirm Password :</b></p>
<input type="password" id="cpass" class="textarea" placeholder="Confirm Password" style="width:100%;" name="cpass" pattern="\[A-Za-z0-9\]{6,}" required>
<p><b>Choose the following:</b></p>
<input type="radio" class="textarea" id="pfaculty" name="Faculty" value="Permanent faculty" required >Permanent Faculty
<input type="radio" class="textarea" id="vfaculty" name="Faculty" value="Visiting faculty" required >Visiting Faculty
<input type="submit" name="submit" class="Button"id="btn" value="Submit">
</form>
</div>
</body>
</html>
header.css
/*Index CSS*/
body{
color:#008080;
font-family:Century Gothic;
position: relative;
}
/*Naavigation Bar*/
div{
height:70px;
}
a{
color: #f2f2f2;
text-align: center;
text-decoration: none;
}
#Name{
float: left;
color: #f2f2f2;
text-align: center;
padding: 2px 5px;
font-size: 30px;
margin-top:12px;
}
.header {
overflow: hidden;
background-color: black;
position: fixed;
width: 100%;
top: 0;
}
.links{
float: right;
display: block;
color: #f2f2f2;
text-align: center;
margin-top:10px;
text-decoration: none;
padding: 14px 16px;
font-size: 20px;
}
.links:hover {
background-color: white;
color: #008080;
border-radius: 10px;
transition: 0.2s;
}
.header .icon {
display: none;
}
#media screen and (max-width: 600px) {
.links.icon {
float: right;
display: block;
}
}
#media screen and (max-width: 600px) {
.header.responsive {
position: relative;
}
.header.responsive a {
float: none;
display: block;
text-align: left;
}
}
]1]1
Here in this code I have problem that my form overlaps my header
When I scroll down in the page it scrolls the form and overlap the header.
As I have given a picture you can see my form overlaps my header which should not happen. It should not crossover the header thats the problem.
And my radion button text is also not coming in proper format I have tried a lot things but it is not happening. So please anyone can resolve this error.
Give z-index (any value you want but greater than your form) to your header and if there is no position property in your header, add position: relative.

Align Class containing a class

image 1
I want to set the class first to the right of the class second containing form . I want to keep the class first inside the form that is below Please share your experience. I can do that be using margin left and margin right. How to achieve this using floats or any other way.
body, select, input, textarea, button, h1, h2, h3, h4, h5, h6 {
font-family: Hind;
line-height: 1.2;
}
input[type="text"], input[type="password"], input[type="email"], input[type="url"], input[type="tel"], input[type="date"], textarea {
margin-left: 0px;
}
input:focus {
outline: none !important;
border:1px solid green;
box-shadow: 0 0 10px #719ECE;
}
textarea:focus {
outline: none !important;
border:1px solid red;
box-shadow: 0 0 10px #719ECE;
}
#exitpopup-modal .modal-body {
padding:0px;
}
.modal-body {
padding: 0px;
}
.first
{
margin-left:12%;}
.second img {
width: 369px;
height: 404.6px;
margin-top: -1%;
}
.second form{
display:table;
margin-left: 37px;
margin-top: 29px;
}
.row1{
font-size: 10px;
font-family: inherit;
display: table-row;
border: 2px solid red;
}
.row1 #name,#mail,#contact{
color:black;
width: 260px;
height: 34px;
padding: 6px 12px;
border-radius:3.9px;
border-color: #777;
display:table-cell;
}
.row1 textarea{
width: 260px;
height: 110px;
color:black;
border-color: #777;
display:table-cell;
}
.row1 #submit{
width:152px;
height: 44px;
margin-left:15%;
background-color:#337ab7;
color:white;
border-color:none;
}
.row1 #submit:hover{
width:152px;
height: 44px;
margin-left:15%;
background-color:white;
color:#337ab7;
border-color:none;
}
.second,.first{
float: left;
}
.clearfix{
clear:both
}
.titan{
text-align:center;
font-family: inherit;
font-size: 20px;
padding-top: 38px;
}
<div class="second">
<form id="form" name="theform" action="javascript:myformsubmit()">
<div class="row1">
<input id="name" type="text" placeholder="Your name *" required><br><br>
</div>
<div class="row1">
<input type="email" id="mail" placeholder="Your email *" required><br><br>
</div>
<div class="row1">
<input id="contact" type="number" placeholder="Your phonenumber*" required><br><br>
</div>
<div class="row1">
<textarea id="reason" rows="5" placeholder="Any reason to leave ?*" required></textarea><br><br>
</div>
<div class="first">
<input type="radio" name="experience" value="I am happy and purchased/will purchase" checked> I am happy and purchased/will purchase<br>
<input type="radio" name="experience" value="You are not selling in my city"> You are not selling in my city<br>
<input type="radio" name="experience" value="You do not have the product i am looking for"> You do not have the product i am looking for<br>
<input type="radio" name="experience" value="I find your prices higher than market"> I find your prices higher than market<br>
</div>
<div class="row1">
<input id="submit" type="submit" value="Submit" >
</div>
</form>
</div>
<div class="titan">Please share your experience </div>
<div class="clearfix"></div>
Updated jsfiddle. When you are in small screens you should use #media queries to change your input width and it will work even in mobile screen.
#form , .first{
display:inline-block;
}
.first{
float:right;
margin:25px;
}

Floating my button to the right is not working

I´m here with a strange situation, trying to float my button input[type="submit"] to the right.
I have space there and so I´m floating the button to the right to stand beside my input text.
But the float is not working and the button is not going, in any way, to the right.
My jsfiddle with problem illustrated:
http://jsfiddle.net/ritz/5Nq2N/1/
My Html:
<footer id="footer-container">
<section id="footer1">
<div id="col">
<h1>NEWSLETTER</h1>
<p>Register in our Newsletter.</p>
<form action="" name="newsletter" method="post" enctype="multipart/form-data">
<label id="email-label2">
<i class="fa fa-envelope-o"></i>
<input type="text"id="email2" name="email" placeholder="e-mail" required/>
</label>http://jsfiddle.net/#save
<br />
<label id="submit">
<input type="hidden" name="news_register" value="register" />
<input type="submit" name="register" value="Register" src="" />
</label>
</form>
</div>
</footer>
My Css:
#footer-container
{
width:100%;
float:left;
background:brown;
height:auto;
}
#footer1
{
width:320px;
margin:15px 10px 15px 10px;
height:auto;
}
#col
{
float:left;
margin-right:53px;
}
#col h1
{
border-bottom:1px dashed #ccc;
font-family:'bariol_boldbold';
color:#fff;
width:300px;
font-size:17px;
font-weight:bold;
margin-bottom:10px;
}
#col p
{
width:300px;
color:#fff;
text-align:justify;
color:#ccc;
font-size:14px;
font-family:'bariol_regularregular';
margin-bottom:10px;
}
input[type="text"]
{
font-size: 14px;
line-height: 20px;
padding: 4px 3px;
}
#email2
{
padding-left: 20px;
text-indent:5px;
width:172px;
height:18px;
-webkit-border-radius: 5px;
-moz-border-radius: 5px;
border-radius: 5px;
font-family:'Tahoma';
font-size:14px;
color:#000;
}
input[type="submit"]
{
float:right;
margin-right:5px;
text-align: left;
font-family: 'Tahoma';
font-size: 14px;
color: #333;
margin-top:10px;
outline:none;
background: blue;
-webkit-border-radius: 8px;
-moz-border-radius: 8px;
border-radius: 8px;
outline:none;
cursor: pointer;
color:#fff;
width: 70px;
height: 26px;
text-align:center;
border:1px solid #3c3412;
margin-bottom:15px;
}
You had a couple of problems with the semantics and broken tags. I fixed it up and and updated the CSS:
http://jsfiddle.net/5Nq2N/3/
Tips:
Don't place input fields inside label elements. Labels should describe the input field and sit above them. <label for="email">Enter your email</label>
Float the container with your items in it, the containers will stack against each other.
Clear your floats ;)
Read CSS Mastery by Andy Budd, its a great foundation.
<footer id="footer-container">
<section id="footer1">
<div id="col">
<h1>NEWSLETTER</h1>
<p>Register in our Newsletter.</p>
<form action="" name="newsletter" method="post" enctype="multipart/form-data">
<div id="email-label2">
<i class="fa fa-envelope-o"></i>
<input type="text"id="email2" name="email" placeholder="e-mail" required />
</div>
<div id="submit">
<input type="hidden" name="news_register" value="register" />
<input type="submit" name="register" value="Register" />
</div>
<div class="clear"></div>
</form>
</div>
</section>
</footer>
.clear {
clear: both;
}
#footer-container
{
width:100%;
float:left;
background:brown;
height:auto;
}
#footer1
{
width:320px;
margin:15px 10px 15px 10px;
height:auto;
}
#col
{
float:left;
margin-right:53px;
}
#col h1
{
border-bottom:1px dashed #ccc;
font-family:'bariol_boldbold';
color:#fff;
width:300px;
font-size:17px;
font-weight:bold;
margin-bottom:10px;
}
#col p
{
width:300px;
color:#fff;
text-align:justify;
color:#ccc;
font-size:14px;
font-family:'bariol_regularregular';
margin-bottom:10px;
}
input[type="text"]
{
font-size: 14px;
line-height: 20px;
padding: 4px 3px;
}
#email2
{
padding-left: 20px;
text-indent:5px;
width:172px;
height:18px;
-webkit-border-radius: 5px;
-moz-border-radius: 5px;
border-radius: 5px;
font-family:'Tahoma';
font-size:14px;
color:#000;
float: left;
}
#submit {
float: left;
margin: 5px 0px 0px 5px;
}
input[type="submit"]
{
text-align: left;
font-family: 'Tahoma';
font-size: 14px;
color: #333;
outline:none;
background: blue;
-webkit-border-radius: 8px;
-moz-border-radius: 8px;
border-radius: 8px;
outline:none;
cursor: pointer;
color:#fff;
width: 70px;
height: 26px;
text-align:center;
border:1px solid #3c3412;
margin-bottom:15px;
}
Ignoring the float, your layout looks like this:
/----------------Container------------------\
| [Text input here] |
| [Submit button here] |
\-------------------------------------------/
Now let's factor in the float:right:
/----------------Container------------------\
| [Text input here] |
| [Submit button here] |
\-------------------------------------------/
See how even though there's room, it's not magically moving up.
Now, let's try moving the submit button to be before the text input in your layout:
/----------------Container------------------\
| [Submit button here] |
| [Text input here] |
\-------------------------------------------/
Result with float:
/----------------Container------------------\
| [Text input here] [Submit button here] |
\-------------------------------------------/
Yay! But... having the submit button before the text is not very semantic at all. What else can be done?
Well, you could try removing the <br /> tag.
Adjust margins as needed!

IE 8.0 and Chrome form formatting issue

I have the below CSS code written for the form,
.formcontainer{
border-radius: 10px;
-moz-border-radius: 10px;
-webkit-border-radius: 10px;
box-shadow: 0 0 4px #ccc;
-webkit-box-shadow: 0 0 4px #ccc;
-moz-box-shadow: 0 0 4px #ccc;
border:1px solid #ccc;
padding:15px;
width: 740px;
margin:0 auto;
}
form {
margin:0 auto;
text-align:left;
width:100%;
background:#fff;
behavior: url(./border-radius.htc);
font-family:Calibri;
height: auto;
}
fieldset.border{
overflow:hidden;
border:1;
-moz-border-radius:5px;
border-radius: 5px;
-webkit-border-radius: 5px;
margin:3px 0;
}
fieldset.no_border{
overflow:hidden;
border:0;
margin:3px 0;
}
fieldset.no_border_submit{
overflow:hidden;
border:0;
text-align:center;
margin:3px 0;
}
input.effect {
float:left;
border:1px solid #ccc;
height: 20px;
padding:3px;
width:97%;
font-size:14px;
-moz-border-radius: 5px;
-webkit-border-radius: 5px;
border-radius: 5px;
}
.cssSubmitButton {
font-size: 12px;
background: #fff no-repeat 4px 5px;
display: inline-block;
padding: 5px 20px 6px;
color: #333;
border:1px solid #ccc;
text-decoration: none;
font-weight: bold;
line-height: 1.9em;
border-radius: 15px;
-moz-border-radius: 15px;
-webkit-border-radius: 15px;
-moz-box-shadow: 0 1px 3px #999;
-webkit-box-shadow: 0 1px 3px #999;
position: relative;
cursor: pointer;
outline:none;
}
.cssSubmitButton:visited {}
.cssSubmitButton:hover {
border:1px solid #333;
}
#personal_details span{
margin-left: 50px;
color: #b1b1b1;
font-size: 11px;
font-style: italic;
}
.ui-datepicker{
font-size:12px;
}
#guardian_one_details{
display:none;
}
#guardian_two_details{
display:none;
}
#guardian_three_details{
display:none;
}
#nominee_one_details{
display:none;
}
#nominee_two_details{
display:none;
}
#nominee_three_details{
display:none;
}
#nominee_percentage{
display:block;
}
#total_nominees{
display:none;
}
#first_nominee_percent{
display:none;
}
#second_nominee_percent{
display:none;
}
#third_nominee_percent{
display:none;
}
#nominee_percent_allocation{
display:none;
}
.float_left {
float:left;
width:33%;
}
.float_left_nominee_percent {
float:left;
width:25%;
}
.float_left_guardian {
float:left;
width:69%;
}
.float_right_guardian {
float:left;
width:29%;
}
The problem is that the form is rendered properly in Chrome but in IE 8 the fields are too close to each other.
How can I get the rendering done in IE and Chrome as it is in Chrome.
Form in IE
Form in Chrome
I want the spacing to be done properly in IE as it is in Chrome.
My html code (partially)
<form id="personal_details" name="personal_details" action="">
<fieldset class="no_border">
<div class="float_left">
<input type="radio" value="nominee_no" name="nomination" id="nomination_no"/>I don't want to nominate.
</div>
<div class="float_left">
<input type="radio" value="nominee_yes" name="nomination" id="nomination_yes"/>I would like to nominate.
</div>
<div class="float_left" id="total_nominees">
Total Nominees:
<select name="nominees" id="nominees" class="effect">
<option value="one">Single Nominee</option>
<option value="two">Two Nominees</option>
<option value="three">Three Nominees</option>
</select>
</div>
</fieldset>
<fieldset class="border" id="nominee_one_details"><legend>Nominee One Details:</legend>
<fieldset class="no_border">
<label>Name:</label><br /><input type="text" class="effect" name=""/>
</fieldset>
<fieldset class="no_border">
<label>Address:</label><br /><input type="text" class="effect"/>
</fieldset>
<fieldset class="no_border">
<div class="float_left"><label>Date of Birth:</label><br /><input type="text" class="effect" name="input" id="nominee_one_dob" style="width:40%";/></div>
<div class="float_left"><label>Age in years:</label><br /><input readonly="readonly" type="text" class="effect" name="input" id="nominee_one_years" value="0" style="width:20%;" /></div>
<div class="float_left"><label>Relationship:</label><br /><input type="text" class="effect" style="width:95%" /></div>
</fieldset>
<fieldset class="no_border" id="guardian_one_details">
<div class="float_left_guardian">
<label>Guardian Name:</label><br /><input type="text" class="effect" /></div>
<div class="float_right_guardian"><label>Guardian PAN:</label><br /><input type="text" class="effect" /></div>
</fieldset>
</fieldset>
use the following style in css
fieldset.no_border{
overflow:hidden;
border:0;
padding:0;
margin:0 0 10px 0;
}
.float_left_guardian{
overflow:hidden;
margin-bottom:10px;
}
hope this will solve your issue.

submit button cross browser positioning

So i'm trying to make a login box with 2 fields and a submit button. The submit button position itself differently in EVERY browser. In Firefox it works as expected but in IE8 and Safari the vertical alignment gets screwed up. Any ideas to resolve this problem?
Here's a screendump of the issue: http://gefuhlkunder.dk/bla.jpg
<form action="">
<div>
<input type="text" name="brugernavn" class="login-input" value="Brugernavn" />
<input type="text" name="brugernavn" class="login-input" value="password" />
<input class="login-submit" type="submit" value="login" />
</div>
</form>
.login-input{
border:1px solid #bebebe;
font-family: 'FlamaBook', sans-serif;
font-size:10px;
letter-spacing:-0.4px;
text-transform:uppercase;
color:#464646;
font-size-adjust: 0.5;
height:18px;
line-height:18px;
text-align:center;
width:69px;
margin:0 3px 0 0;
}
.login-submit{
border:1px solid #bebebe;
font-family: 'FlamaBook', sans-serif;
font-size:10px;
letter-spacing:-0.4px;
text-transform:uppercase;
color:#464646;
font-size-adjust: 0.5;
text-align:left;
position:absolute;
padding: 0px 0px 0 3px;
width:59px;
height:20px;
line-height:20px;
background:#fff url(images/submit_bg.png);
cursor:pointer;
}
Try these
.login {
font-family: sans-serif;
font-size:10px;
border:1px solid #bebebe;
text-transform:uppercase;
text-align:center;
color:#464646;
cursor:pointer;
padding:3px;
margin-right:3px;
}
.login-submit {
margin-top:3px;
}
and
<form action="">
<div>
<input type="text" name="brugernavn" class="login login-input" value="Brugernavn" />
<input type="text" name="brugernavn" class="login login-input" value="password" />
<input class="login login-submit" type="submit" value="login" />
</div>
This is the best I could do so far using tables (checked on Firefox, Chrome and IE8). You can however notice a small discrepancy in IE8.
If you use this code, u need to put a background image in your button. Any text would mess up the layout. Can't believe it is so tricky to even try do such a simple things.
<table border="0" cellpadding="0" cellspacing="0">
<tr>
<td class="firstTd">
<div class="styleOne">
<input id="searchEntry" value="" title="Search" size="41" type="text" name="searchEntry"/>
</div>
</td>
<td>
<div>
<button value="Search" class="buttonStyle" type="submit" name="myButton">
<span></span>
</button>
</div>
</td>
</tr>
</table>
table {
width: 342px;
display: table;
border-collapse: separate;
border-spacing: 2px;
border-color: gray;
position: relative;
border-bottom: 1px solid transparent;
}
tbody {
display: table-row-group;
vertical-align: middle;
border-color: inherit;
}
tr {
display: table-row;
vertical-align: inherit;
border-color: inherit;
}
td, th {
display: table-cell;
vertical-align: inherit;
}
td.firstTd{
width: 281px;
}
div.styleOne {
background-color: #fff;
border: 1px solid #d9d9d9;
border-top-color: #c0c0c0;
height: 27px;
display: block;
width: 281px;
}
input#searchEntry{
font-size: 20px;
width: 278px;
}
button.buttonStyle{
padding: 12px 22px;
}
Try with:
height:18px;
margin: 3px 0 0;