Foros del Web » Creando para Internet » CSS »

CSS para adaptar web

Estas en el tema de CSS para adaptar web en el foro de CSS en Foros del Web. Hola, tengo una web antigua hecha con dreamweaver, quiero mantenerla así pero adaptarla a dispositivos móviles. Me dijeron que utilizando otro archivo css con los ...
  #1 (permalink)  
Antiguo 20/04/2015, 16:28
 
Fecha de Ingreso: febrero-2010
Mensajes: 227
Antigüedad: 14 años, 2 meses
Puntos: 4
CSS para adaptar web

Hola,
tengo una web antigua hecha con dreamweaver, quiero mantenerla así pero adaptarla a dispositivos móviles. Me dijeron que utilizando otro archivo css con los comandos adecuados para que cargue ese archivo cuando se ve la web desde un móvil podría valerme.

¿alguien podría facilitarme algún archivo css ya adaptado a móvil y que se cargue cuando entras desde el móvil para poder utilizarlos en mi web y ya cambiaré yo después colores, tamaños de letras y estilos?

Gracias
__________________
Devivencias | psicologia online
  #2 (permalink)  
Antiguo 20/04/2015, 20:37
Avatar de AngelKrak  
Fecha de Ingreso: noviembre-2014
Mensajes: 917
Antigüedad: 9 años, 5 meses
Puntos: 91
Respuesta: CSS para adaptar web

se llaman Media Querys amigo, esas te hacen el diseño responsive de tu pagina para adaptarlo a moviles >_<

ahi te dejo los codigos de las Medias querys si no sabes como se usan te recomiendo que busques informacion sobre las Media Querys ;)

Código CSS:
Ver original
  1. @Media All and (min-width:200px) and (max-width:800px) {Aqui va tu codigo}
  2.  
  3. @media (max-width: 750px) {Aqui va tu codigo}
  4.  
  5. @media screen and (min-width: 300px){Aqui va tu codigo}
  #3 (permalink)  
Antiguo 21/04/2015, 01:50
 
Fecha de Ingreso: febrero-2010
Mensajes: 227
Antigüedad: 14 años, 2 meses
Puntos: 4
Respuesta: CSS para adaptar web

Hola,
Muchas gracias por esas líneas. A lo que yo me refería era si alguien me podía pasar un archivo CSS completo pensado solo para activarse cuando se consulte la web desde un móvil
Gracias
__________________
Devivencias | psicologia online
  #4 (permalink)  
Antiguo 21/04/2015, 03:51
 
Fecha de Ingreso: agosto-2013
Ubicación: A Coruña
Mensajes: 54
Antigüedad: 10 años, 8 meses
Puntos: 14
Respuesta: CSS para adaptar web

Cita:
Iniciado por skat Ver Mensaje
Hola,
Muchas gracias por esas líneas. A lo que yo me refería era si alguien me podía pasar un archivo CSS completo pensado solo para activarse cuando se consulte la web desde un móvil
Gracias
Hola. Cada página web es un mundo y como tal hay que tratarlas. Para hacer que una web sea responsiva tienes que hacer como el compañero ha clarificado arriba, con media queries.
También tienes la opción de plugins como Bootstrap o foundation.
Un saludo
  #5 (permalink)  
Antiguo 21/04/2015, 04:51
Avatar de lauser
Moderator Unix/Linux
 
Fecha de Ingreso: julio-2013
Ubicación: Odessa (Ukrania)
Mensajes: 3.278
Antigüedad: 10 años, 9 meses
Puntos: 401
Respuesta: CSS para adaptar web

Cita:
Iniciado por skat Ver Mensaje
Hola,
Muchas gracias por esas líneas. A lo que yo me refería era si alguien me podía pasar un archivo CSS completo pensado solo para activarse cuando se consulte la web desde un móvil
Gracias
No es muy recomendable... pero si no tienes conocimientos y no puedes contratar a un profesional. Siempre puedes recurrir a: sitio1 o sitio2.
__________________
Los usuarios que te responden, lo hacen altruistamente y sin ánimo de lucro con el único fin de ayudarte. Se paciente y agradecido.
-SOLOLINUX-
  #6 (permalink)  
Antiguo 21/04/2015, 15:30
 
Fecha de Ingreso: abril-2007
Ubicación: Merlo
Mensajes: 314
Antigüedad: 17 años
Puntos: 3
Respuesta: CSS para adaptar web

Tengo un problema similar, pero con chrome.
Con firefox (al menos el emulador) funciona con el emulador de Chrome no!!!
Codigo del css
Código CSS:
Ver original
  1. @font-face {
  2.   font-family: "FreesiaUPC";
  3.   src: url("../css/upcfl.eot");
  4. }
  5. @font-face {
  6.   font-family: "FreesiaUPC";
  7.   src: url("../css/upcfl.ttf");
  8. }
  9.  
  10. @media screen and (max-width : 420px)
  11. {  
  12.  
  13.     body{
  14.         background-color:#eeeeee;
  15.         font-family: Arial;
  16.         margin:0;
  17.         width:360px;
  18.     }
  19.     header
  20.     {
  21.         background-color:#ffffff;
  22.         width:360px;
  23.         margin:0;
  24.  
  25.     }
  26.     header .iso9001
  27.     {
  28.         display: none;
  29.     }
  30.     header .contlayus
  31.     {
  32.         width:360px;
  33.         height:280px;
  34.         overflow:visible;
  35.     }
  36.     header .ofertas
  37.     {
  38.         width:360px;
  39.     }
  40.     header .ofertas div
  41.     {
  42.         float:left;
  43.     }
  44.     header .ofertas img
  45.     {
  46.         width:120px;
  47.     }
  48.     header .solapas
  49.     {
  50.         float:none;
  51.         border:1px dotted #ffffff;
  52.     }
  53.     header .solapas table
  54.     {
  55.         width:360px;
  56.         /*margin:25px 0;*/
  57.        
  58.     }
  59.     header .iconos img
  60.     {
  61.         width:90px;
  62.         height:58px;
  63.     }
  64.     header .iconos table
  65.     {
  66.         width:360px;
  67.     }
  68.     header #menu ul{
  69.         list-style: none;
  70.         font-size: 14px;
  71.         margin:0;
  72.         padding:0;
  73.     }
  74.  
  75.     header #menu li{
  76.         display: block;
  77.         text-transform: uppercase;
  78.         text-align: left;
  79.     }
  80.     header #nav-mobile{
  81.         display: none;
  82.         background: url("../imagenes/nav.png") no-repeat left center;
  83.         width: 360px;
  84.         height: 50px;
  85.         /*position: relative;
  86.         top:0;*/
  87.  
  88.     }  
  89.  
  90.     header #nav-mobile{ display: block; }
  91.     header #menu{
  92.         width: 100%;
  93.         float: none;
  94.         margin:0 0 5px 0;
  95.         padding:0;
  96.     }
  97.     header #menu ul{
  98.  
  99.         max-height: 0;
  100.         overflow: hidden;
  101.         margin:0;
  102.     }
  103.     header #menu li{
  104.         background: #20337f;
  105.         height: 20px;
  106.         float: none;   
  107.         margin:0;
  108.         padding: 5px 10px;
  109.         text-align:center;
  110.         font-size:18px;
  111.         border-bottom:1px solid #ffffff;
  112.  
  113.     }
  114.  
  115.     header #menu li:last-child{ border-bottom: 1;}
  116.     header #menu li a{
  117.        
  118.         line-height: normal;
  119.         color:#ffffff;
  120.         font-weight: bold;
  121.         text-transform:uppercase;
  122.         text-decoration:none;
  123.  
  124.     }
  125.     header #menu ul.open-menu{
  126.         max-height: 420px;
  127.         -webkit-transition: max-height .4s;
  128.         -moz-transition: max-height .4s;
  129.         -ms-transition: max-height .4s;
  130.         -o-transition: max-height .4s;
  131.         transition: max-height .4s;
  132.     }
  133.     /********** agenda ********************/
  134.     header #agenda ul{
  135.         list-style: none;
  136.         font-size: 14px;
  137.         margin:0;
  138.         padding:0;
  139.     }
  140.  
  141.     header #agenda li{
  142.         display: block;
  143.         text-transform: uppercase;
  144.         text-align: left;
  145.     }
  146.     header #tit-mobile{
  147.         display: none;
  148.         background: url("../imagenes/nav-agenda.png") no-repeat left center;
  149.         width: 360px;
  150.         height: 30px;
  151.         /*position: relative;
  152.         top:0;*/
  153.     }  
  154.     header #agenda .tit-mobile
  155.         {
  156.             font-family: "FreesiaUPC", "Arial";
  157.             font-size:0px;
  158.             color:#ffffff;
  159.             height:60px;
  160.             padding:0 5px;
  161.         }
  162.     header #tit-mobile{ display: block; }
  163.     header #agenda{
  164.         width: 360px;
  165.         float: none;
  166.         margin:0 0 5px 0;
  167.         padding:0;
  168.     }
  169.     header #agenda ul{
  170.  
  171.         max-height: 0;
  172.         overflow: hidden;
  173.         margin:0;
  174.     }
  175.     header #agenda li{
  176.         background: #20337f;
  177.         height: 20px;
  178.         float: none;   
  179.         margin:0;
  180.         padding: 5px 10px;
  181.         text-align:center;
  182.         font-size:18px;
  183.         border-bottom:1px solid #ffffff;
  184.  
  185.     }
  186.  
  187.     header #agenda li:last-child{ border-bottom: 1;}
  188.     header #agenda li a{
  189.        
  190.         line-height: normal;
  191.         color:#ffffff;
  192.         font-weight: bold;
  193.         text-transform:uppercase;
  194.         text-decoration:none;
  195.  
  196.     }
  197.     header #agenda ul.open-menu{
  198.         max-height: 420px;
  199.         -webkit-transition: max-height .4s;
  200.         -moz-transition: max-height .4s;
  201.         -ms-transition: max-height .4s;
  202.         -o-transition: max-height .4s;
  203.         transition: max-height .4s;
  204.         background: url("../imagenes/nav2.png") no-repeat left center;
  205.     }
  206. }
  207. @media screen and (min-width: 421px)
  208. {
  209.     body{
  210.     background-color:#eeeeee;
  211.     font-family: Arial;
  212.     margin:0;
  213.     width:100%;
  214. }
  215. header
  216. {
  217.     background-color:#ffffff;
  218.     width:100%;
  219.     min-height:575px;
  220.     margin:0;
  221. }
  222.         header .navigation-toggle
  223.         {
  224.            
  225.         }
  226.         header #menu
  227.         {
  228.             width:950px;
  229.             text-align:right;
  230.             float:right;
  231.             height:0;
  232.             position:relative;
  233.             z-index:1;
  234.             top:-70px;
  235.             left:130px;
  236.             padding:0 0px 0 0;
  237.         }
  238.         header #menu ul
  239.         {
  240.             overflow:hidden;
  241.             list-style:none;
  242.             margin-top:20px;
  243.         }
  244.         header #menu ul li {
  245.             float:left;
  246.         }
  247.         header #menu ul li a
  248.         {
  249.             padding: 0 2px;
  250.             color:#000000;
  251.             text-decoration:none;
  252.             font-family: "FreesiaUPC", "Arial";
  253.             font-size:21px;
  254.             text-transform:uppercase;
  255.         }
  256.         header #menu ul li a:hover
  257.         {
  258.             background-color:#DEE1E6;
  259.         }
  260.         header .logo
  261.         {
  262.             text-align:left;
  263.             overflow:visible;
  264.             width:1010px;
  265.             height:100px;  
  266.             margin:0;
  267.             padding:0;
  268.  
  269.         }
  270.         header .logo2
  271.         {
  272.             width:640px;
  273.             float:left;
  274.             padding: 0 0 0 0px;
  275.             overflow:hidden;
  276.         }
  277.         header .telefono
  278.         {
  279.             float:right;
  280.         }
  281.         header .contlayus
  282.         {
  283.             width:1010px;
  284.             height:250px;
  285.             overflow:hidden;
  286.             position:relative;
  287.             top:-15px;
  288.            
  289.         }
  290.         header .ofertas
  291.         {
  292.             width:200px;
  293.             padding:20px 0 0 20px;
  294.             float:left;
  295.             overflow:auto;
  296.             margin:0;  
  297.  
  298.         }
  299.         header .ofertas td
  300.         {
  301.             vertical-align:top;
  302.             height:70px;
  303.             margin:0;
  304.             padding:0;
  305.         }
  306.         header .loopedSlider
  307.         {
  308.             float:right;
  309.             padding:0 20px 0 0;
  310.             position:relative;
  311.             top:-15px;
  312.             height:165;
  313.            
  314.         }
  315.         header .solapas
  316.         {
  317.            
  318.             width:280px;
  319.             height:0px;
  320.             text-align:right;
  321.             position:absolute;
  322.             z-index:10;
  323.             top:0px;
  324.             margin:0px;
  325.             padding:0 0 0 710px;
  326.         }
  327.  
  328.         header .iso9001
  329.         {
  330.             width:280px;
  331.             height:0;
  332.             text-align:right;
  333.             position:relative;
  334.             z-index:15;
  335.             top:-130px;
  336.             margin:0px;
  337.             left:130px;
  338.             padding:0px 0 0 75px;
  339.            
  340.         }
  341.         header #agenda
  342.         {
  343.             height:65px;
  344.             text-align:left;
  345.             margin:-15px 20px 10px 20px;
  346.             padding:0px;
  347.             overflow:hidden;
  348.             background-color:#DEE1E6;
  349.         }
  350.         header #agenda .tit-mobile
  351.         {
  352.             font-family: "FreesiaUPC", "Arial";
  353.             font-size:19px;
  354.             height:5px;
  355.             padding:0 5px;
  356.             color:#000000;
  357.         }
  358.         header #agenda ul
  359.         {
  360.             height:5px;
  361.         }
  362.         header #agenda ul li
  363.         {
  364.             margin:0;
  365.             padding:0 15px 0 0;
  366.             list-style-type: none;
  367.             display: inline;
  368.  
  369.         }
  370.        
  371.         header #agenda .alink
  372.         {
  373.             color:#20317B;
  374.         }
  375.         header #agenda .alink:hover
  376.         {
  377.             color:#000000;
  378.         }
  379.         header #agenda li a
  380.         {
  381.             font-family: "FreesiaUPC", "Arial";
  382.             color:#000000;
  383.             font-family: "FreesiaUPC", "Arial";
  384.             font-size:22px;
  385.             text-transform:uppercase;
  386.         }
  387.         header .iconos
  388.         {
  389.             text-align:left;
  390.             padding: 0 20px;
  391.         }
  392.         header .iconos table
  393.         {
  394.             width:982px;
  395.         }
  396. }
Lo que necesito, es que si el ancho es menor que 421px se vea de una forma, si es mayor, que se vea de otra.
Si me pueden ayudar se los agradeceré mucho!!!

Última edición por Gustavo1973; 21/04/2015 a las 15:36
  #7 (permalink)  
Antiguo 21/04/2015, 16:01
 
Fecha de Ingreso: febrero-2010
Mensajes: 227
Antigüedad: 14 años, 2 meses
Puntos: 4
Respuesta: CSS para adaptar web

Cita:
Iniciado por lauser Ver Mensaje
No es muy recomendable... pero si no tienes conocimientos y no puedes contratar a un profesional. Siempre puedes recurrir a: sitio1 o sitio2.
Muchas gracias! y sin recurrir a ese tipo de soluciones, y recordando que esto está sobre dreamweaver y es algo muy pequeño y con una sola hoja de estilos. No tengo otra manera de hacerlo, quiero decir, que creando otra hoja css que me cargue sólo cuando se visualiza desde un móvil, no me serviría? alguna hoja css que me podáis pasar? Tendría que modificar el header o algún archivo para que se cargue esta hoja css en esas condiciones?

gracias
__________________
Devivencias | psicologia online
  #8 (permalink)  
Antiguo 22/04/2015, 00:31
Avatar de NueveReinas  
Fecha de Ingreso: septiembre-2013
Ubicación: No tan Buenos Aires
Mensajes: 1.101
Antigüedad: 10 años, 7 meses
Puntos: 145
Respuesta: CSS para adaptar web

Si usas media-queries no tendrás que cargar ninguna otra hoja de estilos.

Si sigues pensando en crear un CSS para cada dispositivo, lee esto: http://www.forosdelweb.com/f13/recon...r-css-1044885/
__________________
¿Te sirvió la respuesta? Deja un +1
  #9 (permalink)  
Antiguo 22/04/2015, 01:36
Avatar de lauser
Moderator Unix/Linux
 
Fecha de Ingreso: julio-2013
Ubicación: Odessa (Ukrania)
Mensajes: 3.278
Antigüedad: 10 años, 9 meses
Puntos: 401
Respuesta: CSS para adaptar web

Cita:
Iniciado por skat Ver Mensaje
Muchas gracias! y sin recurrir a ese tipo de soluciones, y recordando que esto está sobre dreamweaver y es algo muy pequeño y con una sola hoja de estilos. No tengo otra manera de hacerlo, quiero decir, que creando otra hoja css que me cargue sólo cuando se visualiza desde un móvil, no me serviría? alguna hoja css que me podáis pasar? Tendría que modificar el header o algún archivo para que se cargue esta hoja css en esas condiciones?

gracias
No te podemos pasar una hoja css, simplemente por que depende del dideño de cada web. No lo entiendes?. Es como si quieres poner las ruedas de un coche en un camión, son diferentes.
__________________
Los usuarios que te responden, lo hacen altruistamente y sin ánimo de lucro con el único fin de ayudarte. Se paciente y agradecido.
-SOLOLINUX-

Etiquetas: color
Atención: Estás leyendo un tema que no tiene actividad desde hace más de 6 MESES, te recomendamos abrir un Nuevo tema en lugar de responder al actual.
Respuesta




La zona horaria es GMT -6. Ahora son las 06:16.