How to leave DIV "Responsive"?

Asked

Viewed 2,925 times

1

I know almost nothing of the, diagmos, "Advanced" of the CSS!

So I wanted to know how to leave one div well Responsive for users MOBILE. So here’s the deal:

I’ve got divs with some footage, and some radios, for choice of details etc! These divs are of only one size, which is well adjusted to the screen of my notebook! But I want to make these divs are well adjusted with the panel page on all devices!

My code is like this:

.selecao-bordas {

left: 300px; 
top: 150px; 
width: 715px; 
height: 100px;
overflow: auto;

}

.selecao-details {

left: 300px; 
top: 150px; 
width: 715px; 
height: 200px;
overflow: auto;

}
<form>
    <br>
    Bordas
    <div class="selecao-bordas">
        <?php include("bordas.php"); ?>
    </div>
						
    <br>
    Detalhes
				
    <div class="selecao-details">
        <?php include("detalhes.php"); ?>
    </div>
								
    <br>
    Nível do Clã
				
    <?php include("clanlevel.php"); ?>
				
</form>

A print of how it looks on the page:

http://image.prntscr.com/image/74d4235e915a43e3af1a987e70da9e62.png

So it stays when the screen decreases:

http://image.prntscr.com/image/92a0c3d6dedd4b928f3c5011b938722f.png

  • 1

    Have you thought about using bootstrap and his grid system?

  • I use Bootstrap, it didn’t even cross my mind!

  • How can I test a site in various sizes?

  • But like, how am I gonna get the columns to scroll? Always adjusting?

  • 2

    In Chrome, in the developer console (right-click, inspect element), there will be two icons in the top left-hand tab. The first is an arrow in a square the other is the image of a mobile phone and a tablet. Click on the image of the mobile phone and tablet. Ai you are already in the responsive mode of Chrome, you will see that you can increase and decrease the screen size without changing the size of the entire browser. In addition to selecting a specific screen size such as an iphone 6, please check this link https://developers.google.com/web/tools/chrome-devtools/device-mode/emulate-mobile-viewports

  • ah vlw I’ll try

Show 1 more comment

1 answer

1


I guess that settles it.

.selecao-bordas, .selecao-details {
    overflow: auto;
}
.content {
    display: inline-block;
}


<div class="container">
    <form>
        <br>
        Bordas
        <div class="selecao-bordas col-lg-12 col-md-12 col-sm-12 col-xs-12">
            <div class="content">
                <?php include("bordas.php"); ?>
            </div>
        </div>

        <br>
        Detalhes

        <div class="selecao-details col-lg-12 col-md-12 col-sm-12 col-xs-12">
            <div class="content">
                <?php include("detalhes.php"); ?>
            </div>
        </div>

        <br>
        Nível do Clã

        <?php include("clanlevel.php"); ?>

    </form>
</div>
  • Dude, it hasn’t changed at all, the selection is perfect, but I want to make it smaller, to make it look like in print, the scroll bar and the selection edges is exceeding the panel

  • Try to put position: relative in both selections and content. Helping without seeing is still difficult for me haha

  • http://prntscr.com/d0914f

  • On mobile it looks like this: http://prntscr.com/d0927l

  • 1

    I’ll see you in a few hours. I’m getting off the job

  • ppo guy is trying everything, and nothing works, the way I got it was perfect, but only on my screen

  • You can place the html generated from the contents of the div that is overflowing the container. play it here https://codeshare.io/6Iiml in 10m I’ll come back and help you.

  • Dude, to facilitate business, I added a well to know what’s going on and tals, then I realized the only problem and the table of images that goes beyond the container and the panel

  • Ready, I’ve laid the basics

Show 5 more comments

Browser other questions tagged

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