CSS - DIV CONTENIDOS DENTRO DE OTRO NO SE CENTRAN

 
Vista:
sin imagen de perfil

DIV CONTENIDOS DENTRO DE OTRO NO SE CENTRAN

Publicado por Miguel (1 intervención) el 17/01/2017 18:47:17
Hola, buen día he querido centrar los 3 div dentro de mi div contenedor pero no he tenido éxito, les agradecería me apoyaran.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
Reem<!DOCTYPE html>
<html>
<meta charset="utf-8">
    <head>
    <title>categorias contecon</title>
    <meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
        <style>
            .general{
                width:25%;
                height:30%;
                display:inline-block;
                padding:5px;
                margin:10px;
                border-style: solid;
                border-width: 2px;
                border-color:orange;
                margin:auto;
            }
 
 
            .main-container{
                width:80%;
                margin:auto;
                background-color:black;
 
            }
            .general img{
                width:100%;
                height:50%;
 
            }
 
 
            @media screen and (min-width:250px){
               .general{
                   width:100%;
 
                }
            }
 
            @media screen and (max-width:250px){
               .general{
                   width:100%;
 
                }
            }
 
            @media screen and (min-width:800px){
               .general{
                   width:25%;
                }
 
            }
 
          .namec{
          font-family:"arial";
          margin:5px auto;
          text-align:center;
          font-style:strong;
          font-weight: bold;
 
}
         .encabezado{
         background-color:orange;
         margin:0 auto;
        }
        .enca-text{
          font-family:"arial";
          margin:5px auto;
          text-align:center;
          font-style:strong;
          font-weight: bold;
        }
 
        </style>
    </head>
 
    <div class="main-container">
        <div class="encabezado"><div class="enca-text">CATEGORIAS</div></div>
 
        <div class="general">
        <a href="http://www.conteconacademy.com/course/index.php?categoryid=5"><img src="1.png"></a>
        <div class="namec">INDUCCI&Oacute;N</div>
    </div>
    <div class="general">
        <a href="http://www.conteconacademy.com/course/index.php?categoryid=4"><img src="2.png"></a>
       <div class="namec">SEGURIDAD</div>
    </div>
    <div class="general">
        <a href="http://www.conteconacademy.com/course/index.php?categoryid=6"><img src="3.jpg"></a>
       <div class="namec">EQUIPOS PORTUARIOS</div>
    </div>
    <div class="general">
        <a href="http://www.conteconacademy.com/course/index.php?categoryid=6"><img src="4.png"></a>
        <div class="namec">DIFUSI&Oacute;N</div>
    </div>
     <div class="general">
        <a href="http://www.conteconacademy.com/course/index.php?categoryid=8"><img src="5.png"></a>
        <div class="namec">TRAINEES</div>
    </div>
    <div class="general">
        <a href="http://www.conteconacademy.com/course/index.php?categoryid=9"><img src="6.png"></a>
        <div class="namec">INGL&Eacute;S</div>
    </div>
 
</div>
</html>place este texto
Valora esta pregunta
Me gusta: Está pregunta es útil y esta claraNo me gusta: Está pregunta no esta clara o no es útil
0
Responder
sin imagen de perfil
Val: 45
Ha mantenido su posición en CSS (en relación al último mes)
Gráfica de CSS

DIV CONTENIDOS DENTRO DE OTRO NO SE CENTRAN

Publicado por Brayan (16 intervenciones) el 24/01/2017 19:55:22
Si lo que deseas es que el .main-container en su interior mantenga todo centrado prueba esto:

1
2
3
4
5
6
7
.main-container{
    width:80%;
    display:flex;
    flex-direction:row; //Esto si lo quieres horizontal, si los quieres vertical usa column en vez de row
    justify-content: space-between; // esto hara que tu contenido tenga el mismo espaciado uno con el otro intenta eliminar paddin y margin de los demas selectores
 
}
Valora esta respuesta
Me gusta: Está respuesta es útil y esta claraNo me gusta: Está respuesta no esta clara o no es útil
0
Comentar