Theform
isinsideaclasscalledcontainer
whichhasthefollowingattributes:'
.container{width:80%;margin:auto;padding:30px;}
IfIaddatext-align:center
tothecontainer,Icancentralizetheform.However,whenIdothis,thelabelsontopoftheinputsarecenteredrelativetotheinputaswell.
HowcanIcentralizetheformwithoutthishappening?
ThehtmloftheFormisthis:
<form><divclass="form-group">
<label for="name">Nome:</label>
<input type="text" name="name" id="name" required>
</div>
<div class="form-group">
<label for="age">Idade:</label>
<input type="number" name="age" id="age" required>
</div>
<div class="form-group">
<label for="work-area">Área de atuação:</label>
<select name="work-area" id="work-area" required>
<option value="developer">Desenvolvedor</option>
<option value="infra">Infraestrutura</option>
<option value="designer">Designer</option>
</select>
</div>
<div class="form-group">
<label for="vacation">Férias?</label>
<input type="checkbox" name="vacation" id="vacation">
</div>
<div class="form-group">
<label for="entry-date">Data de entrada:</label>
<input type="date" required id="entry-date">
</div>
<button type="submit">Salvar</button>
</form>