How to manipulate objects inside a div?

-4

I'm a beginner in web programming and I've done everything I knew. Can anyone help me to center these items side by side preferably with smaller spacing ???

NOTE: I have been able to space too much or not to space as you can see in the images. My goal was to keep one side by side.

Codesnippet:

    
asked by anonymous 13.08.2018 / 17:05

2 answers

0

Hello @ Jeferson-Heavy, let's see if we can clear this idea ... so you need 3 columns with an image and title inside each. I'll see if I can give you the best solution within your architecture. I am going to put here the section that you should correct in your code, I already use it and leave the example for you to see the ideal format to post the code here in the posts:

<style>
.box_wrapp{
    display:inline-block;
    width:100%;
    text-align:center;
}
.box{
    display:inline-block;
    width:150px;
    max-width:90%;
    margin:0 10px 10px 0;
}
.box .b_header{
    display:inline-block;
    width:100%;
    text-align:center;
    padding:10px 0 10px 0;
    font-size:12px;
}
.box .b_body{
    display:inline-block;
    width:100%;
    height:100px;
    border-radius:50%;
    overflow:hidden;    
    font-size:12px;
}
#box1 .b_body{
    background:url(pasta/img1.png)no-repeat center;
    background-size:cover;
    background-color:#e8e8e8; 
}
#box2 .b_body{
    background:url(pasta/img2.png)no-repeat center;
    background-size:cover;
    background-color:#e8e8e8;
}
#box3 .b_body{
    background:url(pasta/img3.png)no-repeat center;
    background-size:cover;
    background-color:#e8e8e8;
}
</style>

<div class="box_wrapp">

    <div class="box" id="box1">

        <div class="b_header">
        Título
        </div><!-- /b_header-->

        <div class="b_body"></div><!-- /b_body-->       

    </div><!-- /box1-->

    <!-- ... -->    

    <div class="box" id="box2">

        <div class="b_header">
        Título
        </div><!-- /b_header-->

        <div class="b_body"></div><!-- /b_body-->       

    </div><!-- /box2-->

    <!-- ... -->

    <div class="box" id="box3">

        <div class="b_header">
        Título
        </div><!-- /b_header-->

        <div class="b_body"></div><!-- /b_body-->

    </div><!-- /box3-->

</div><!-- /box_wrapp-->

link

    
14.08.2018 / 18:33
0

Friend, it would be nice to create 3 divs and leave them that way in CSS:

div#cidade1 {
  min-width: 33%;
  max-width: 100%;
  position: relative;
}

Apply this in the 3 divs. Hope this helps :) In this way, it already adapts to smartphones.

    
14.08.2018 / 22:47