I want to render my screen responsive with any kind of device, so my code display very good on a big screen but not the same thing with the young screen so I want my screen to be fitted for all sizes.I spend a lot of time to target it but I can't found any solution my code:
* {
box-sizing: border-box;
padding: 0%;
margin: 0%;
background-color: #dfe3ee;
}
.text {
float: left;
margin-top: 200px;
margin-left: 160px;
font-size: 2rem;
font-family: sans-serif;
color: rgb(100, 5, 5)
}
form {
border: 3px solid #f1f1f1;
width: 30%;
display: flex;
flex-wrap: wrap;
flex-direction: column;
margin-top: 5rem;
margin-right: 250px;
float: right;
}
input[type=text],
input[type=password] {
width: 90%;
padding: 8px 12px;
margin: 8px 0;
display: inline-block;
border: 1px solid #ccc;
box-sizing: border-box;
}
button {
background-color: #04AA6D;
color: white;
padding: 8px 10px;
margin: 8px 0;
border: none;
cursor: pointer;
width: 100%;
}
button:hover {
opacity: 0.8;
}
/* Extra style for the cancel button (red) */
/* Center the avatar image inside this container */
.container {
padding: 16px;
}
/* The "Forgot password" text */
span.psw {
float: right;
padding-top: 16px;
}
#media screen and (max-width: 600px) {
span.psw {
display: block;
float: right;
}
.form {
border: 3px solid #f1f1f1;
width: 30%;
display: flex;
}
}
import {Link} from "react-router-dom"; const RegisterPage =() => { return (
<div>
<div className="text">
<h1>Private</h1>
</div>
<form>
<div class="container">
<label for="uname"><b>Username</b></label>
<input type="text" placeholder="Enter Username" name="uname" required />
<label for="psw"><b>Password</b></label>
<input type="password" placeholder="Enter Password" name="psw" required />
<button type="submit">Login</button>
<label>
<input type="checkbox" checked="checked" name="remember" /> Remember me
</label>
</div>
<div className="container" style={{ "backgroundColor": "#f1f1f1"}}>
Forgot password?
<div className="btn">
<button>Create New Account</button>
</div>
</div>
</form>
</div>
) }; export default RegisterPage;
Check this out, I added flexbox for your main div and modified your media query part with flexbox and removed margins. Keep in mind I changed className with class for snipping, for testing in your local you should change them again with className
* {
box-sizing:border-box;
padding: 0%;
margin: 0%;
background-color: #dfe3ee;
}
.mainDiv {
width: 100%;
height: 100vh;
display: flex;
justify-content: space-evenly;
align-items: center;
}
.text{
float: left;
font-size: 2rem;
font-family: sans-serif;
color:rgb(100, 5, 5)
}
form {
border: 3px solid #f1f1f1;
width: 30%;
display: flex;
flex-wrap: wrap;
flex-direction: column;
}
input[type=text], input[type=password] {
width: 90%;
padding: 8px 12px;
margin: 8px 0;
display: inline-block;
border: 1px solid #ccc;
box-sizing: border-box;
}
button {
background-color: #04AA6D;
color: white;
padding: 8px 10px;
margin: 8px 0;
border: none;
cursor: pointer;
width: 100%;
}
button:hover {
opacity: 0.8;
}
/* Extra style for the cancel button (red) */
/* Center the avatar image inside this container */
.container {
padding: 16px;
}
/* The "Forgot password" text */
span.psw {
float: right;
padding-top: 16px;
}
#media screen and (max-width: 600px) {
.mainDiv {
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
}
.text {
margin-left: 0;
}
span.psw {
display: block;
float: right;
}
form{
border: 3px solid #f1f1f1;
width: 30%;
display: flex;
float: none;
margin-right: 0;
min-width: 250px;
}
}
<div class="mainDiv">
<div class="text" >
<h1>Private</h1>
</div>
<form >
<div class="container">
<label for="uname"><b>Username</b></label>
<input type="text" placeholder="Enter Username" name="uname" required />
<label for="psw"><b>Password</b></label>
<input type="password" placeholder="Enter Password" name="psw" required />
<button type="submit">Login</button>
<label>
<input type="checkbox" checked="checked" name="remember" /> Remember me
</label>
</div>
<div className="container" style={{"backgroundColor":"#f1f1f1"}}>
<a href="" >Forgot password?</a>
<div className="btn" >
<button >Create New Account</button>
</div>
</div>
</form>
</div>
Related
I am designing a simple signup form using Html and CSS. I just want to " already have an account ? Log in" text to left till the border of skyblue border, butI am unable to do that.
But I am getting result
Here is my html code
<div class="register-bg">
<div class="register-container">
<form>
<label for="email"><b>Email</b></label>
<input
type="text"
placeholder="Enter Email"
name="email"
required=""
/>
<label for="password"><b>Password</b></label>
<input
type="password"
placeholder="Enter Password"
name="password"
required=""
/>
<button type="submit" class="signup">Sign Up</button>
<Link>
<h1 class="register-login">
alredy have an account ? Log in
</h1>
</Link>
</form>
</div>
</div>
Here is my css code
.register-bg{
height: 100vh;
background-size: cover;
width: 100%;
background-image: url(../public/images/bg.jpg);
}
.register-container{
margin-top: 100px;
display: flex;
flex-wrap: wrap;
flex-direction: row;
width: 70%;
margin-left:27rem;
background: rgb(53, 105, 46);
align-items: center;
justify-content: center;
padding: 50px 0;
}
.register-container > form{
background:skyblue;
display: flex;
flex-wrap: wrap;
flex-direction: column;
width: 70%;
justify-content: center;
align-items: center;
}
.register-container input{
width: 80%;
font-size: 15px;
padding: 15px;
margin: 5px 0 22px 0;
display: inline-block;
text-align: center;
border: none;
background: #f1f1f1;
}
.register-login {
color: black;
font-size: 15px;
}
.signup{
align-items: center;
font-size: 14px;
font-weight: bold;
background-color: rgb(10, 119, 13);
color: white;
padding: 14px 20px;
margin: 8px 0;
border: none;
cursor: pointer;
opacity: 0.9;
}
Just add this to your CSS:
.register-login {
align-self: flex-start;
}
Wrap your <Link> in a div container
<div class="login-text-container">
<Link>
<h1 class="register-login">
alredy have an account ? Log in
</h1>
</Link>
</div>
Wet its width to 100%
.login-text-container {
width: 100%;
}
Full code:
.register-bg {
height: 100vh;
background-size: cover;
width: 100%;
background-image: url(../public/images/bg.jpg);
}
.register-container {
margin-top: 100px;
display: flex;
flex-wrap: wrap;
flex-direction: row;
width: 70%;
margin-left: 27rem;
background: rgb(53, 105, 46);
align-items: center;
justify-content: center;
padding: 50px 0;
}
.register-container>form {
background: skyblue;
display: flex;
flex-wrap: wrap;
flex-direction: column;
width: 70%;
justify-content: center;
align-items: center;
}
.register-container input {
width: 80%;
font-size: 15px;
padding: 15px;
margin: 5px 0 22px 0;
display: inline-block;
text-align: center;
border: none;
background: #f1f1f1;
}
.register-login {
color: black;
font-size: 15px;
}
.signup {
align-items: center;
font-size: 14px;
font-weight: bold;
background-color: rgb(10, 119, 13);
color: white;
padding: 14px 20px;
margin: 8px 0;
border: none;
cursor: pointer;
opacity: 0.9;
}
.login-text-container {
width: 100%;
}
<div class="register-bg">
<div class="register-container">
<form>
<label for="email"><b>Email</b></label>
<input type="text" placeholder="Enter Email" name="email" required="" />
<label for="password"><b>Password</b></label>
<input type="password" placeholder="Enter Password" name="password" required="" />
<button type="submit" class="signup">Sign Up</button>
<div class="login-text-container">
<Link>
<h1 class="register-login">
alredy have an account ? Log in
</h1>
</Link>
</div>
</form>
</div>
</div>
add the following code, edit it and you are good to go :)
CSS:
.login-button {
display: block;
padding: 100%;
align-items: left;
}
HTML:
<div class='login-button'>
<h1 class="register-login">
alredy have an account ? Log in
</h1>
</div>
I would like to know how can I adjust the height of a div depending of the content on it. For example, I have the following HTML:
div.Pantalla {
background-image: url("https://cdn.pixabay.com/photo/2015/07/11/23/02/plane-841441_1280.jpg");
background-size: cover;
justify-content: center;
align-items: center;
height: auto;
display: flex;
flex-direction:column;
}
.formulario{
position: relative;
width:80%;
margin:auto;
}
form{
margin-top: 10px;
display: block;
width:100%;
padding:16px;
border: 1px solid black;
border-radius:5px;
background: deepskyblue;
}
.form-inline {
display: flex;
flex-flow: row wrap;
align-items: center;
}
/* Add some margins for each label */
.form-inline label {
margin: 5px 10px 5px 0;
}
/* Style the input fields */
.form-inline input {
vertical-align: middle;
margin: 5px 10px 5px 0;
padding: 10px;
background-color: #fff;
border: 1px solid #ddd;
}
/* Style the submit button */
.form-inline button {
width: 10%;
text-align: center;
padding: 10px 20px;
border: 1px solid #ddd;
background: #0095dd;
background-size: cover;
color: white;
}
.form-inline button:hover {
background-color:lightblue;
}
ul{
width:100%;
padding:16px;
border: 2px solid black;
border-radius:5px;
background: deepskyblue;
margin-top: 10px;
}
li{
position: center;
width:100%;
}
.column {
float: left;
margin-top: 20px;
width: 80%;
margin-right: 10%;
margin-left: 10%;
position: relative;
}
.column button{
margin-right: 10%;
margin-left: 10%;
margin-top: 10px;
width: 80%;
text-align: center;
padding: 10px 20px;
border: 1px solid #ddd;
background: #0095dd;
background-size: cover;
color: white;
}
.column button:hover {
background-color:lightblue;
}
<div class="Pantalla">
<div class="formulario">
<form class="form-inline" [formGroup]="SearchForm">
<input type="text" id="Origin" placeholder="Enter Origin" formControlName="Origin">
<input type="text" id="Destiny" placeholder="Enter Destination" formControlName="Destiny">
<input type="date" id="CheckIn" placeholder="Enter Check-In Date" formControlName="CheckIn">
<input type="date" id="Checkout" placeholder="Enter Check-Out Date" formControlName="Checkout">
<input type="number" id="people" placeholder="Enter Number of People" formControlName="people">
<button type="submit" (click)="getPacks()">Go!</button>
</form>
</div>
<div class="column menu">
<ul class="list-group" *ngFor="let pack of packs; let i = index">
<li class="list-group-item">Flight {{pack.flight.Airline}}, {{pack.flight.LandMarkName_Origin}} - {{pack.flight.LandMarkName_Destination}} for {{pack.flight.minPrice}} Dolars </li>
<li class="list-group-item">Stay at {{pack.hotel.name}}, with {{pack.hotel.Star_rating}} / {{pack.hotel.scale}} Stars</li>
<li class="list-group-item">Visit
<p *ngFor="let places of pack.places; let j = index">{{places.name}}, </p>
</li>
<button>Get it!</button>
</ul>
</div>
</div>
However, when I launch my application, what I get is this:
I want that the height of the "Pantalla" div equals the total height of the divs that it has. How can I achieve this?
UPDATED: When the code is like this, what I get is the following:
enter image description here
The reason why the background only cover to the first div is that you're missing the display rule.
Please add display: flex; and flex-direction:column, then you will see it's working.
div.Pantalla {
background-image: url("https://cdn.pixabay.com/photo/2015/07/11/23/02/plane-841441_1280.jpg");
background-size: cover;
justify-content: center;
align-items: center;
height: auto;
/* Add this */
display: flex;
flex-direction: column;
}
.formulario{
position: relative;
width:80%;
margin:auto;
}
form{
margin-top: 10px;
display: block;
width:100%;
padding:16px;
border: 1px solid black;
border-radius:5px;
background: deepskyblue;
}
.form-inline {
display: flex;
flex-flow: row wrap;
align-items: center;
}
/* Add some margins for each label */
.form-inline label {
margin: 5px 10px 5px 0;
}
/* Style the input fields */
.form-inline input {
vertical-align: middle;
margin: 5px 10px 5px 0;
padding: 10px;
background-color: #fff;
border: 1px solid #ddd;
}
/* Style the submit button */
.form-inline button {
width: 10%;
text-align: center;
padding: 10px 20px;
border: 1px solid #ddd;
background: #0095dd;
background-size: cover;
color: white;
}
.form-inline button:hover {
background-color:lightblue;
}
ul{
width:100%;
padding:16px;
border: 2px solid black;
border-radius:5px;
background: deepskyblue;
margin-top: 10px;
}
li{
position: center;
width:100%;
}
.column {
float: left;
margin-top: 20px;
width: 80%;
margin-right: 10%;
margin-left: 10%;
position: relative;
}
.column button{
margin-right: 10%;
margin-left: 10%;
margin-top: 10px;
width: 80%;
text-align: center;
padding: 10px 20px;
border: 1px solid #ddd;
background: #0095dd;
background-size: cover;
color: white;
}
.column button:hover {
background-color:lightblue;
}
<div class="Pantalla">
<div class="formulario">
<form class="form-inline" [formGroup]="SearchForm">
<input type="text" id="Origin" placeholder="Enter Origin" formControlName="Origin">
<input type="text" id="Destiny" placeholder="Enter Destination" formControlName="Destiny">
<input type="date" id="CheckIn" placeholder="Enter Check-In Date" formControlName="CheckIn">
<input type="date" id="Checkout" placeholder="Enter Check-Out Date" formControlName="Checkout">
<input type="number" id="people" placeholder="Enter Number of People" formControlName="people">
<button type="submit" (click)="getPacks()">Go!</button>
</form>
</div>
<div class="column menu">
<ul class="list-group" *ngFor="let pack of packs; let i = index">
<li class="list-group-item">Flight {{pack.flight.Airline}}, {{pack.flight.LandMarkName_Origin}} - {{pack.flight.LandMarkName_Destination}} for {{pack.flight.minPrice}} Dolars </li>
<li class="list-group-item">Stay at {{pack.hotel.name}}, with {{pack.hotel.Star_rating}} / {{pack.hotel.scale}} Stars</li>
<li class="list-group-item">Visit
<p *ngFor="let places of pack.places; let j = index">{{places.name}}, </p>
</li>
<button>Get it!</button>
</ul>
</div>
</div>
As I can see that you have a main div and two child div inside that main div element
and you want that the background image of must cover both div.
if I am right then change the height of your main element
height: 100vh;
change your css code like below and see what happend
div.Pantalla {
background-image: url("https://cdn.pixabay.com/photo/2015/07/11/23/02/plane-841441_1280.jpg");
background-size: cover;
justify-content: center;
align-items: center;
height: 100vh;
}
If what you want is the image that occupies all the space that its parent has, try this:
I suppose that the div.Pantalla's parent is a div with id: app.
#app {
position: relative;
width: 100%;
height: auto;
}
div.Pantalla {
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
}
}
I have the following images that represent each case for user input-validation.
No Error:
Input Error:
I would like to maintain the alignment of the upper image while moving the error message underneath the input field (keep Label on left and Input on right, place error message underneath and aligned with input).
.group {
display: flex;
flex-wrap: nowrap;
margin-top: 4px;
}
.group label {
display: flex;
width: 15%;
line-height: 30px;
justify-content: center;
align-items: center;
}
.group input[type="text"] {
width: 85%;
border: 1px solid rgb(116, 115, 115);
padding-left: 3px;
}
.group textarea:focus,
input:focus {
outline: none;
}
.group .errorMsg {
color: #cc0033;
display: inline-block;
font-size: 12px;
line-height: 15px;
margin: 5px 0 0;
width: 100%;
}
.group .errorMsg {
display: none;
}
/* Error Styling */
.err label {
color: #cc0033;
}
.err input[type=text] {
background-color: #fce4e4;
border: 1px solid #cc0033;
outline: none;
}
.err .errorMsg {
display: inline-block;
}
<div class="group err">
<label for="time">Time</label>
<input type="text" name="time" id="time" />
<div class="errorMsg">Invalid Time Format</div>
</div>
<div class="group">
<label for="time2">Time2</label>
<input type="text" name="time2" id="time2" />
<div class="errorMsg">Invalid Time Format</div>
</div>
Any recommendations to fix the poor alignment?
You can align them like this. I have added comments to the right of the changes.
.group {
display: flex;
flex-wrap: wrap; /* Wrap the elements */
margin-top: 4px;
}
.group label {
display: flex;
width: 15%;
line-height: 30px;
justify-content: center;
align-items: center;
}
.group input[type="text"] {
width: 85%;
border: 1px solid rgb(116, 115, 115);
padding-left: 3px;
flex: 1; /* Take the remaining width */
}
.group textarea:focus,
input:focus {
outline: none;
}
.group .errorMsg {
color: #cc0033;
display: inline-block;
font-size: 12px;
line-height: 15px;
margin: 5px 0 0;
width: 100%;
}
.group .errorMsg {
display: none;
}
/* Error Styling */
.err label {
color: #cc0033;
}
.err input[type=text] {
background-color: #fce4e4;
border: 1px solid #cc0033;
outline: none;
}
.err .errorMsg {
display: flex; /* Instead of inline-block */
width: 85%; /* Same as input width */
left: 15%; /* Rest of the width */
position: relative; /* Relative to parent */
}
<div class="group err">
<label for="time">Time</label>
<input type="text" name="time" id="time" />
<div class="errorMsg">Invalid Time Format</div>
</div>
<div class="group">
<label for="time2">Time2</label>
<input type="text" name="time2" id="time2" />
<div class="errorMsg">Invalid Time Format</div>
</div>
every time when I have to work with Inputs this problem occurs.
My goal is to make a simple input form and achieve that 2 Inputs type number will be the same width, with small space between them in one line, just under "Description" input.
I've tried to add them to divs and apply Display:inline-block to them, but it didn't work. Now I've tried to apply display: flex on it a this is the result. Changing the width of input does not work. Thank you for your help.
.inputBox{
width: 30%;
padding: 2em;
text-align: center;
background-color: white;
border-radius: .3em;
}
.inputBox h3{
font-size: 2em;
font-weight: 300;
}
.inputBox input[type="text"]{
width: 100%;
padding: .5em;
margin: 1em 0;
border-radius: .3em;
border: 1px solid grey;
box-sizing: border-box;
}
.inputBox input[type="number"]{
padding: .5em;
border-radius: .3em;
border: 1px solid grey;
box-sizing: border-box;
width: 100%;
}
label{
display: block;
text-align: left;
}
.flex{
display: flex;
justify-content: space-between;
}
<div className="inputBox">
<h3>Please set your alarm</h3>
<label for="text">Description</label>
<input type="text" id="text" />
<div className="flex">
<div className="inputNumber">
<label>Hours</label>
<input type="number" />
</div>
<div className="inputNumber">
<label>Minutes</label>
<input type="number" />
</div>
</div>
.inputBox{
width: 30%;
padding: 2em;
text-align: center;
background-color: white;
border-radius: .3em;
}
.inputBox h3{
font-size: 2em;
font-weight: 300;
}
.inputBox input[type="text"]{
width: 100%;
padding: .5em;
margin: 1em 0;
border-radius: .3em;
border: 1px solid grey;
box-sizing: border-box;
}
.inputBox input[type="number"]{
padding: .5em;
border-radius: .3em;
border: 1px solid grey;
box-sizing: border-box;
width: 100%;
}
label{
display: block;
text-align: left;
}
.flex{
display: flex;
justify-content: space-between;
}
.inputNumber{
flex-basis:48%;
}
<div class="inputBox">
<h3>Please set your alarm</h3>
<label for="text">Description</label>
<input type="text" id="text" />
<div class="flex">
<div class="inputNumber">
<label>Hours</label>
<input type="number" />
</div>
<div class="inputNumber">
<label>Minutes</label>
<input type="number" />
</div>
</div>
If you want to keep inputBox's width at 30%, you can do something like this:
HTML
<div class="inputBox">
<h3>Please set your alarm</h3>
<label for="text">Description</label>
<input type="text" id="text" />
<div class="flex">
<div class="inputNumber">
<label>Hours</label>
<input type="number" />
</div>
<div class="inputNumber second">
<label>Minutes</label>
<input type="number" />
</div>
</div>
</div>
CSS
.inputBox {
width: 30%;
padding: 2em;
text-align: center;
background-color: white;
border-radius: .3em;
}
.inputBox h3 {
font-size: 2em;
font-weight: 300;
}
.inputBox input[type="text"] {
width: 100%;
padding: .5em;
margin: 1em 0;
border-radius: .3em;
border: 1px solid grey;
box-sizing: border-box;
}
.inputBox input[type="number"] {
padding: .5em;
border-radius: .3em;
border: 1px solid grey;
box-sizing: border-box;
width: 100%;
}
label {
display: block;
text-align: left;
}
.flex {
display: flex;
flex-direction: row;
}
.inputNumber {
width: 50%;
}
.second {
margin-left: 5%;
}
two problems:
you are using className when you should be using class
change .inputBox width to 100%
also, you should ALWAYS try to post a working snippet that shows your problem. You will get back answers faster and ones that are more likely to work!
.inputBox{
width: 100%;
padding: 2em;
text-align: center;
background-color: white;
border-radius: .3em;
}
.inputBox h3{
font-size: 2em;
font-weight: 300;
}
.inputBox input[type="text"]{
width: 100%;
padding: .5em;
margin: 1em 0;
border-radius: .3em;
border: 1px solid grey;
box-sizing: border-box;
}
.inputBox input[type="number"]{
padding: .5em;
border-radius: .3em;
border: 1px solid grey;
box-sizing: border-box;
width: 100%;
}
label{
display: block;
text-align: left;
}
.flex{
display: flex;
justify-content: space-between;
}
<div class="inputBox">
<h3>Please set your alarm</h3>
<label for="text">Description</label>
<input type="text" id="text" />
<div class="flex">
<div class="inputNumber">
<label>Hours</label>
<input type="number" />
</div>
<div class="inputNumber">
<label>Minutes</label>
<input type="number" />
</div>
</div>
you can use display: grid on your parent and modify the first child of grid to span across the first line like:
.parentContainer {
/* this will create the grid for us with 1rem gap between children */
display: grid;
grid-template-columns: repeat(1, 1fr),
grid-gap: 1rem;
}
.theChildElementYouWantToFullWidth {
grid-column: 1 / span 3;
}
for more information check this doc from MDN on Grid styling!
I'm trying to get the two block elements to be on different lines when the browser window is less than 768px. The media query tells the yellow and green divs to be blocks in responsive view, but nothing happens. If you apply the display block to all elements on mobile view, nothing still happens.
I thought block elements were 100% wide and operate on a single row?
#newsletter-wrap {
width: 100%;
height: auto;
background: lightgrey;
float: left;
display: flex;
justify-content: center;
align-items: center;
font-size: 22px;
font-weight: 300;
padding: 25px 25px;
box-sizing: border-box;
}
#newsletter-wrap > *, #newsletter-wrap > form > * {
display: inline;
vertical-align: middle;
}
#newsletter-button {
border: none;
border-radius: 6px;
padding: 10px 20px;
border: 1px solid #333;
cursor: pointer;
}
input {
-webkit-appearance: none;
-moz-appearance: none;
appearance: none;
}
#mce-EMAIL {
background: pink;
width: 300px;
height: 25px;
margin: 0 25px;
border: 1px solid #333;
text-align: center;
padding: 4px;
}
#mc-embedded-subscribe-form {
background: green;
width: auto;
text-align: center;
height: auto;
float: left;
}
#newsletter-wrap-text {
background: yellow;
width: auto;
height: auto;
float: left;
}
/* MOBILE */
#media handheld, screen and (max-width: 768px) {
/* BELOW HAS A PROBLEM */
#newsletter-wrap-text, #mc-embedded-subscribe-form {
display: block;
}
}
<section id="newsletter-wrap">
<div id="newsletter-wrap-text">wuf wfbrie erig ergibw eiwbfwe wef00x0 __W)9.</div>
<form action="https://eiurfhyergv.us17.list-manage.com/subscribe/post?u=8c38151fa33f984127db5705c&id=4c741659e1" method="post" id="mc-embedded-subscribe-form" name="mc-embedded-subscribe-form" class="validate" target="_blank" novalidate>
<input type="email" placeholder="email" value="" name="EMAIL" class="required email" id="mce-EMAIL">
<div id="mce-responses">
<div class="response" id="mce-error-response" style="display:none"></div>
<div class="response" id="mce-success-response" style="display:none"></div>
</div>
<input type="submit" value="Subscribe" name="subscribe" id="newsletter-button">
</form>
</section>
As you have set display: flex to the parent section container, you have to set flex-direction: column; in order to display the child elements in a column rather than in a row. (or you could just not use display: flex at all and leave the block elements as they are, but I assume that flex is there for a reason like responsiveness or something)
By the way, you could also leave out the float: left as it has no effect in this case. I'd generally advise to clean the CSS up a bit. You are using display: flex;, but then there are the floats and display: inline, which is then again being overwritten by display: block - that's all unnecessary!
#newsletter-wrap {
width: 100%;
height: auto;
background: lightgrey;
float: left;
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
font-size: 22px;
font-weight: 300;
padding: 25px 25px;
box-sizing: border-box;
}
#newsletter-wrap > *, #newsletter-wrap > form > * {
display: inline;
vertical-align: middle;
}
#newsletter-button {
border: none;
border-radius: 6px;
padding: 10px 20px;
border: 1px solid #333;
cursor: pointer;
}
input {
-webkit-appearance: none;
-moz-appearance: none;
appearance: none;
}
#mce-EMAIL {
background: pink;
width: 300px;
height: 25px;
margin: 0 25px;
border: 1px solid #333;
text-align: center;
padding: 4px;
}
#mc-embedded-subscribe-form {
background: green;
width: auto;
text-align: center;
height: auto;
float: left;
}
#newsletter-wrap-text {
background: yellow;
width: auto;
height: auto;
float: left;
}
/* MOBILE */
#media handheld, screen and (max-width: 768px) {
/* BELOW HAS A PROBLEM */
#newsletter-wrap-text, #mc-embedded-subscribe-form {
display: block;
}
}
<section id="newsletter-wrap">
<div id="newsletter-wrap-text">wuf wfbrie erig ergibw eiwbfwe wef00x0 __W)9.</div>
<form action="https://eiurfhyergv.us17.list-manage.com/subscribe/post?u=8c38151fa33f984127db5705c&id=4c741659e1" method="post" id="mc-embedded-subscribe-form" name="mc-embedded-subscribe-form" class="validate" target="_blank" novalidate>
<input type="email" placeholder="email" value="" name="EMAIL" class="required email" id="mce-EMAIL">
<div id="mce-responses">
<div class="response" id="mce-error-response" style="display:none"></div>
<div class="response" id="mce-success-response" style="display:none"></div>
</div>
<input type="submit" value="Subscribe" name="subscribe" id="newsletter-button">
</form>
</section>