I have 2 divs in my code, the first div is an image, the second div is a form, I want to put them both side by side, and when seen on the mobile it breaks, keep one div on top and the other on div How do I do this?
form {
width: 400px;
padding: 1em;
border: 1px solid #CCC;
border-radius: 1em;
background-color: #f2f2f2;
overflow: hidden;
display: block;
}
div + div {
margin-top: 1em;
}
label {
display: inline-block;
width: 90px;
text-align: right;
}
input, textarea {
font: 1em sans-serif;
width: 300px;
-moz-box-sizing: border-box;
box-sizing: border-box;
border: 1px solid #999;
}
input:focus, textarea:focus {
border-color: #000;
}
textarea {
vertical-align: top;
height: 5em;
resize: vertical;
}
.button {
padding-left: 90px;
}
button {
margin-left: .5em;
}
#main img{
margin-left: 25%;
}
<div id="main">
<img width="240px" src="https://www.sketchappsources.com/resources/source-image/google-chrome.png"/><divclass="center" id="form">
<form action="/my-handling-form-page" method="post">
<div>
<label for="name"></label>
<input placeholder=" Nome Completo" type="text" id="name" name="user_name">
</div>
<div>
<label for="mail"></label>
<input placeholder=" E-mail" type="email" id="mail" name="user_email">
</div>
<div>
<label for="fone"></label>
<input placeholder=" Telefone" type="fone" id="fone" name="user_fone">
</div>
</form>
</div>
</div>