0
I have the page below,
http://www.hotplateprensas.com.br/gasmuriae
On the right side of the page index php., has a botão
piece your gas.
To the click on, there’s gonna be a formulário
to fill in address data.
At the end of form
, has a button
what desire centralize.
But nothing I do works.
I already put in:
margin: auto !important;
text_align: ceter !important;
Nothing works.
@charset "utf-8";
/* CSS Document */
img {
border: 0;
max-width: 100%;
}
label {
line-height: 40px;
display: inline-block;
vertical-align: middle;
}
select {
width: 110px;
height: 50px;
}
.typeTextGrande, .typeTextMedio, .typeTextPequeno {
height: 36px;
padding: 9px;
}
.typeTextPequeno {
width: 150px;
}
.typeTextMedio {
width: 250px;
}
.typeTextGrande {
width: 450px;
}
.labelPequeno {
width: 100px;
}
.labelMedio {
width: 200px;
}
.labelGrande {
width: 300px;
}
.h1Centralizado, .h1CentralizadoAvisos {
width: 100%;
line-height: 50px;
text-align: center;
}
button.btnPecaGas {
background-size: contain;
background-repeat: no-repeat;
background-position: right;
width: 208px;
height: 44px;
}
button.btnPecaGas {
background-image: url(../../_img/botijao.png);
}
div.sessoes {
width:1000px;
margin: auto;
position: relative;
}
.encomende {
cursor:pointer;
}
div.pecaGas {
width:40px;
background-color: rgb (255,0,0);
z-index:10;
}
div.pecaGas div.gas {
display:block;
position:absolute;
top:0;
right:0;
}
div.peca {
position: relative;
display:block;
width:420px;
top:calc(50% - 270px);
right:0;
background-color:rgb(255,255,255);
border: .5px rgb(255,0,0) solid;
-webkit-border-radius: 20px 0 0 20px;
-moz-border-radius: 20px 0 0 20px;
border-radius: 20px 0 0 20px;
z-index:10;
padding:20px 0 20px 20px;
}
div.peca input, div.peca select {
width: 250px !important;;
border: 1px rgb(255,0,0) solid;
}
div.peca button.fechaPeca {
position:absolute;
top:20px;
right:20px;
background-color:transparent !important;
}
div.peca button.btnPecaGas {
margin:auto !important;
text-align:center !important;
}
div.peca .labelPequeno {
width:120px !important;
}
<div class="peca">
<button class="fechaPeca"><img src="_img/btn-close.png" /></button>
<h1 class="h1Centralizado">Peça suas botijas</h1>
<label for="nomePeca" class="labelPequeno">Nome</label>
<input type="text" name="nomePeca" id="nomePeca" class="typeTextPequeno" placeholder="Nome" required />
<br />
<br />
<label for="enderecoPeca" class="labelPequeno">Endereço</label>
<input type="text" name="enderecoPeca" id="enderecoPeca" class="typeTextPequeno" placeholder="Endereço completo" required />
<br />
<br />
<label for="bairroPeca" class="labelPequeno">Bairro</label>
<select name="bairroPeca" class="typeTextPequeno" required>
<option value="">Selecione o bairro</option>
</select>
<br />
<br />
<label for="telefonePeca" class="labelPequeno">Telefone</label>
<input type="text" name="telefonePeca" id="telefonePeca" class="typeTextPequeno" placeholder="Telefone" />
<br />
<br />
<label for="quantidadePeca" class="labelPequeno">Quantas botijas?</label>
<input type="text" name="quantidadePeca" id="quantidadePeca" class="typeTextPequeno" placeholder="Quantas Botijas" />
<br />
<br />
<button class="btnPecaGas">Peça já o seu</button>
</div>
I wonder where I’m going wrong?
I think this solves: https://answall.com/questions/252417/centralizes%C3%A7%C3%A3o-de-bot%C3%A3o-incorrect/252419#252419
– Sam
you can explain why this failure?
– Carlos Rocha
It can be many factors... depends a lot on the CSS involved in the context... something else, usually a
margin: 0 auto;
works withdisplay: block;
withoutfloat: left;
.– Sam
ah ok, you did not get to see the code of the link I passed no. It was by inference.. But thanks. I will observe! I only passed the link because there might be some CSS conflict that I’m not able to see.
– Carlos Rocha
I saw it once, but now it won’t open.
– Sam
@Carlosrocha how his link didn’t work did a generic response centering the content on a
div
using flex-box.– WMomesso
Here for me gave normal. maybe at the time Voce tried I was still upando
– Carlos Rocha
I added to the question the code I’m using.
– Carlos Rocha
I edited the answer and finally added your code with the adjustments
– WMomesso