Problems with ASP MVC5 Responsive HTML

Asked

Viewed 41 times

1

I’m having trouble letting my page responsive, for desktop is getting correct, as shown in the image:

inserir a descrição da imagem aqui

However, when testing for mobile, it is as follows (using the tool in google Chrome to emulate the screen of a mobile phone):

inserir a descrição da imagem aqui

My HTML is:

@using (Html.BeginForm(FormMethod.Post))
{
    <section id="team" class="pb-5">
        <div class="container-fluid">
            <div class="row">
                <div class="col-sm-4 col-sm-4 col-sm-2">
                    <div class="frontside">
                        <div class="card" style="width: 100%;">
                            <br>
                            <div class="card-body text-center">
                                <p><img class="img-fluid" src="~/Imagens/Menu/autorizados.jfif" alt="card image"></p>
                                <h2 class="card-title">Autorizados</h2>
                                <h5 class="card-text">Consultar o status dos autorizados cadastrados.</h5>
                                <br>
                                @if (Model.permissaoUsuario.Equals("A"))
                                {
                                <a href="~/Autorizados/Exibe" class="btn btn-primary btn-lg "><i class="fa fa-plus"></i></a>                                
                                }
                                else
                                {
                                <a href="#" class="btn btn-primary btn-lg" disabled><i class="fa fa-plus"></i></a>                               
                                }
                            </div>
                        </div>
                    </div>
                </div>

                <div class="col-sm-4 col-sm-4 col-sm-2">
                    <div class="frontside">
                        <div class="card" style="width: 100%;">
                            <br>
                            <div class="card-body text-center">
                                <p>
                                    <img class="img-thumbnail" src="~/Imagens/Menu/frota2.png" alt="card image">
                                </p>
                                <h2 class="card-title">Frota</h2>
                                <h5 class="card-text">Consultar os veículos cadastrados.</h5>
                            </div>
                            <br>
                            @if (Model.permissaoUsuario.Equals("A"))
                            {
                            <center><a href="~/Frota/Exibe" class="btn btn-primary btn-lg"><i class="fa fa-plus"></i></a></center>
                            }
                            else
                            {
                            <center><a href="#" class="btn btn-primary btn-lg" disabled><i class="fa fa-plus"></i></a></center>
                            }
                        </div>
                    </div>
                </div>
                <div class="col-sm-4 col-sm-4 col-sm-2">
                    <div class="frontside">
                        <div class="card" style="width: 100%;">
                            <br>
                            <div class="card-body text-center">
                                <p><img class=" img-fluid" src="~/Imagens/Menu/nfe.png" alt="card image"></p>
                                <h2 class="card-title">Notas Fiscais</h2>
                                <h5 class="card-text">Consultar as notas fiscais emitidas e pendentes.</h5>
                                <br>
                                <a href="~/NotasFiscais/Exibe" class="btn btn-primary btn-lg"><i class="fa fa-plus"></i></a>
                            </div>
                        </div>
                    </div>
                </div>
                <div class="col-sm-4 col-sm-4 col-sm-2">
                    <div class="frontside">
                        <div class="card" style="width: 100%;">
                            <br>
                            <div class="card-body text-center">
                                <p><img class="img-thumbnail" src="~/Imagens/Menu/fatura.png" alt="card image"></p>
                                <h2 class="card-title">Faturas</h2>
                                <h5 class="card-text">Consultar todas as faturas em aberto.</h5>
                            </div>
                            <br />
                            @if (Model.permissaoUsuario.Equals("A"))
                            {
                            <center><a href="~/Faturas/Exibe" class="btn btn-primary btn-lg"><i class="fa fa-plus"></i></a></center>
                            }
                            else
                            {
                            <center><a href="#" class="btn btn-primary btn-lg" disabled><i class="fa fa-plus"></i></a></center>
                            }
                        </div>
                    </div>
                </div>
                <div class="col-sm-4 col-sm-4 col-sm-2">
                    <div class="frontside">
                        <div class="card" style="width: 100%;">
                            <br>
                            <div class="card-body text-center">
                                <p><img class=" img-fluid" src="~/Imagens/Menu/dashboard.png" alt="card image"></p>
                                <h2 class="card-title">Dashboards</h2>
                                <h5 class="card-text">Consultar gráficos de consumo e médias.</h5>
                                <br>
                                @if (Model.permissaoUsuario.Equals("A"))
                                {
                                <a href="~/Grafico/Exibe" class="btn btn-primary btn-lg"><i class="fa fa-plus"></i></a>
                                }
                                else
                                {
                                <a href="#" class="btn btn-primary btn-lg" disabled><i class="fa fa-plus"></i></a>
                                }
                            </div>
                        </div>
                    </div>
                </div>
                <div class="col-sm-4 col-sm-4 col-sm-2">
                    <div class="frontside">
                        <div class="card" style="width: 100%;">
                            <br>
                            <div class="card-body text-center">
                                <p><img class="img-thumbnail" src="~/Imagens/Menu/bonus.png" alt="card image"></p>
                                <h2 class="card-title">Bônus</h2>
                                <h5 class="card-text">Consultar saldo e extrato da pontuação bônus.</h5>
                            </div>
                            <br>
                            <center><a href="~/PontuacaoBonus/Exibe" class="btn btn-primary btn-lg"><i class="fa fa-plus"></i></a></center>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </section>
}

I am in the div with class="card" putting the width= 100%, I read about that to leave responsive you can use REM or EM, but I did not get positive results (it may be that I used in the wrong way). There’d be some way to fix it?

  • You want every box to have the same size regardless of content size is this?

No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.