-2
I have the following form I want to load into a div
@charset "UTF-8";
*{
padding: 0;
margin: 0;
}
.form {
display: flex;
width: 50%;
margin-left: 350px;
}
.campo {
width: 40%;
float: left;
margin: 10px;
}
fieldset {
padding-left: 50px;
}
.campo input {
margin: 10px 1%;
width: 60%;
}
.campo select {
margin: 10px 1%;
width: 60%;
}
label {
display: inline-block;
width: 70px;
font-size: 14px;
}
label:after {
content: ':';
}
legend {
text-align: center;
font-weight: bold;
font-size: 13pt;
}
input[type=text], input[type=number], input[type=date],
input[type=email], input[type=password], select {
padding: 5px;
border: 1px solid #ccc;
border-radius: 4px;
}
input:hover {
background-color: #D3D3D3;
}
input[type=submit] {
background-color: #4CAF50;
color: white;
padding: 12px 20px;
border: none;
border-radius: 4px;
cursor: pointer;
float: right;
margin-right: 15px;
margin-top: 10px;
}
input[type=submit]:hover {
background-color: #008000;
}
input[type=reset] {
background-color: #FF6347;
color: white;
padding: 12px 20px;
border: none;
border-radius: 4px;
cursor: pointer;
float: right;
margin-top: 10px;
}
input[type=reset]:hover {
background-color: #FF0000;
}
input[type=checkbox] {
margin: -60px;
}
span {
padding: -5px;
border:none;
}
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<link rel="stylesheet" type="text/css" href="css/formstyle.css">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.4.1/jquery.min.js"></script>
<title></title>
</head>
<body>
<form class="form" method="post" action="#">
<div class="area">
<fieldset>
<legend>Cadastrar Computadores</legend>
<div class="campo">
<label for="nome">Nome</label>
<input type="text" name="nome" id="nome" placeholder="Digite o nome" required>
</div>
<div class="campo">
<label for="status">Status</label>
<select name="status" id="status" required>
<option value=""></option>
<option value="#">Habilitado</option>
<option value="#">Desabilitado</option>
</select>
</div>
<div class="campo">
<label for="fab">Fabricante</label>
<input type="text" name="fab" id="fab" placeholder="Informe o fabricante">
</div>
<div class="campo">
<label for="model">Modelo</label>
<input type="text" name="model" id="model" placeholder="Informe o modelo" >
</div>
<div class="campo">
<label for="pm">Placa-mãe</label>
<input type="text" name="pm" id="pm" placeholder="Informe o modelo" >
</div>
<div class="campo">
<label for="proc">Processador</label>
<input type="text" name="proc" id="proc" placeholder="Informe o modelo" >
</div>
<div class="campo">
<label for="ram">RAM</label>
<input type="number" name="ram" id="ram" placeholder="Informe a qtd em GB" >
</div>
<div class="campo">
<label for="hd">HD</label>
<input type="number" name="hd" id="hd" placeholder="Informe a qtd em GB" >
</div>
<div class="campo">
<label for="ssd">Possui SSD?</label>
<span>Sim</span>
<input type="checkbox" name="ssd" id="ssd" onchange="habilitar()">
</div>
<div class="campo">
<label for="qtd">Quantidade</label>
<input type="number" name="qtd" id="qtd" placeholder="Informe a qtd em GB" disabled>
</div>
<div class="campo">
<label for="video">Placa de vídeo</label>
<input type="text" name="video" id="video" placeholder="Informe o modelo" >
</div>
<div class="campo">
<label for="fonte">Fonte de alimentação</label>
<input type="text" name="fonte" id="fonte" placeholder="Informe o modelo" >
</div>
<div class="campo">
<label for="leitor">Driver óptico</label>
<input type="text" name="leitor" id="leitor" placeholder="Informe o modelo" >
</div>
<div class="campo">
<label for="inventario">Nº de inventário</label>
<input type="number" name="inventario" id="inventario" placeholder="Informe um número" >
</div>
<div class="campo">
<label for="comentarios">Comentários</label>
<textarea rows="8" cols="60" maxlength="500"></textarea>
</div>
</fieldset>
<input type="submit" name="Enviar" value="Enviar">
<input type="reset" name="Limpar" value="Limpar" style="margin-right: 15px;">
</div>
</form>
<body>
Here begins the menu I want to load the form inside so that it is centralized and without losing formatting
@charset "UTF-8";
*{
margin: 0;
padding: 0;
box-sizing: border-box;
list-style: none;
text-decoration: none;
font-family: 'Arial', sans-serif;
}
.wrapper{
display: flex;
position: relative;
}
.wrapper .sidebar{
height: 100%;
background-color: #1D2731;
position: fixed;
border-right: 1px solid #0B3C5D;
}
.wrapper .main_content{
width: 100%;
margin-left: 250px;
top: 0;
}
.wrapper .main_content .header{
padding: 21px;
background-color: #0B3C5D;
color: #fff;
position: fixed;
width: 100%;
}
<div class="wrapper">
<div class="sidebar">
<div class="main_content">
<div class="header">
<a href="#">Sair</a>
</div>
<div id="conteudo">
<!--conteudo-->
</div>
</div>
</div>
</div>
I want to center this page inside the div id="content"
Solved friend, thank you very much!!!
– Rickkdinho