0
Watch the image;
I’ve done everything to put this button in the right place that I can’t, it just gets weirdly in the corner of the screen, it’s very strange behavior for the one button.
These were my attempts
.button_struts{
position: relative;
right: -780px;
top: -69px;
}
These CSS settings worked to fix the problem, but it’s not a good practice because it doesn’t get responsive, I put this button on the force, it’s not right;
Could someone give me a suggestion?
This is my HTML;
<div class="modal fade" id="modalAddObservacao" tabindex="-1" role="dialog" data-backdrop="static" aria-labelledby="myModalLabel">
<s:form cssClass="form-horizontal" role="form" id="formObservacao" action="NaoConformidade!addObservacao" method="post">
<s:hidden id="codigoNaoConformidade" name="observacao.id" value="%{observacao.id}" />
<s:hidden name="idRegistroSelecionado" id="idRegistroSelecionado" value=""/>
<div class="modal-dialog" role="document">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" onclick="fecharModalObservacao();" aria-label="Close">
<span aria-hidden="true">×</span>
</button>
<h4 class="modal-title" id="myModalLabel">Observação</h4>
<div class="modal-body">
<input
id="idObservacao"
type="text"
class="form-control"
name="observacao"
value="" />
<div id="msgObservacao" ></div>
</div>
<div class="modal-footer" align="right">
<s:submit onclick="adicionarObservacao(event);" cssClass="btn btn-primary button_struts" key="Salvar"/>
</div>
</div>
</div>
</div>
</s:form>
</div>
Additional information
I tried that way too;
<div class="modal fade" id="modalAddObservacao" tabindex="-1" role="dialog" data-backdrop="static" aria-labelledby="myModalLabel">
<s:form cssClass="form-horizontal" role="form" id="formObservacao" action="NaoConformidade!addObservacao" method="post">
<s:hidden id="codigoNaoConformidade" name="observacao.id" value="%{observacao.id}" />
<s:hidden name="idRegistroSelecionado" id="idRegistroSelecionado" value=""/>
<div class="modal-dialog" role="document">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">×</span>
</button>
<h4 class="modal-title" id="myModalLabel">Observação</h4>
</div>
<div class="modal-body">
<input
id="idObservacao"
type="text"
class="form-control"
name="observacao"
value="" />
<div id="msgObservacao" ></div>
</div>
<div class="modal-footer" align="right">
<s:submit onclick="adicionarObservacao(event);" cssClass="btn btn-primary" key="Salvar"/>
</div>
</div>
</div>
</s:form>
</div>
You want to put in the right corner of the modal footer?
– Sam
Yeah, that’s right! :)
– wladyband
But the modal footer buttons are already on the right by default. No need to change the CSS.
– Sam
He’s not getting right, he’s getting as it is in the picture.
– wladyband
It is getting like in the image because you are applying properties that move the button. This modal is Bootstrap, right? Try without these properties, that is, delete this CSS
.button_struts{
position: relative;
right: -780px;
top: -69px;
}
– Sam
I am hard to explain, the fact that you have not understood is not your fault, the problem is the following, without these CSS settings that I put the screen is as it is in the first image of this post, but if I put these CSS settings will be fixed but it is not a good practice because I put the button in place by force, I need to put the button in place in the correct way.
– wladyband
What version of Bootstrap are you using?
– Sam
Bootstrap v3.3.6
– wladyband