How can I make an search form like this? - html

I just wonder is here is any easy way to make search button like this:There is a search form I want to make
For now I have smth like this:This is what I have for now
And there is HTML and CSS:
.path1{
max-width: 18px;
max-height: 18px;
}
.search-button{
border-bottom: #0A093D;
width: 30%;
height: 100%;
display: flex;
flex-direction: row;
justify-content: center;
}
<div class="search-button">
<form id="form">
<button><img class="path1" src="C:\Users\przem\Projekty\strona-task\img\1024px-Search_Icon.svg.png"></img></button>
<input type="search" id="query" name="q" placeholder="Search...">
</form>
</div>

you can also put a unicode inside the placeholder.
.path1{
max-width: 18px;
max-height: 18px;
}
.search-button{
border-bottom: #0A093D;
width: 30%;
height: 100%;
display: flex;
flex-direction: row;
justify-content: center;
}
<div class="search-button">
<form id="form">
<input type="search" id="query" name="q" placeholder=" 🔍︎ Search...">
</form>
</div>

Here you go...
input {
border: none;
}
.search-button {
width: 250px;
border-bottom: 2px solid lightgrey;
padding-bottom: 10px;
}
<div class="search-button">
<form id="form">
<button><img class="path1" src="C:\Users\przem\Projekty\strona-task\img\1024px-Search_Icon.svg.png"></button>
<input type="search" id="query" name="q" placeholder="Search...">
</form>
</div>

Related

Space Evenly only for the inputs of a form

I am trying to create a flashcard system where users will see input on the left and right for the front and back of their cards.
I am trying to have the Label above, submit button below and the front and back inputs beside each other.
My attempts have results in all 4 being stacked ontop or beside each other. Is this something possible with html and css?
HTML
<div class="view_new_flashcard">
<form method="POST" action="'.newcard($conn).'">
<input type="hidden" name="PostID" value="'.$PostID.'">
<input type="hidden" name="MatchUserID" value="'.$UserID.'">
<label>Enter New Card Information</label>
<br><br>
<input type="text" name="FrontSide" placeholder="Front of Card">
<input type="text" name="BackSide" placeholder="Back of Card">
<br>
<br>
<button type="submit" name="addcard">Add New Card</button>
</form>
CSS
.view_new_flashcard {
display: flex;
justify-content: space-evenly;
box-sizing: border-box;
width: 100%;
padding: 5px;
}
.view_new_flashcard form {
width: 100%;
height: auto;
}
.view_new_flashcard input {
display: inline-block;
box-sizing: border-box;
border: 1px solid #eeeeee;
border-radius: 8px;
/* width: 100%; */
height: auto;
}
<div class="view_new_flashcard">
<form method="POST" action="'.newcard($conn).'">
<input type="hidden" name="PostID" value="'.$PostID.'">
<input type="hidden" name="MatchUserID" value="'.$UserID.'">
<label>Enter New Card Information</label>
<br><br>
<input type="text" name="FrontSide" placeholder="Front of Card">
<input type="text" name="BackSide" placeholder="Back of Card">
<br>
<br>
<button type="submit" name="addcard">Add New Card</button>
</form>
</div>
You could put the inputs in adiv with display: flex and use flex-grow: 1 on the input.
.view_new_flashcard {
display: flex;
justify-content: space-evenly;
box-sizing: border-box;
width: 100%;
padding: 5px;
}
.view_new_flashcard form {
width: 100%;
height: auto;
background: grey;
}
.view_new_flashcard input {
display: inline-block;
box-sizing: border-box;
border: 1px solid #eeeeee;
border-radius: 8px;
/* width: 100%; */
height: auto;
flex-grow: 1;
margin: 0 3px;
}
.view_new_flashcard .input-container {
display: flex;
}
<div class="view_new_flashcard">
<form method="POST" action="'.newcard($conn).'">
<input type="hidden" name="PostID" value="'.$PostID.'">
<input type="hidden" name="MatchUserID" value="'.$UserID.'">
<label>Enter New Card Information</label>
<br><br>
<div class="input-container">
<input type="text" name="FrontSide" placeholder="Front of Card">
<input type="text" name="BackSide" placeholder="Back of Card">
</div>
<br>
<br>
<button type="submit" name="addcard">Add New Card</button>
</form>
</div>

HTML-Trouble centering my forms in the divs

I am having troubles with centering and aligning the forms inside the divs
I can't get the green to size properly and centre the form inside the green.
BTW the pic is what it looks like on my computer, when you click the code snippet, it looks all jumbled.
<style type="text/css">
#div1 {
background-color: coral;
width: 33.33%;
float: right;
height: 200px;
text-align: center;
}
#div1_Child {
width: 100%;
height: 60%;
border: 0px solid blue;
margin: 0 auto;
text-align: center;
}
#div2 {
background-color: rgb(240, 191, 191);
width: 33.33%;
float: left;
height: 200px;
text-align: center;
}
#div2_Child {
width: 90%;
height: 60%;
border: 0px solid blue;
margin: 0 auto;
text-align: left;
}
#div3 {
background-color: aqua;
width: 33.33%;
margin: 0 auto;
height: 200px;
text-align: center;
}
#div3_Child {
width: 85%;
height: 60%;
border: 0px solid blue;
margin: 0 auto;
text-align: center;
padding: 5px;
}
label {
width: 200px;
display: inline-block;
text-align: right;
}
form {
border-radius: 10px;
background: green;
color: black;
width: 80%;
padding: 2px;
margin: 0 auto;
}
</style>
<div id="div1">Div1 Right
<h1>Lighter Load</h1>
<div id="div1_Child">
<form>
<label for="beams">Beam Thickness</label>
<select name="Beams" id="beam">
<option value="Select">Select</option>
<option value="3.5">3.5</option>
<option value="5.25">5.25</option>
<option value="7">7</option>
</select><br>
<label for="dead">Dead</label>
<input id="dead2" type="text" name="dead" onkeyup="ecCalc()"><br>
<label>Eccentric</label>
<input id="eccCalc" type="text" name="total"><br>
<label>Index</label>
<input type="text" id="ecc">
</form>
</div>
</div>
<div id="div2">Div2 Left
<h1>Post Height</h1>
<div id="div2_Child">
<form class="form">
<label for="column_Height">Column Height:</label>
<select id="column_Height" onchange="search1()";>
<option value="">Select</option>
<option value="90">89</option>
<option value="96">90</option>
<option value="102">96</option>
<option value="120">102</option>
<option value="144">120</option>
<option value="168">144</option>
<option value="192">168</option>
<option value="216">192</option>
<option value="216">216</option>
</select> <br>
<label for="value">Between</label>
<input type="text" id="value" size="4" disabled>
<label for="text">and</label>
<input type="text" id="text" size="4" disabled><br>
<label for="l_oad" class= "label1">Unfactored</label>
<input type="text" id="l_oad" onkeyup="search()" placeholder="Unfactored.." title="Load" size="15">
</form>
</div>
</div>
<div id="div3">Div3 Middle
<h1>Heaver Loads</h1>
<div id="div3_Child">
<form>
<label>Dead</label>
<input id="dead1" type="text" name="dead" onkeyup="total_1()" size="10px"><br>
<label>Live</label>
<input class="input1" id="live1" type="text" name="live" onkeyup="total_1()" size="10"><br>
<label>Total</label>
<input id="total1" type="text" name="total" size="10"><br>
</form>
</div>
</div>
Why won't you use flex box? For more info about flex box look here: link. For all row divs you can still use flexbox example flex-direction: row;. Width of items inside will corresponds to your screen width.
* { box-sizing: border-box; margin: auto; padding: auto; }
.container_main { width: auto; height: 400px; background: red; padding: 10px; display: flex; flex-direction: row; overflow: auto; }
.container_main .item { width: 100%; height: 100%; background: yellow; margin: 0 5px; padding: 5px }
.container_main form { height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.container_main form .form_item { width: 100%; height: 32px; display: flex; flex-direction: row; align-items: center; justify-content: center; }
<div class="container_main">
<div class="item">
<form method="post">
<div class="form_item">
<span>something</span>
<input type="text"/>
</div>
<div class="form_item">
<span>something</span>
<input type="text"/>
</div>
<div class="form_item">
<span>something</span>
<input type="text"/>
</div>
</form>
</div>
<div class="item">
<form method="post">
<div class="form_item">
<span>something</span>
<input type="text"/>
</div>
<div class="form_item">
<span>something</span>
<input type="text"/>
</div>
<div class="form_item">
<span>something</span>
<input type="text"/>
</div>
</form>
</div>
<div class="item">
<form method="post">
<div class="form_item">
<span>something</span>
<input type="text"/>
</div>
<div class="form_item">
<span>something</span>
<input type="text"/>
</div>
<div class="form_item">
<span>something</span>
<input type="text"/>
</div>
</form>
</div>
</div>

How can I bring this image to center? [duplicate]

This question already has answers here:
Center image using text-align center?
(28 answers)
Flexbox: center horizontally and vertically
(14 answers)
Closed 1 year ago.
For a long time, I am trying to resolve this issue but I was not able to find a good solution for this. I need to align this image on the center of the form but I am totally unsuccessful in it. You may feel like I am elaborating too much, but this is because StackOverflow is not letting me post this question because it thinks that this question needs deep elaboration. I don't know why.
This is my HTML:
<body>
<div class="wrapper">
<div class="form-container">
<h2>Login Form</h2>
<br>
<form action="" class="login-form">
<div class="imagecontainer">
<img src="https://raw.githubusercontent.com/EdiTechStudio/Beta-ETS/master/favicon.svg"
alt="Avatar" class="avatar">
</div>
<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>
</div>
</form>
</div>
</div>
</body>
This is my CSS:
* {
padding: 0;
margin: 0;
box-sizing: 0;
}
.wrapper {
display: flex;
justify-content: center;
align-items: center;
width: 100vw;
height: 100vh;
background-color: orange;
}
.form-container {
display: block;
width: 70vw;
height: 70vh;
padding-bottom: 150px;
}
form {
border: 3px solid #f1f1f1;
}
input[type="text"],
input[type="password"] {
width: 100%;
padding: 12px 20px;
margin: 8px 0;
display: inline-block;
border: 1px solid #ccc;
box-sizing: border-box;
}
button {
padding: 14px 20px;
margin: 8px 0;
width: 100%;
}
button:hover {
opacity: 0.8;
}
img.avatar {
width: 20%;
}
.container {
padding: 16px;
}
How can I align the image in the center? I have tried many ways. But I am not able to do it. I have tried aligning using display flex property and tried aligning it in the center and tried to justify the content in the center!
.imagecontainer {
text-align: center;
}
Will do the job.
Adding text-align:center should solve your problem -
<div class="wrapper">
<div class="form-container">
<h2>Login Form</h2>
<br>
<form action="" class="login-form">
<div class="imagecontainer" style="text-align:center">
<img src="https://raw.githubusercontent.com/EdiTechStudio/Beta-ETS/master/favicon.svg"
alt="Avatar" class="avatar">
</div>
<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>
</div>
</form>
</div>
</div>
* {
padding: 0;
margin: 0;
box-sizing: 0;
}
.wrapper {
display: flex;
justify-content: center;
align-items: center;
width: 100vw;
height: 100vh;
background-color: orange;
}
.form-container {
display: block;
width: 70vw;
height: 70vh;
padding-bottom: 150px;
}
form {
border: 3px solid #f1f1f1;
}
input[type="text"],
input[type="password"] {
width: 100%;
padding: 12px 20px;
margin: 8px 0;
display: inline-block;
border: 1px solid #ccc;
box-sizing: border-box;
}
button {
padding: 14px 20px;
margin: 8px 0;
width: 100%;
}
button:hover {
opacity: 0.8;
}
.imagecontainer {
display: flex;
justify-content: center;
}
img.avatar {
width: 20%;
}
.container {
padding: 16px;
}
<body>
<div class="wrapper">
<div class="form-container">
<h2>Login Form</h2>
<br>
<form action="" class="login-form">
<div class="imagecontainer">
<img src="https://raw.githubusercontent.com/EdiTechStudio/Beta-ETS/master/favicon.svg" alt="Avatar" class="avatar">
</div>
<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>
</div>
</form>
</div>
</div>
</body>
You need to use the flex property on the parent.
Add this to your css
.imagecontainer {
display: flex;
justify-content: center;
}
Just use margin
html, body {
margin: 0;
}
.wrapper {
display: flex;
justify-content: center;
align-items: center;
width: 100vw;
height: 100vh;
background-color: orange;
}
.form-container {
display: block;
width: 70vw;
height: 70vh;
padding-bottom: 150px;
}
form {
border: 3px solid #f1f1f1;
}
input[type="text"],
input[type="password"] {
width: 100%;
padding: 12px 20px;
margin: 8px 0;
display: inline-block;
border: 1px solid #ccc;
box-sizing: border-box;
}
button {
padding: 14px 20px;
margin: 8px 0;
width: 100%;
}
button:hover {
opacity: 0.8;
}
.imagecontainer {
text-align: center;
}
img.avatar {
width: 20%;
}
.container {
padding: 16px;
}
<body>
<div class="wrapper">
<div class="form-container">
<h2>Login Form</h2>
<br>
<form action="" class="login-form">
<div class="imagecontainer">
<img src="https://raw.githubusercontent.com/EdiTechStudio/Beta-ETS/master/favicon.svg"
alt="Avatar" class="avatar">
</div>
<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>
</div>
</form>
</div>
</div>
</body>
Try to use margin:auto on imagecontainer div.
You can make use of <center> tag.
<center>
<div class="imagecontainer">
<img src="https://raw.githubusercontent.com/EdiTechStudio/Beta-ETS/master/favicon.svg" alt="Avatar" class="avatar">
</div>
</center>
Just place the above code in place of imagecontainer div. You need to wrap the div in center tag.

How do I align my forms so that they look like this?

Hey, so I'm trying to build a movie review site which uses a database (I'm using PouchDB) and I want to style my admin/add a review page so that the inputs and labels are all aligned in a certain way. I keep adjusting widths, padding and margins but I just cant seem to get them to align. Can someone teach me how to align them the way i want them to be please?
This is how I want them to look:
body {
margin: 0;
font-family: georgia, arial;
background-color: #e0e0e0;
text-align: center;
}
.newFilm {
text-align: left;
display: inline-block;
background-color: green;
width: 80%;
padding: 20px;
}
label {
padding: 6px;
text-align: center;
background: red;
}
.form {
display: flex;
text-align: center;
flex-direction: column;
}
input {
margin: 10px;
width: 40%;
background-color: yellow;
padding: 8px;
border: 2px;
}
<div class="newFilm">
<h2 id='formTitle'>Create new review</h2>
<div class="form">
<form>
<label for="title">Title:</label><input type="text" id="title">
<label for="genre">Genre:</label><input type="text" id="genre">
<label for="image">Image:</label><input type="text" id="image">
<label for="rating">Rating:</label><input type="number" id="rating">
<label for="synopsis">Synopsis:</label><input type="text" id="synopsis">
<label for="trailer">Trailer:</label><input type="text" id="trailer">
<input type="hidden" id="id">
<button id="modifyFilmButton">Post review!</button>
</form>
</div>
</div>
you can use either flex or grid or both. I've used both just as an example. you could also use only grid and nest a grid within a grid.
body {
margin: 0;
font-family: georgia, arial;
background-color: #e0e0e0;
text-align: center;
}
.newFilm {
background-color: green;
max-width: 100%;
padding: 10%;
display: grid;
grid-template-columns: 1fr 1fr;
grid-gap: 30px;
}
#formTitle {
grid-column: 1/3;
}
#modifyFilmButton {
grid-column: 2/3;
width: 50%;
justify-self: end;
}
.left {
display: flex;
justify-content: center;
flex-direction: column;
text-align: left;
}
.right {
display: flex;
flex-direction: column;
text-align: left;
}
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8" />
<title>temp</title>
<link rel="stylesheet" type="text/css" href="temp.css" />
</head>
<body>
<div class="newFilm">
<h2 id="formTitle">Create new review</h2>
<div class="left">
<label for="title">Title:</label><input type="text" id="title" />
<label for="image">Image:</label><input type="text" id="image" />
<label for="trailer">Trailer:</label><input type="text" id="trailer" /> <input type="hidden" id="id" />
<label for="rating">Rating:</label><input type="number" id="rating" />
</div>
<div class="right">
<label for="genre">Genre:</label><input type="text" id="genre" />
<label for="synopsis">Synopsis:</label><input type="text" id="synopsis" />
</div>
<button id="modifyFilmButton">Post review!</button>
</div>
<script src="temp.js"></script>
</body>
</html>
Modified your html a little to add some structure.
I would not recommend using this code, look into bootstrap tables, or something of that nature. It will look better, and be a more scaleable solution.
.newFilm {
background-color: red;
padding: 20px;
border-radius: 20px;
}
textarea,
input,
label {
display: block
}
textarea,
input {
width: 200px;
}
.form {
width: 100%;
}
.left,
.right {
width: 49%;
display: inline-block;
vertical-align: top;
}
<div class="newFilm">
<h2 id='formTitle'>Create new review</h2>
<div class="form">
<form>
<div class="left">
<label for="title">Title:</label>
<input type="text" id="title">
<label for="genre">Genre:</label>
<input type="text" id="genre">
<label for="image">Image:</label>
<input type="text" id="image">
<label for="rating">Rating:</label>
<input type="number" id="rating">
</div>
<div class="right">
<label for="synopsis">Synopsis:</label>
<input type="text" id="synopsis">
<label for="trailer">Trailer:</label>
<textarea id="trailer" rows="5"></textarea>
<input type="hidden" id="id">
<button id="modifyFilmButton">Post review!</button>
</div>
</form>
</div>
</div>
Responsive solution:
.myForm {
background-color: red;
padding: 20px;
border-radius: 20px;
}
<link href="https://stackpath.bootstrapcdn.com/bootstrap/4.2.1/css/bootstrap.min.css" rel="stylesheet" />
<div class="container-fluid myForm">
<div class="row">
<div class="col-lg"><h1>Create New Review</h1></div>
</div>
<form>
<div class="row">
<div class="col-md"> <!-- left column -->
<div class="form-group">
<label>Title</label>
<input type="text" class="form-control">
</div>
<div class="form-group">
<label>Genre</label>
<input type="text" class="form-control">
</div>
<div class="form-group">
<label>Image</label>
<input type="text" class="form-control">
</div>
<div class="form-group">
<label>Rating</label>
<input type="text" class="form-control">
</div>
</div>
<div class="col-md"> <!-- right column -->
<div class="form-group">
<label>Synopsis</label>
<input type="text" class="form-control">
</div>
<div class="form-group">
<label>Trailer</label>
<textarea class="form-control"></textarea>
</div>
<input class="btn btn-primary" type="submit" value="Submit" disabled>
</div>
</div>
</form>
</div>
Adjust the left/right columns to have your desired effect.
See: https://getbootstrap.com/docs/4.1/layout/grid/
Well there are couple ways to do that.
My best option would be to have one big div that would hold two smaller divs.
Then give those two divs width of 50% each - i have used grid for that.
After that you want to make sure that label and input are taking full width of their container.
Like that you will achieve most of what you want. Also for Synopsis you should use textarea not input.
Here is my example on codepen.
Here is what I did
body {
margin: 0;
font-family: georgia, arial;
background-color: #e0e0e0;
text-align: center;
}
.newFilm {
text-align: left;
display: inline-block;
background-color: green;
width: 80%;
padding: 20px;
}
label {
padding: 6px;
color: #fff;
display: block;
text-align: left;
}
.form {
display: flex;
text-align: center;
flex-direction: column;
}
.row {
display: grid;
grid-template-columns: 1fr 1fr;
}
.col {
padding: 20px;
}
input,
textarea {
width: 100%;
display: block;
background-color: yellow;
padding: 8px;
border: 2px;
}
#modifyFilmButton {
float: right;
}
<div class="newFilm">
<h2 id='formTitle'>Create new review</h2>
<div class="form">
<form>
<div class="row">
<div class="col">
<label for="title">Title:</label><input type="text" id="title">
<label for="image">Image:</label><input type="text" id="image">
<label for="trailer">Trailer:</label><input type="text" id="trailer">
<label for="rating">Rating:</label><input type="number" id="rating">
</div>
<div class="col">
<label for="genre">Genre:</label><input type="text" id="genre">
<label for="synopsis">Synopsis:</label>
<textarea rows="9" id="synopsis"></textarea>
</div>
</div>
<input type="hidden" id="id">
<button id="modifyFilmButton">Post review!</button>
</form>
</div>
</div>

Align inputs and textarea with labels vertically even

I want to create this form in css
HTML
<div class="contact__right">
<form action="" class="contact__form">
<div>
<label for="name" class="contact__form-label">Name</label>
<input type="text" id="name" class="contact__form-input">
</div>
<div>
<label for="email" class="contact__form-label">Email</label>
<input type="text" id="email" class="contact__form-input">
</div>
<div>
<label for="phone" class="contact__form-label">Phone</label>
<input type="text" id="phone" class="contact__form-input">
</div>
<div>
<label for="message" class="contact__form-label">Message</label>
<textarea name="message" id="message" cols="30" rows="10" class="contact__form-textarea"></textarea>
</div>
</form>
</div>
CSS
.contact {
&__form {
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
padding: 105px 95px;
color: $white;
}
&__form-input,
&__form-textarea {
width: 300px;
height: 40px;
background: transparent;
border: 1px solid white;
border-radius: 2px;
margin-bottom: 25px;
}
&__form-textarea {
height: 150px;
}
&__form-label {
padding-right: 70px;
}
}
What I'm struggling with is alignment of inputs with labels and of textarea at the same line vertically.
textarea always sticks out at the side, because of its label which has longer text than the rest.
All the help will be appreciated.
I would not use a flexbox for the form, but for each <div> inside the form. The labels are vertically centered for each input field, except for the textarea. There the label is vertically aligned at the top. You can play with top padding there when desired.
* {
box-sizing: border-box;
}
.contact__right {
background-color: gray;
}
.contact__form {
padding: 105px 95px;
width: 100%;
color: white;
}
.contact__form>div {
display: flex;
align-items: center;
justify-content: space-between;
margin-bottom: 25px;
}
.contact__form-input,
.contact__form-textarea {
width: 300px;
height: 40px;
background: transparent;
border: 1px solid white;
border-radius: 2px;
}
.contact__form-textarea {
height: 150px;
}
label[for="message"].contact__form-label {
align-self: flex-start;
}
<div class="contact__right">
<form action="" class="contact__form">
<div>
<label for="name" class="contact__form-label">Name</label>
<input type="text" id="name" class="contact__form-input">
</div>
<div>
<label for="email" class="contact__form-label">Email</label>
<input type="text" id="email" class="contact__form-input">
</div>
<div>
<label for="phone" class="contact__form-label">Phone</label>
<input type="text" id="phone" class="contact__form-input">
</div>
<div>
<label for="message" class="contact__form-label">Message</label>
<textarea name="message" id="message" cols="30" rows="10" class="contact__form-textarea"></textarea>
</div>
</form>
</div>
Add following css code and your problem will be solved.
.contact__form-label {
vertical-align: top;}
Add this CSS rule for label:
label {
width: 100px;
display: inline-block;
vertical-align: top;
}
(otherwise label will be treated as an inline-element. This way you give it a fixed width and align it to the top)
If you don't like the alignment at the very top, you can add a padding-top ike in the following snippet:
form {
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
padding: 105px 95px;
color: $white;
}
input,
textarea {
width: 300px;
height: 40px;
background: transparent;
border: 1px solid white;
border-radius: 2px;
margin-bottom: 25px;
}
textarea {
height: 150px;
}
label {
width: 100px;
display: inline-block;
vertical-align: top;
padding-top: 14px;
}
.contact__right {
background: #ccc;
}
<div class="contact__right">
<form action="" class="contact__form">
<div>
<label for="name" class="contact__form-label">Name</label>
<input type="text" id="name" class="contact__form-input">
</div>
<div>
<label for="email" class="contact__form-label">Email</label>
<input type="text" id="email" class="contact__form-input">
</div>
<div>
<label for="phone" class="contact__form-label">Phone</label>
<input type="text" id="phone" class="contact__form-input">
</div>
<div>
<label for="message" class="contact__form-label">Message</label>
<textarea name="message" id="message" cols="30" rows="10" class="contact__form-textarea"></textarea>
</div>
</form>
</div>
´
You are gonna have to do that manually I guess. Normally websites tend to break line after the labels and bring the input fields to the next line.