Una solución más adecuado sería usar sticky
en vez de fixed
. La posición sticky
actúa relativamente con el scroll, y queda fijo en su contenedor padre cuando se hace scroll.
Como no mostraste completo tu código y no se la estructura completa, dedusco que row
quieres que se quede fijo.
Bien, usando sticky
resolvería esto. Queda fijo, pero solamente cuando se hace scroll. Es un buen diseño en CSS.
Para usar sticky
, su contenedor padre deve ser position: relative
, y por lo menos el doble de su altura en height
(no importa si su contenedor padre cresca, o tenga muchos contenidos). No importa donde este ubicado row
, siempre cuando row
llega arriba de la pantalla, se queda alli visible.
Para que éste row
con posición sticky
quede pegado arriba, debe tener top: 0
. El resto es adaptar a tu estilo propio.
Yo opte por darle al mismo row
la posición sticky
.
También agregué colores para diferenciar y una altura extra para visualizar.
Ya tu puedes adaptar y tener la idea a tu estilo.
Esto funciona solamente en un teléfono móvil
@media only screen and (max-width: 500px) {
.container-fluid {
position: relative;
height: 1000px;
background: red
}
.row2{
z-index:50;
position: sticky;
top: 0;
width: 100%;
font-size: 20px;
background-color: violet
}
}
<section class="content-header" >
<div class="content">
<div class="container-fluid">
<div class="row row2 justify-content-around">
<div class="col-sm-4" id="aprobado">
<button type="button" id="btnconfir" class="btnapro btn btn-block btn-success btn-lg" onclick="Aceptar_Venta()">Aprobado</buttton>
</div>
<div class="col-sm-4" id="rechazado">
<button type="button" id="btnrech" class="btrecha btn btn-block btn-danger btn-lg" onclick="Rechazar_Venta()">Rechazado</button>
</div>
</div>
<h1>Siguiente contenido del container </h1>
<p>Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum.</p>
<p>Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum.</p>
</div>
<h1>section</h1>
<p>Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum.</p>
<p>Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum.</p>
</section>