Wording not appearing on button in HTML/ CSS - html

I am creating a footer in HTML/CSS and I am trying to create an email form at the bottom of the footer. I have already created the button and form itself; however, the wording on the button does not appear.
Here is my HTML code:
* {
padding: 0;
margin: 0;
box-sizing: border-box;
}
.footer-container {
background-color: #212329;
padding-bottom: 20px;
width: 80%;
height: 40vh;
display: flex;
justify-content: center;
flex-wrap: wrap;
margin: 0 auto;
}
.footer-container h4 {
color: #fff;
text-align: left;
text-shadow: 0.5px 0.5px gray;
}
.footer-container h6 {
color: #fff;
text-shadow: 0.5px 0.5px gray;
}
.footer-heading {
display: flex;
flex-direction: column;
margin-right: 4rem;
}
.footer-heading h6 {
color: #fff;
margin-bottom: 2rem;
}
.footer-heading a {
color: #fff;
text-decoration: none;
margin-bottom: 0.5rem;
}
.footer-heading a:hover {
color: darkgoldenrod;
transition: 0.5s ease-in-out;
}
.email-form h4 {
margin-bottom: 2rem;
}
#footer-email {
width: 250px;
height: 40px;
border-radius: 4px;
outline: none;
border: none;
padding-left: 0.5rem;
font-size: 1rem;
margin-bottom: 1rem;
}
#footer-email::placeholder {
color: #b1b1b1;
}
#footer-email-btn {
width: 100px;
height: 40px;
border-radius: 4px;
background-color: darkred;
outline: none;
border: none;
color: #fff;
font-size: 1rem;
}
#footer-email-btn:hover {
cursor: pointer;
background-color: darkgoldenrod;
transition: all 0.4s ease-in-out;
}
<section class="footer-container">
<h4>Golden Lion Insurance Services</h4>
<div class="footer-heading">
<h6>About Golden Lion</h6>
About Rose
Rose Income Tax Services
</div>
<div class="footer-heading">
<h6>Services</h6>
Auto
Home
Truck
Health
Commercial
Life
Bonds
Annuities
</div>
<div class="footer-heading">
<h6>Resources</h6>
Blog
</div>
<div class="footer-heading">
<h6>Contact Us</h6>
</div>
<div class="footer-heading"></div>
<div class="email-form">
<h4>Get Your Latest Insurance Tips from Us!</h4>
<input type="email" placeholder="Enter your email here" id="footer-email">
<button type="submit" value="Sign Up!" id="footer-email-btn"></button>
</div>
</section>
Perhaps I may have missed some coding on the CSS, but the wording "sign up!" doesn't appear when I launch the code on my browser (I am using the current version of Google Chrome). Any help or pointers?
Thanks again!

The Problem seems to be in your HTML file on the 3rd line from the bottom.
When you declare a button, you need to mention some innerText in it.
For Example: <button> innerText </button>
Similarly for your code:
<button type="submit" value="Sign Up!" id="footer-email-btn">Sign Up!</button>

No worries, you only need to add some text inside the bottom tag.
Update your HTML button tag as the following
<button type="submit" value="Sign Up!" id="footer-email-btn">Submit</button>

Related

How to make the "Submit" button on form send form details to designated email

I have created a basic form, where the user has to input various contact details. My Send button however, does not work. Im trying to use HTML and CSS only for this form, but I'm not opposed to using JS if that's what is needed for this to be functional.
I have looked up various ways for a solution, but most things involve using php, which is not something I am able to use for this. As stated before, I'm really just trying to stick with HTML.
My button does have type="submit" and href="myemail#email.com" (I have my actual email in there). However, my button does not click, or at least it does not give the appearance of clicking nor does it send anything to my email. I also thought it was just a web browser issue, but I have tried both chrome and safari and no luck.
<section class="modal-section">
<button class="modal-button" id="open">Click Me</button>
<div class="modal-container" id="modal_container">
<div class="modal">
<div class="form-container" id="form-container">
<h1 class="form-header">Connect With Me.</h1>
<p>I would love to respond to your queries and help you succeed. Feel free to contact me!</p>
<div class="contact-box">
<div class="contact-left">
<h3 class="form-header3">Send your request</h3>
<form>
<div class="input-row">
<div class="input-group">
<label>Name</label>
<input type="text" placeholder="Your Name" required>
</div>
<div class="input-group">
<label>Phone</label>
<input type="text" placeholder="(888) 888-8888">
</div>
</div>
<div class="input-row">
<div class="input-group">
<label>Email</label>
<input type="email" placeholder="YourEmail#Email.com" required>
</div>
<div class="input-group">
<label>Subject</label>
<input type="text" placeholder="You're Hired!" required>
</div>
</div>
<label>Message</label>
<textarea rows="5" placeholder="You are so cool, please make my website cool too!" required></textarea>
<button class="form-button" type="submit" value="Send" href="mailto:johnsonisaiah13#yahoo.com">SEND</button>
</form>
</div>
<div class="contact-right">
<h3 class="form-header3">Reach Me</h3>
<table>
<tr>
<td>Email</td>
<td>Johnsonisaiah13#yahoo.com</td>
</tr>
<tr>
<td>Location</td>
<td>Fort Stockton, TX</td>
</tr>
</table>
</div>
</div>
</div>
<button class="modal-button" id="close">Close Me</button>
</div>
</div>
</section>
/* //////////////////////////////////////////////////////////////
//////////////// MODAL SECTION ///////////////////////
////////////////////////////////////////////////////////////// */
.modal-section {
box-sizing: border-box;
display: flex;
align-items: center;
justify-content: center;
min-height: 100vh;
margin: 0;
}
.modal-container {
background-color: rgba(0, 0, 0, 0.3);
display: flex;
align-items: center;
justify-content: center;
position: fixed;
top: 0;
left: 0;
height: 100vh;
width: 200vh; /* make 100 for smaller screen */
opacity: 0;
pointer-events: none;
}
.modal-button {
/* background-color: #39FF14;
color: #1F2022;
border-radius: 5px;
padding: 10px 25px;
box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
font-size: 14px; */
background-color: white;
padding: 10px 18px;
font-weight: bold;
color: #1F2022;
display: inline-block;
margin: 30px 0;
border-radius: 5px;
}
.modal-button:hover {
background-color: #39FF14;
}
.modal {
background-color: white;
padding: 30px 50px;
border-radius: 5px;
box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
width: 1000px;
max-width: 100%;
text-align: center;
}
.modal-header {
margin: 0;
}
.modal-text {
font-size: 14px;
opacity: 0.7;
}
.modal-container.show {
opacity: 1;
pointer-events: auto;
}
/* <!-- /////////////////////////////////////////////////////////////
///////////////////// CONTACT ME / HIRE ME /////////////////////////
///////////////////////////////////////////////////////////// --> */
.form-container {
width: 80%;
margin: 50px auto;
}
.contact-box {
background: white;
display: flex;
}
.contact-left {
flex-basis: 60%;
padding: 40px 60px;
}
.contact-right {
flex-basis: 40%;
padding: 40px;
background: #39FF14;
}
.form-header {
margin-bottom: 10px;
color: white;
}
.form-container p {
margin-bottom: 40px;
color: white;
}
.input-row {
display: flex;
justify-content: space-between;
margin-bottom: 20px;
}
.input-row .input-group {
flex-basis: 45%;
}
input {
width: 100%;
border: none;
border-bottom: 1px solid #39FF14;
outline: none;
padding-bottom: 5px;
}
textarea {
width: 100%;
border: 1px solid #39FF14;
outline: none;
padding: 10px;
box-sizing: border-box;
}
label {
margin-bottom: 6px;
display: block;
color: black;
}
.form-button {
background-color: #39FF14;
width: 100px;
border: none;
outline: none;
color: black;
height: 35px;
border-radius: 30px;
margin-top: 20px;
box-shadow: 0px 5px 15px 0px rgba(0, 14.5, 38.9, 48.6);
pointer-events: auto;
}
.form-header3 {
/* color: orange; */
font-weight: 600;
margin-bottom: 30px;
}
tr td:first-child {
padding-right: 20px;
}
tr td {
padding-top: 20px;
}
You can try refering to this old question some time ago. Not sure if it still works, but hope it helps.
html button to send email

Remove feint border around input (mobile)

Hello everybody & anybody who stumbles upon this!
I have ran into an issue where only on mobile devices there appears to be a feint border around my input tags elements. This happens in safari & google chrome on mobile. This does not happen in live server locally. It looks like its trying to create a border-radius: 20px around my input elements but in the css styling for desktop I don't even have that styling applied.
I have tried directly reapplying the desired styling in the mobile media query but everything I have tried has not worked so far.
Thank you in advance!! (p.s really sorry for the way the snippet is compiled, this was written using sass/scss.)
html, body {
font-family: 'mitr', sans-serif;
}
#contact {
background-color: rgba(66, 76, 96, 0.8);
padding: 2rem;
}
#contact .container {
display: flex;
justify-content: center;
align-items: center;
flex-direction: column;
}
#contact .container .contact-title h1 {
color: #a3bfd9;
font-size: 4rem;
font-weight: 600;
text-align: center;
}
#contact .container .contact-title p {
color: #fff;
font-size: 1.5rem;
font-weight: 300;
}
#contact .container .contact-title p a {
color: #a3bfd9;
text-decoration: underline;
}
#contact .container .form form {
display: flex;
justify-content: center;
align-items: center;
flex-direction: column;
}
#contact .container .form form input {
border: none;
border-bottom: 3px #fff solid;
background: transparent;
color: #fff;
margin: 3rem 0;
padding: 0.5rem 0;
width: 600px;
font-size: 1.2rem;
font-weight: 500;
}
#contact .container .form form input::placeholder {
color: #fff;
}
#contact .container .form form input:focus {
outline: none;
}
#contact .container .form form button {
color: #fff;
background-color: #2675a6;
border: none;
border-radius: 50px;
padding: 1.5rem;
width: 250px;
font-size: 1.3rem;
}
#contact .container .form form button i {
position: relative;
margin-right: 0.5rem;
}
#contact .container .form form button:hover {
background-color: #a3bfd9;
color: #283040;
}
<section id="contact">
<div class="container">
<div class="contact-title">
<h1>Lets Chat</h1>
<p>Alternatively, you can reach out to me via Linkedin</p>
</div>
<div class="form">
<form action="https://formsubmit.co/your#email.com" method="POST">
<input type="text" name="name" required placeholder="name">
<input type="email" name="email" required placeholder="email">
<input type="text" name="message" required placeholder="message">
<button type="submit"><i class="fas fa-paper-plane"></i>Send</button>
</form>
</div>
</div>
</section>
i fixed it.. really happy I figured it out on my own!! little stuff like this, although trivial make me doubt my skills (i've only been working with html & css for 3 months). super simple, and disappointed that i actual wrote this question up but i won't delete it. i'll leave it up to remind myself to experiment just a little bit more before i ask for help.
changing border-radius: none to border-radius: 0; within my media query fixed it.
.form {
form {
input {
width: 300px;
font-size: 17px;
border-bottom: 3px solid #fff;
border-radius: 0;
}
button {
padding: 1rem;
font-size: 16px;
}
}
}

How to make checkboxes wrap nicely?

I am making a small form where the user can choose different food categories but there are too many so I wanted to make it scrollable but right now the options have odd breakpoints (see picture link below) does anyone know how I can fix this easily with css?
screenshot of problem
This is the html of my form:
.favForm-categories{
overflow: scroll;
overflow-x: inherit;
height: 20rem;
}
.fav-choice {
line-height: 3.3rem;
margin: .1rem;
color: white;
padding: .5rem;
width: fit-content;
border: solid .1rem white;
border-radius: var(--borderRadiusButton);
background-color: var(--color2);
}
input[type='checkbox'] {
appearance: none;
background-color: white;
margin: 0;
margin-right: .5rem;
color: white;
width: 1rem;
height: 1rem;
border: .3rem solid white;
border-radius: var(--borderRadiusButton);
}
input[type='checkbox']:checked {
background-color: var(--color2);
}
<section class="favForm">
<h3 class="small-title">Choose your favourite categories</h3>
<form class="favForm-options" action="index.php?pages=home" method="POST">
<div class="favForm-categories">
<input type="hidden" name="Action" value="add_category">
<?php
foreach ($category as $cat) {
echo('<label class="fav-choice" for="'.$cat->RecipeCategory.'"><input class="checkbox-hide" type="checkbox" id="'.$cat->RecipeCategory.'" name="fav_category[]" value="'.$cat->RecipeCategory.'">'.$cat->RecipeCategory.'</label>');
}
?>
</div>
<input class="green-button" type="submit" name="submit">
</form>

Input and button not aligned horizontally

I'm making an email form where people can submit their emails and be part of an email list, in order to do this I have made an input and a button that go side by side. The issue that I am getting is that even though the button and inputs are the exact same height, and should be aligned horizontally perfectly it instead has a pixel difference with the button being a pixel higher than the input. How can I fix this?
#form {
display flex;
align-items: center;
justify-content: center;
flex-direction: row;
}
.email-form {
padding: 60px;
margin-top: 85px;
color: #fff;
background: #000;
text-align: center;
}
.form input {
width: 300px;
height: 30px;
margin: 0;
display: inline;
outline: 0 none;
}
.form button {
height: 30px;
width: 90px;
margin: 0;
background: #707070;
color: #fff;
font-weight: 700;
text-transform: uppercase;
text-align: center;
border: none;
cursor: pointer;
display: inline;
outline: 0 none;
}
<div class="form">
<form action="" id="email">
<input type="email" placeholder="Email" /><button type="submit" class="submit"><p>Sign up</p></button>
</form>
</div>
If you change
<p>Sign up</p>
To
<div>Sign up</div>
Or just
Sign up
It should work.
There's a bunch of margin settings on the <p> element that are overflowing and messing up your alignment.
Just remove p tag around the Sign up text.
<button type="submit" class="submit">Sign up</button>
#form {
display flex;
align-items: center;
justify-content: center;
flex-direction: row;
}
.email-form {
padding: 60px;
margin-top: 85px;
color: #fff;
background: #000;
text-align: center;
}
.form input {
width: 300px;
height: 30px;
margin: 0;
display: inline;
outline: 0 none;
}
.form button {
height: 30px;
width: 90px;
margin: 0;
background: #707070;
color: #fff;
font-weight: 700;
text-transform: uppercase;
text-align: center;
border: none;
cursor: pointer;
display: inline;
outline: 0 none;
}
<div class="form">
<form action="" id="email">
<input type="email" placeholder="Email" />
<button type="submit" class="submit">Sign up</button>
</form>
</div>

background-color doesn't work when using flexbox

I started using flexbox for my footers and now on all of my pages with forms the background-color is now the default white. Here is an example of one of my pages:
login.php
body {
background-color: #211e1e;
display: flex;
flex-direction: column;
height: 95vh;
}
h1 {
color: #99cc00;
text-align: center;
}
.content {
flex: 1 0 auto;
}
footer {
text-align: center;
font-weight: lighter;
color: #99cc00;
font-size: 10px;
flex-shrink: 0;
}
h3 {
position: absolute;
font-weight: bold;
color: #99cc00;
font-size: 15px;
width: 100%;
top: 91.5%;
}
.button {
background-color: #211e1e;
color: white;
font-size: 24px;
/*padding: 15px 50px;*/
transition-duration: .4s;
border: greenyellow;
width: 250px;
/* width of button */
height: 50px;
/* height of button */
}
.buttonColor:hover {
color: black;
background-color: greenyellow;
}
h1 {
text-align: center;
bottom: 25%;
}
content {
align-items: center;
justify-content: center;
}
.signin {
color: #99cc00;
margin: auto;
font-size: 24px;
}
.loginInput {
font-size: 24px;
}
.loginButton {
background-color: #211e1e;
color: white;
font-size: 24px;
padding: 10px 50px;
transition-duration: .4s;
border: greenyellow;
}
.loginButtonColor:hover {
color: black;
background-color: greenyellow;
}
<!DOCTYPE html>
<html lang="en">
<head>
<link rel="icon" href="../../favicon.ico">
<meta charset="UTF-8">
<title>TapLovers</title>
<link rel="stylesheet" href="../background.css">
<link rel="stylesheet" href="login.css">
</head>
<body>
<div class=content>
<h1><img src="../../36x36-icon.png">apLovers</h1>
<form class="signin">
<input type="text" email="email" placeholder="Email" class="loginInput"><br>
<input type="text" password="password" placeholder="Password" class="loginInput"><br>
<input type="submit" name="submit" id="login" class="loginButton loginButtonColor" value="Login To TapLovers!" /><br><br>
<a href="../register/register.php">
<font color="#99cc00">Create a FREE TapLovers Account!</font>
</a>
</form>
</div>
<footer>
<h3><img src="../../favicon.ico">apLovers</h3><br>&copy 2018 TapLovers, All Rights Reserved
</footer>
</body>
</html>
Also I was trying to center my forms and my title using flexbox as well and I haven't gotten that working either. I'm not really sure what other details would be useful for this particular problem. If you need any more details just reply below and I'll answer them as they come out.
EDIT: The snippet that compiles on stack overflow shows my background just fine. What's more is if I use ctrl+shift+i on my page then the background works but if I just reload on my page then the background will turn white.
I did not see the issue with background fluctuations. I think it is a delay in the page load. I have added comments to help with the flexbox centering of items.
/*CSS reset of browser agent. Removes the horizontal scroll currently happening in page.*/
* {
box-sizing: border-box;
margin: 0;
padding: 0;
}
body {
background-color: #211e1e;
display: flex;
flex-direction: column;
/* No need to restrict the height.
height: 95vh;*/
}
h1 {
color: #99cc00;
text-align: center;
}
.content {
flex: 1 0 auto;
/*make the content div flex so that the form can take the center alignment from flexbox properties. Add the centering here and avoid the margin: auto property */
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
}
footer {
text-align: center;
font-weight: lighter;
color: #99cc00;
font-size: 10px;
flex-shrink: 0;
}
h3 {
position: absolute;
font-weight: bold;
color: #99cc00;
font-size: 15px;
width: 100%;
top: 91.5%;
}
.button {
background-color: #211e1e;
color: white;
font-size: 24px;
/*padding: 15px 50px;*/
transition-duration: .4s;
border: greenyellow;
width: 250px;
/* width of button */
height: 50px;
/* height of button */
}
.buttonColor:hover {
color: black;
background-color: greenyellow;
}
h1 {
text-align: center;
bottom: 25%;
}
/*Add flexbox style the inputs as blocks and remove <br> from HTML*/
.signin {
color: #99cc00;
font-size: 24px;
display: flex;
flex-direction: column;
}
.signin>* {
margin: 5px 0;
}
.loginInput {
font-size: 24px;
}
.loginButton {
background-color: #211e1e;
color: white;
font-size: 24px;
padding: 10px 50px;
/*Please check your animation ??
transition-duration: .4s;*/
/*add border size and transparency 1px solid*/
border: 1px solid greenyellow;
}
.loginButtonColor:hover {
color: black;
background-color: greenyellow;
}
<div class="content">
<h1><img src="../../36x36-icon.png">apLovers</h1>
<form class="signin">
<input class="loginInput" placeholder="Email" type="text"> <input class="loginInput" placeholder="Password" type="text"> <input class="loginButton loginButtonColor" id="login" name="submit" type="submit" value="Login To TapLovers!"> <font color="#99CC00">Create a FREE TapLovers Account!</font>
</form>
</div>
<footer>
<h3><img src="../../favicon.ico">apLovers</h3>
<p>© 2018 TapLovers, All Rights Reserved</p>
</footer>