I have two div
s here, the section on the left with "Sumar" and "Alumno", and the section on the right with the form.
When there is a validation issue with the form content, messages appear making the right div
resize to fit the content. The left div does not resize to match:
How do I make the left div resize to match the right div at all times?
[Update]
View:
@model Biblioteca.Models.SapDepoViewModel
@{
ViewBag.Title = "SapDepo";
}
<body class="background-greenbkg">
<div class="container bold-titty" id="wite-color">
<div class="col-md-12">
<h2 class="cajita-titulo textofont"><i class="fa fa-bolt" style="color:yellow"></i> Sap | Depósito <i class="fa fa-money" style="color:green"></i> </h2>
</div>
<div class="hidden-xs hidden-sm col-md-1 col-md-push-4 margin-top-bot2 colorcajitaizqsap">
<div class="row height-sidetitle-sap padding-edit">
<i class="fa fa-dollar"></i>
<p id="fontiponki">Sumar</p>
<p id="minifont">Alumno</p>
</div>
</div>
@using (Html.BeginForm("SapDepo", "Alumnos", FormMethod.Post))
{
@Html.AntiForgeryToken()
@Html.ValidationSummary(true, "", new {@class = "text-danger"})
@Html.HiddenFor(x => x.AlumnosId)
<div class=" hidden-xs hidden-sm col-md-push-4 col-md-4 cajita">
<section id="SapDepoAlumnos" >
<div class="form-group">
<div class="row">
<div class= "col-md-push-1 col-md-5">
@Html.LabelFor(x => x.Sap, htmlAttributes: new {@class = "control-label col-md-2"})
</div>
<div class="col-md-6">
@Html.EditorFor(x => x.Sap, new {htmlAttributes = new {@class = "form-control"}})
@Html.ValidationMessageFor(x => x.Sap, "", new {@class = "text-danger"})
</div>
</div>
</div>
<div class="form-group">
<div class="row">
<div class="col-md-push-1 col-md-5">
@Html.LabelFor(x => x.Deposito,"Depósito", htmlAttributes: new {@class = "control-label col-md-2"})
</div>
<div class="col-md-6">
@Html.EditorFor(x => x.Deposito, new {htmlAttributes = new {@class = "form-control"}})
@Html.ValidationMessageFor(x => x.Deposito, "", new {@class = "text-danger"})
</div>
</div>
</div>
</section>
<div class="form-group">
<div class="row">
<div class="col-md-offset-2 col-md-8">
<input type="submit" value="Agregar" class="btn btn-success" style="border-radius: 4px; width: 100%" />
</div>
</div>
</div>
<div class="form-group">
<div class="row">
<div class="col-md-offset-2 col-md-8">
<a href="/Alumnos/Index"> <input type="submit" value="Cancelar transacción" class="btn btn-danger" style="border-radius: 4px; width: 100%" /></a>
</div>
</div>
</div>
</div>
}
</div>
CSS of divs:
//Right side
.margin-top-bot2 {
margin-top: 61px;
margin-bottom: 10px;
}
.colorcajitaizqsap {
/*background-color: rgba(250, 255, 0,0.2);*/
background: repeating-linear-gradient(
45deg,
rgba(107, 153, 85, 0.65),
rgba(107, 153, 85, 0.65) 10px,
rgba(0, 54, 41, 0.65) 10px,
rgba(0, 54, 41, 0.65) 20px
);
border-radius: 10px 0 0 10px;
}
.height-sidetitle-sap {
height: 225px;
}
.padding-edit {
padding-left: 20px;
font-size: 60px;
}
//Left side
.cajita {
padding-top: 30px;
color: #ffffff;
text-align: center;
background-color: rgba(0, 0, 0,0.3);
box-shadow: 0 3px 10px 0 rgba(0,0,0,0.1);
-webkit-border-radius: 3px;
-moz-border-radius: 3px;
border-radius: 0 10px 10px 0;
margin-top: 60px;
}