Ver Mensaje Individual
  #3 (permalink)  
Antiguo 15/10/2015, 03:31
Jhon Silver
 
Fecha de Ingreso: marzo-2004
Ubicación: Madrid (España)
Mensajes: 837
Antigüedad: 20 años, 1 mes
Puntos: 9
Respuesta: Código para móviles

En el archivo raiz style.css incluyo este código sin la etiqueta <style>:
Código CSS:
Ver original
  1. .container {
  2.         width:996px;
  3.         margin:0px auto;
  4.         font-size:1em;
  5.     }
  6.     section,aside {
  7.         padding: 10px;
  8.         background:#F5F5F5;
  9.         -moz-border-radius:5px;-webkit-border-radius:5px;-o-border-radius:5px;border-radius:5px;
  10.     }
  11.     section {
  12.         float: left;
  13.         width: 70%;
  14.     }
  15.     aside {
  16.         float: right;
  17.         width: 25%;
  18.     }
  19.     nav {
  20.         overflow: hidden;
  21.     }
  22.     nav ul {
  23.         list-style-type:none;
  24.         float:left;
  25.         padding:0px;
  26.     }
  27.     nav ul li {
  28.         float:left;
  29.         padding:3px 10px;
  30.         margin:2px;
  31.         background:#0099CC;
  32.         -moz-border-radius:5px;-webkit-border-radius:5px;-o-border-radius:5px;border-radius:5px;
  33.         font-family: Verdana, Arial, Helvetica, sans-serif;
  34.         font-size: 80%;
  35.         font-color: #ffffff;
  36.     }
  37.     footer {
  38.         margin:10px;
  39.         text-align:center;
  40.         clear:both;
  41.     }
  42.  
  43.     /* para 980px o menos */
  44.     @media screen and (max-width:980px) {
  45.         .container {
  46.             width:98%;
  47.         }
  48.         section {
  49.             width:68%;
  50.         }
  51.     }
  52.  
  53.     /* para 700px o menos */
  54.     @media screen and (max-width:700px) {
  55.         aside,section {
  56.             float:none;
  57.             width:96%;
  58.         }
  59.         nav, section {
  60.             font-size:1.2em;
  61.         }
  62.         aside {
  63.             margin-top:5px;
  64.         }
  65.         nav ul {
  66.             float:none;
  67.             clear:both;
  68.         }
  69.     }
  70.  
  71.     /* para 480px o menos */
  72.     @media screen and (max-width:480px) {
  73.         aside {
  74.             display:none;
  75.         }
  76.         nav, section {
  77.             font-size:1.5em;
  78.         }
  79.         section {
  80.             width:94%;
  81.         }
  82.         nav ul {
  83.             float:left;
  84.             clear:none;
  85.             width:50%;
  86.         }
  87.         nav ul li {
  88.             float:none;
  89.         }
  90.     }
  91.    
  92.     @media only screen and (min-width: 500px) {
  93.     div.banner_mobile {
  94.         display: none;
  95.     }
  96.    
  97.     div.banner_pc {
  98.         display: block;
  99.     }
  100. }
  101.  
  102. @media only screen and (max-width: 499px) {
  103.     div.banner_pc {
  104.         display: none;
  105.     }
  106.    
  107.     div.banner_mobile {
  108.         display: block;
  109.     }
  110. }
  111.  
  112. @media only screen and (max-width: 470px) {
  113.     img.alignright {
  114.         float: none;
  115.         margin: auto;
  116.         display: block;
  117.         margin-bottom: 10px;
  118.     }
  119. }

Entre las líneas 112 y 119 esta el codigo al que hago referencia

Hago la llamada a través de la línea de código
Código CSS:
Ver original
  1. <link rel="stylesheet" type="text/css" media="all" href="style.css">
En la etiqueta img <img src="imagen/buscar-vivienda.jpg" class="center">

Hay algo que no esta bien porque la última parte del código no actua, pero no se que es.