I want to put the contact form with the inputs
on the left side and the textarea
on the right side as in the image below, I can do the expected result with the float:left
however my layout ends up breaking.
Howtoachievetheexpectedresultwithoutfloat
?
HereisthecodeIused:
.contact{
float: left;
width: 49.5%;
}
input, textarea{
border: 1px solid lightblue;
width: 100%;
}
textarea{
height: 65px;
resize: none;
}
.left{
margin-right: .5%;
}
.right{
margin-left: .5%;
}
<div class="contact left">
<input type="text" name="nome" autocomplete="name" placeholder="Nome" required>
<input type="text" name="empresa" autocomplete="organization" placeholder="Empresa">
<input type="text" name="telefone" autocomplete="tel-national" placeholder="Telefone" required>
</div>
<div class="contact right">
<textarea name="mensagem" placeholder="Mensagem" required></textarea> </div>