-1
I am new in programming, I wanted to know how to organize the fields of my following form so that both the label and inputs are aligned, and that equal interest fields, such as (name and surname), (street, number, city and state) are side by side.
@charset "UTF-8";
.form {
display: flex;
width: 550px;
margin-left: 400px;
}
input[type=text], input[type=number], input[type=date],
input[type=email], input[type=password], select {
padding: 12px;
border: 1px solid #ccc;
border-radius: 4px;
resize: vertical;
}
input[type=submit] {
background-color: #4CAF50;
color: white;
padding: 12px 20px;
border: none;
border-radius: 4px;
cursor: pointer;
float: left;
margin-right: 15px;
margin-top: 10px;
}
input[type=submit]:hover {
background-color: #45a049;
}
input[type=reset] {
background-color: #FF6347;
color: white;
padding: 12px 20px;
border: none;
border-radius: 4px;
cursor: pointer;
float: left;
margin-top: 10px;
}
input[type=reset]:hover {
background-color: #FF0000;
}
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<link rel="stylesheet" type="text/css" href="css/formstyle-user.css">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.4.1/jquery.min.js"></script>
<title>Cadastrar Usuario</title>
</head>
<body>
<form class="form" method="post" action="#">
<div class="area">
<fieldset id="usuario">
<legend>Dados Pessoais</legend>
<label for="nome">Nome: </label>
<input type="text" name=" nome" id="nome" placeholder="Nome" required="">
<label for="sobrenome">Sobrenome: </label>
<input type="text" name="sobrenome" id="sobrenome" placeholder="Sobrenome" required>
<label for="cpf">CPF: </label>
<input type="text" name="cpf" placeholder="000.000.000-00" required>
<label for="dtnasc">Data Nasc: </label>
<input type="date" name="dtnasc" id="dtnasc" required>
<fieldset id="sexo">
<legend>Sexo: </legend>
<label for="masc">Masculino<input type="radio" name="sexo" id="masc" checked required></label>
<label for="fem">Feminino<input type="radio" name="sexo" id="fem" required></label>
</fieldset>
</fieldset>
<fieldset id="endereco">
<legend>Endereço</legend>
<label for="rua">Logradouro: </label> <input type="text" name="rua" id="rua" placeholder="João Alvez" required>
<label for="numero">Número: </label><input type="number" name="numero" id="numero" required>
<label for="bairro">Bairro: </label><input type="text" name="bairro" id="bairro" >
<label for="estados">Estado: </label>
<select id="estados" required>
<option value=""></option>
</select>
<label for="cidades">Cidade: </label>
<select id="cidades" required>
<option value=""></option>
</select>
</fieldset>
<fieldset id="login">
<legend>Dados para Login</legend>
<label for="email">E-mail: </label><input type="email" name="email" id="email" required>
<label for="senha">Senha: </label><input type="password" name="senha" id="senha" required>
<label for="confirma_senha">Confirmar Senha: </label> <input type="password" name="confirma_senha" id="confirma_senha" required>
<label for="nivel">Nível de acesso: </label>
<select name="nivel" id="nivel" required>
<option value="">---</option>
<option value="#">1-Administrador</option>
<option value="#">2-Técnico</option>
<option value="#">3-Comum</option>
</select>
<label for="cel">Cel: <input type="text" name="cel" id="cel" required></label>
</fieldset>
<input type="submit" name="Enviar" value="Enviar">
<input type="reset" name="Limpar" value="Limpar">
</form>
</div>
</body>
</html>
perfect, thank you very much friend
– Rickkdinho