Personalización de CSS para dispositivos móviles

  • Autor Autor eic2010
  • Fecha de inicio Fecha de inicio
E

eic2010

Beta
¡Usuario con pocos negocios! ¡Utiliza siempre saldo de Forobeta!
hola amigos estoy buscando por todos lados y no encuentro la forma de lograr lo siguiente

asi tengo el css en movil

asitengo.webp

asi quisiera hacer el listado

asiquiero.webp

este es mi codigo css

HTML:
* {
  box-sizing: border-box;

}

body {
    font-family: Helvetica;
	background-color: #ffffff; 
    max-width:960px; 
	margin:0px auto 0px auto;
	margin-top:40px;
}
.my-logo,
footer {
  width: 100%;
	max-width:auto;
	position:absolute;
	left:0px;	
  padding-left: 1%;
  margin-bottom: 0px;
  background-color: #000;
  border: 1px solid #000;
}
body > header > h1 > a {
color: #ffffff;
font-weight: 400;
}
article > header {

}
footer {
  margin-top: 4px;
}

a {
  text-decoration: none;
	color:#444444;

}

/* 'Margin: 0 auto' centers block content on the page */
.wrap {
  width: 100%;
  margin: 0 auto;
	
}

.content-area {
  display: inline-block;
	
}

.content-thin {
    width: 70%;
}

.content-full-width {
    width: 100%;
}

.content-area,
.primary-sidebar {
  display: inline-block;
}

.primary-sidebar {
  width: 25%;
  padding: 1%;
  vertical-align: top;
  background-color: #DF0101;
	
	
}

.article-loop {
    width: 31%;
    text-align: left;
    margin: 5px;
	margin-top:20px;
    padding: 10px;
	
	
}


.article-full {
  width: 99%;
  padding: 1%;
	
}

.article-loop,
.article-full {
  display: inline-block;
  vertical-align: top;
  background-color: #fff;
  border-radius: 0px;
  margin-bottom: 10px;
  padding:0px;
	
}

.post-thumb {
    width: 100%;
	height:100%;
    max-height: 320px;
    overflow: hidden;
	
}
.post-thumb img {
	width:100%;
	height:100%;
	
}
.post-categories{
	margin-left:2px;
	margin-bottom:0px;
	margin-top:3px;
	 list-style: none;
 	padding:0;
	
}
.post-categories a{
	color : #80ABC9;
}
h2{
 margin-left:2px;
	margin-bottom:0px;
	margin-top:3px;
	 list-style: none;
 	padding:0px;
	font-size:23px;
	font-family: Helvetica;
	font-weight: 400;	
	
}
span{
 color:#0984DA;
	font-weight:600;
}
 [MENTION=16931]medi[/MENTION]a screen and (max-width: 760px) {
.post-thumb img {
	width:100%;
	height:100%;
	max-height:160px;
}
	
	
	.post-thumb3 img {
	display: inline;
	width:100%;
	height:100%;
	max-width:100%;
		min-height:200px;
	
}
	
	h2{
	font-size:21px;
	font-weight: 450;	
}	
	.article-loop {
    width: 99%;
   min-width: 0;
		margin-left: 0px;
		margin-right: 0px;
		padding-left: 0px;
		padding-right: 0px; 
        margin-top:0px;
       margin-bottom: 0px;
	  padding:10px;
		
  }
}
	article:nth-child(-n+19) {
	width:100%;
}	
article:nth-child(-n+19) a{
	 font-weight: 450;	
	
}
article:nth-child(-n+19) span{
	font-weight: 450;
	  
}
article:nth-child(-n+19) h2{
	font-size:20px;
	  padding:5px;
	padding-top:5px;
	margin-bottom:8px;
	
}
 
hola amigos estoy buscando por todos lados y no encuentro la forma de lograr lo siguiente

asi tengo el css en movil

Ver el archivo adjunto 122157

asi quisiera hacer el listado

Ver el archivo adjunto 122158

este es mi codigo css

HTML:
* {
  box-sizing: border-box;

}

body {
    font-family: Helvetica;
    background-color: #ffffff;
    max-width:960px;
    margin:0px auto 0px auto;
    margin-top:40px;
}
.my-logo,
footer {
  width: 100%;
    max-width:auto;
    position:absolute;
    left:0px;   
  padding-left: 1%;
  margin-bottom: 0px;
  background-color: #000;
  border: 1px solid #000;
}
body > header > h1 > a {
color: #ffffff;
font-weight: 400;
}
article > header {

}
footer {
  margin-top: 4px;
}

a {
  text-decoration: none;
    color:#444444;

}

/* 'Margin: 0 auto' centers block content on the page */
.wrap {
  width: 100%;
  margin: 0 auto;
   
}

.content-area {
  display: inline-block;
   
}

.content-thin {
    width: 70%;
}

.content-full-width {
    width: 100%;
}

.content-area,
.primary-sidebar {
  display: inline-block;
}

.primary-sidebar {
  width: 25%;
  padding: 1%;
  vertical-align: top;
  background-color: #DF0101;
   
   
}

.article-loop {
    width: 31%;
    text-align: left;
    margin: 5px;
    margin-top:20px;
    padding: 10px;
   
   
}


.article-full {
  width: 99%;
  padding: 1%;
   
}

.article-loop,
.article-full {
  display: inline-block;
  vertical-align: top;
  background-color: #fff;
  border-radius: 0px;
  margin-bottom: 10px;
  padding:0px;
   
}

.post-thumb {
    width: 100%;
    height:100%;
    max-height: 320px;
    overflow: hidden;
   
}
.post-thumb img {
    width:100%;
    height:100%;
   
}
.post-categories{
    margin-left:2px;
    margin-bottom:0px;
    margin-top:3px;
     list-style: none;
     padding:0;
   
}
.post-categories a{
    color : #80ABC9;
}
h2{
 margin-left:2px;
    margin-bottom:0px;
    margin-top:3px;
     list-style: none;
     padding:0px;
    font-size:23px;
    font-family: Helvetica;
    font-weight: 400;   
   
}
span{
 color:#0984DA;
    font-weight:600;
}
 [MENTION=16931]medi[/MENTION]a screen and (max-width: 760px) {
.post-thumb img {
    width:100%;
    height:100%;
    max-height:160px;
}
   
   
    .post-thumb3 img {
    display: inline;
    width:100%;
    height:100%;
    max-width:100%;
        min-height:200px;
   
}
   
    h2{
    font-size:21px;
    font-weight: 450;   
}   
    .article-loop {
    width: 99%;
   min-width: 0;
        margin-left: 0px;
        margin-right: 0px;
        padding-left: 0px;
        padding-right: 0px;
        margin-top:0px;
       margin-bottom: 0px;
      padding:10px;
       
  }
}
    article:nth-child(-n+19) {
    width:100%;
}   
article:nth-child(-n+19) a{
     font-weight: 450;   
   
}
article:nth-child(-n+19) span{
    font-weight: 450;
     
}
article:nth-child(-n+19) h2{
    font-size:20px;
      padding:5px;
    padding-top:5px;
    margin-bottom:8px;
   
}
¡Hola eic2010!

Parece que has estado trabajando bastante en tu CSS para dispositivos móviles. Vamos a ver algunas optimizaciones y sugerencias que te podrían ayudar a alcanzar lo que buscas.

1. Uso de max-width y width: En varios elementos, estás usando tanto width como max-width. En dispositivos móviles, generalmente es más útil establecer width: 100% para que los elementos ocupen todo el espacio disponible. Puedes eliminar max-width en ciertos casos o establecerlo donde sea necesario.

2. Media Queries: Veo que ya tienes una media query para pantallas con un ancho máximo de 760px. Asegúrate de que todas las reglas dentro de esta media query afecten realmente a cómo se muestran los componentes en los móviles. Puedes considerar ajustar los estilos adicionales para hacer el diseño más amigable.

3. Flexbox: Si quieres una mejor distribución de los elementos, podrías considerar usar Flexbox. Esto hace que sea más fácil alinear y distribuir espacio entre elementos, especialmente en dispositivos de diferentes tamaños.

Ejemplo:
Insertar CODE, HTML o PHP:
css
   .content-area {
       display: flex;
       flex-direction: column; /* Cambiar a fila para pantallas más grandes */
   }

4. Padding y Margen: En varias clases, como .article-loop, tienes márgenes que puede que no sean necesarios en pantallas pequeñas. Considera ajustar o hacer que el margen y el padding sean más pequeños en dispositivos móviles.

5. Responsive Images: Tus imágenes dentro de post-thumb están bien definidas, pero asegúrate de que también tengan propiedades CSS como object-fit: cover; para mantener la relación de aspecto.

6. Títulos y Textos: Para los h2 y otros textos, como ya lo has hecho, considera ajustar su tamaño de forma más responsiva. Puedes usar unidades de vw (viewport width) para adaptarlos aún mejor a diferentes tamaños de pantalla.

7. Pruebas en Diferentes Dispositivos: Finalmente, asegúrate de probar tu CSS en varios dispositivos y emuladores para ver cómo se adapta. A veces, los problemas aparecen solo en algunos tamaños de pantalla.

Si necesitas ayuda adicional con un elemento específico o quieres ejemplos de código más concretos, no dudes en preguntar. ¡Sigue trabajando en tu proyecto!
 
Atrás
Arriba