HTML Input Required is messing up my input

So I dont want to use the "Required" attribute, but in my if I dont put it in there it completely messes up the way I want my form to look.

So why does removing this change it? Its setup so when you click Email it will then move out of the way and look like the one that says password.

here is my html for this:

    <form action="./includes/login.inc.php" method="post">
        <div class="group">
            <input type="text" name="emailuid" required=""/><span class="highlight"></span><span class="bar"></span>
            <label>Email</label>
        </div>
        <div class="group">
            <input type="password" name="pwduid"/><span class="highlight"></span><span class="bar"></span>
            <label>Password</label>
        </div>
        <div class="btn-box">
            <button class="btn btn-submit" type="submit" name="login-submit">Sign in</button>
        </div>
    </form>

And here is my CSS styling (Just for the forms!)

form {
  width: 320px;
  margin: 45px auto;
}
form h1 {
  font-size: 3em;
  font-weight: 300;
  text-align: center;
  color: #2196F3;
}
form h5 {
  text-align: center;
  text-transform: uppercase;
  color: #c6c6c6;
}
form hr.sep {
  background: #2196F3;
  box-shadow: none;
  border: none;
  height: 2px;
  width: 25%;
  margin: 0px auto 45px auto;
}
form .emoji {
  font-size: 1.2em;
}

.group {
position: relative;
margin: 45px 0;
}

textarea {
resize: none;
}

input,
textarea {
background: none;
color: #4F4F4F;
font-size: 18px;
padding: 10px 10px 10px 5px;
display: block;
width: 320px;
border: none;
border-radius: 0;
border-bottom: 1px solid #4F4F4F;
}
input:focus,
textarea:focus {
outline: none;
}
input:focus ~ label, input:valid ~ label,
textarea:focus ~ label,
textarea:valid ~ label {
top: -14px;
font-size: 12px;
color: #FF3B3F;
}
input:focus ~ .bar:before,
textarea:focus ~ .bar:before {
width: 335px;
}

input[type=“password”] {
letter-spacing: 0.3em;
}

label {
color: #4F4F4F;
font-size: 16px;
font-weight: normal;
position: absolute;
pointer-events: none;
left: 5px;
top: 10px;
-webkit-transition: 300ms ease all;
transition: 300ms ease all;
}

.bar {
position: relative;
display: block;
width: 320px;
}
.bar:before {
content: ‘’;
height: 2px;
width: 0;
bottom: 0px;
position: absolute;
background: #FF3B3F;
-webkit-transition: 300ms ease all;
transition: 300ms ease all;
left: 0%;
}

.btn {
background: #fff;
color: #959595;
border: none;
padding: 10px 20px;
border-radius: 3px;
letter-spacing: 0.06em;
text-transform: uppercase;
text-decoration: none;
outline: none;
box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12), 0 1px 2px rgba(0, 0, 0, 0.24);
-webkit-transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}
.btn:hover {
color: #752021;
box-shadow: 0 7px 14px rgba(0, 0, 0, 0.18), 0 5px 5px rgba(0, 0, 0, 0.12);
}
.btn.btn-link {
background: #FF3B3F;
color: #d3eafd;
}
.btn.btn-link:hover {
background: #0d8aee;
color: #deeffd;
}
.btn.btn-submit {
background: #FF3B3F;
color: white;
}
.btn.btn-submit:hover {
background: #752021;
color: white;
}
.btn.btn-cancel {
background: #eee;
}
.btn.btn-cancel:hover {
background: #e1e1e1;
color: #8b8b8b;
}

.btn-box {
text-align: center;
margin: 50px 0;
}

I’m just so confused why its forcing my use the required attribute, I don’t want to use it as I made a php checker to see if the fields are empty. And this is messing with my styling of how I want it to look.

Thanks for any help.

#html5 #html #css

What is GEEK

Buddha Community

Tubo Man

1548486839

TLDR; Change this code:

input:focus ~ label,
input:valid ~ label,
textarea:focus ~ label,
textarea:valid ~ label
{
  top: -14px;
  font-size: 12px;
  color: #FF3B3F;
}

To this:

input:focus ~ label,
textarea:focus ~ label
{
  top: -14px;
  font-size: 12px;
  color: #FF3B3F;
}

The explanation:

Believe it or not, CSS styling can be applied to elements that specifically have certain attributes, so you should always be sure to check for pseudo classes corresponding to these attributes in your CSS. Example: input:required {…} corresponds to the required HTML attribute on an inputelement.

To make things even more complicated, the required attribute can determine if other pseudo classes such as :valid, are activated on that element. So, if an element is set to required, but the field isn’t filled out properly, any CSS specifying the :invalid pseudo-class will automatically be activated. If it is filled out properly, the :valid pseudo-class CSS properties will take effect.

Watts Kendall

1548486982

So input:valid ~ label in your css was causing the problem. Try this:

form {
  width: 320px;
  margin: 45px auto;
}
.group {
  position: relative;
  margin: 45px 0;
}
input {
  background: none;
  color: #4F4F4F;
  font-size: 18px;
  padding: 10px 10px 10px 5px;
  display: block;
  width: 320px;
  border: none;
  border-radius: 0;
  border-bottom: 1px solid #4F4F4F;
}
input:focus {
  outline: none;
}
input:focus ~ label {
  top: -14px;
  font-size: 12px;
  color: #FF3B3F;
}
input:focus ~ .bar:before {
  width: 335px;
}

input[type="password"] {
  letter-spacing: 0.3em;
}

label {
  color: #4F4F4F;
  font-size: 16px;
  font-weight: normal;
  position: absolute;
  pointer-events: none;
  left: 5px;
  top: 10px;
  -webkit-transition: 300ms ease all;
  transition: 300ms ease all;
}

.bar {
  position: relative;
  display: block;
  width: 320px;
}
.bar:before {
  content: '';
  height: 2px;
  width: 0;
  bottom: 0px;
  position: absolute;
  background: #FF3B3F;
  -webkit-transition: 300ms ease all;
  transition: 300ms ease all;
  left: 0%;
}

.btn {
  background: #fff;
  color: #959595;
  border: none;
  padding: 10px 20px;
  border-radius: 3px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  text-decoration: none;
  outline: none;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12), 0 1px 2px rgba(0, 0, 0, 0.24);
  -webkit-transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
  transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}
.btn:hover {
  color: #752021;
  box-shadow: 0 7px 14px rgba(0, 0, 0, 0.18), 0 5px 5px rgba(0, 0, 0, 0.12);
}
.btn.btn-link {
  background: #FF3B3F;
  color: #d3eafd;
}
.btn.btn-link:hover {
  background: #0d8aee;
  color: #deeffd;
}
.btn.btn-submit {
  background: #FF3B3F;
  color: white;
}
.btn.btn-submit:hover {
  background: #752021;
  color: white;
}
.btn.btn-cancel {
  background: #eee;
}
.btn.btn-cancel:hover {
  background: #e1e1e1;
  color: #8b8b8b;
}

.btn-box {
  text-align: center;
  margin: 50px 0;
}

<form action="#" method="post">
  <div class="group">
    <input type="text" name="emailuid"/><span class="highlight"></span><span class="bar"></span>
    <label>Email</label>
  </div>
  <div class="group">
    <input type="password" name="pwduid"/><span class="highlight"></span><span class="bar"></span>
    <label>Password</label>
  </div>
  <div class="btn-box">
    <button class="btn btn-submit" type="submit" name="login-submit">Sign in</button>
  </div>
</form>

Ava Watson

Ava Watson

1595318322

Know Everything About HTML With HTML Experts

HTML stands for a hypertext markup language. For the designs to be displayed in web browser HTML is the markup language. Technologies like Cascading style sheets (CSS) and scripting languages such as JavaScript assist HTML. With the help of HTML websites and the web, designs are created. Html has a wide range of academic applications. HTML has a series of elements. HTML helps to display web content. Its elements tell the web how to display the contents.

The document component of HTML is known as an HTML element. HTML element helps in displaying the web pages. An HTML document is a mixture of text nodes and HTML elements.

Basics of HTML are-

The simple fundamental components oh HTML is

  1. Head- the setup information for the program and web pages is carried in the head
  2. Body- the actual substance that is to be shown on the web page is carried in the body
  3. HTML- information starts and ends with and labels.
  4. Comments- come up in between

Html versions timeline

  1. HTML was created in 1990. Html is a program that is updated regularly. the timeline for the HTML versions is
  2. HTML 2- November, 1995
  3. HTML 3- January, 1997
  4. HTML 4- December, 1997; April, 1998; December, 1999; May, 2000
  5. HTML 5- October, 2014; November, 2016; December, 2017

HTML draft version timelines are

  1. October 1991
  2. June 1992
  3. November 1992
  4. June 1993
  5. November 1993
  6. November 1994
  7. April 1995
  8. January 2008
  9. HTML 5-
    2011, last call
    2012 candidate recommendation
    2014 proposed recommendation and recommendation

HTML helps in creating web pages. In web pages, there are texts, pictures, colouring schemes, tables, and a variety of other things. HTML allows all these on a web page.
There are a lot of attributes in HTML. It may get difficult to memorize these attributes. HTML is a tricky concept. Sometimes it gets difficult to find a single mistake that doesn’t let the web page function properly.

Many minor things are to be kept in mind in HTML. To complete an HTML assignment, it is always advisable to seek help from online experts. These experts are well trained and acknowledged with the subject. They provide quality content within the prescribed deadline. With several positive reviews, the online expert help for HTML assignment is highly recommended.

#html assignment help #html assignment writing help #online html assignment writing help #html assignment help service online #what is html #about html

Alisha  Larkin

Alisha Larkin

1617789060

HTML Tutorial For Beginners

The prospect of learning HTML can seem confusing at first: where to begin, what to learn, the best ways to learn — it can be difficult to get started. In this article, we’ll explore the best ways for learning HTML to assist you on your programming journey.

What is HTML?

Hypertext Markup Language (HTML) is the standard markup language for documents meant to be displayed in a web browser. Along with Cascading Style Sheets (CSS) and JavaScript, HTML completes the trio of essential tools used in creating modern web documents.

HTML provides the structure of a webpage, from the header and footer sections to paragraphs of text, videos, and images. CSS allows you to set the visual properties of different HTML elements, like changing colors, setting the order of blocks on the screen, and defining which elements to display. JavaScript automates changes to HTML and CSS, for example, making the font larger in a paragraph when a user clicks a button on the page.

#html #html-css #html-fundamentals #learning-html #html-css-basics #html-templates

ashika eliza

1625652623

HTML - A Complete Guide to Master the Top Programming Language

In this era of technology, anything digital holds a prime significance in our day-to-day life. Hence, developers have submerged themselves to create a major impact using programming languages.According to Statista, HTML/CSS holds the second position (the first being Javascript), in the list of most widely-used programming languages globally (2020).Interested to learn this language? Then head on to this tutorial and get to know all about HTML! Plus we have added numerous examples such that you can learn better! So happy learning!
html for beginners

#html #html-for-beginners #html-tutorials #introduction-to-html #learn-html #tutorials-html

Angela  Dickens

Angela Dickens

1596090180

Commonly Used HTML Tags with Examples

HTML tags are keywords used in HTML to display web-pages with certain properties. They are further used for defining HTML elements. An HTML element consists of a starting tag, some content, and an ending tag. The web browser reads the HTML document from top to bottom, left to right. Each HTML tag defines a new property that helps in rendering the website.

HTML Tags

HTML Tags

The ‘<>’ brackets contain an HTML tag. There are two types of HTML tags- empty tags or singleton tags and container tags. Singleton tags or empty tags do not contain any content such as an image or a paragraph and hence do not need to be closed, whereas container tags should be closed.

Syntax

  1. Some Content

Examples of:

Empty tag: 
,


,etc.

Container tags: 

Paragraph

Link

  1. <!DOCTYPE>
  2. Paragraph

  3. Heading

  4. Bold
  5. Italic
  6. Underline

Output-

HTML Tags example

Head tags:

,<style>,<script>,<link>,<meta> and <base>. <p>Text-formatting tags:</p> <p><h>,<b>,<strong>,<small>,<pre>,<i>,<em>,<sub>,<sup>,<ins>,<dfn>,<del>,<div> and <span>.</p> <p>Link tags:</p> <p><a>, <base>.</p> <p>List tags:</p> <ul>, <ol>, <li>, <dl>, <dd> <p>Table tags:</p> <table> ,<tr> , <td>, <th>, <thead>, <tbody>, <tfoot>. <p>Form tags:</p> <form>, <input>, <select>, <option>, <button>, <label>, <fieldset>, <textarea>. <p>Scripting tags:</p> <script>, <noscript> Image and Object tags: <img>, <figure>, <figcaption>, <area>, <map>, <object>. Here is an alphabetical list of tags used in HTML.

#html tutorials #html image tags #html link tags #html list tags #html tags #html

Types, Effects and Attributes

HTML Button Tag – Types, Effects and Attributes

In this article, we are going to learn HTML Button Tags. So let’s start!!!

HTML Button

HTML Button

The

#html tutorials #html button #html button attributes #html button element #html button tags #html