Mostrando entradas con la etiqueta CSS3. Mostrar todas las entradas
Mostrando entradas con la etiqueta CSS3. Mostrar todas las entradas

jueves, 6 de marzo de 2014

Solución a los problemas de compatibilidad con HTML5 de IE8 y Firefox 3


Se puede descargar el Js de Google en: http://code.google.com/p/html5shim/
1.- Agregan un condicional HTML para incluir un código JavaScript que sólo interpretarán las versiones anteriores a Internet Explorer 9:

<!--[if lt IE 9]>
    <script src="http://html5shim.googlecode.com/svn/trunk/html5.js"></script>
<![endif]--> 
 

2.- Obligar a Internet Explorer que muestre las nuevas etiquetas HTML5 como bloques, ya que no las interpreta como tal y ahí reside parte del problema.

article,aside,details,figcaption,figure,footer,header,hgroup,menu,nav,section, main{
    display: block;
} 

Esto deberemos insertarlo al principio de nuestra hoja de estilos.
Con esto nuestro sitio HTML5 se verá perfectamente en todos los navegadores*.


*Probado en Internet Explorer 7 y 8. (falta agregar más datos...)

miércoles, 29 de mayo de 2013

CSS medidas para diseño web adaptativo

CSS, sugerencia de medidas y notas para diseño web adaptativo (Responsive Design).

Medidas

960px
768px
480px
320px
200px
 
/************************* Base ******************************/
/************************* Ejemplo. 960px ******************************/
/*style.css*/

/************************* Responsive Design ******************************/
/************************* 960px - 1200px ******************************/
@media only screen and (min-width: 960px) and (max-width: 1200px) {
    
}

/************************* 768px - 960px ******************************/
@media only screen and (min-width: 768px) and (max-width: 959px) {
    
}

/************************* 480px - 768px ******************************/
@media only screen and (min-width: 480px) and (max-width: 767px) {
    
}

/************************* 320px - 480px ******************************/
@media only screen and (min-width: 320px) and (max-width: 479px) {
    
}

/************************* 200px - 320px ******************************/
@media only screen and (min-width: 0px) and (max-width: 319px) {
    
} 


Icono

<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="shortcut icon" href="/favicon.ico" type="image/vnd.microsoft.icon" />

<!-- For non-Retina iPhone, iPod Touch, and Android 2.2+ devices: -->
<link rel="apple-touch-icon" href="/img/WMB_57x57.png" />
<!-- For first-generation iPad: -->
<link rel="apple-touch-icon" sizes="72x72" href="/img/WMB_72x72.png" />
<!-- For iPhone 4 with high-resolution Retina display: -->
<link rel="apple-touch-icon" sizes="114x114" href="/img/WMB_114x114.png" />
<!-- No such device exists yet, so if this value is used, it means the sizes attribute is ignored: -->
<link rel="apple-touch-icon" sizes="228x228" href="/img/WMB_228x228.png" />

lunes, 13 de mayo de 2013

Degradado CSS3

Degradado CSS3, se pude usar en fondos, cuadros, etc.

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html lang="es">
<head>
    <title>Degradado CSS 3</title>
    <style type="text/css">
    div{
        border: 1px solid #000;
        padding:10px;
        margin: 20px;
        height: 130px;
        width: 230px;
        float: left;
    }
    .degradado1{
        background: -webkit-linear-gradient(orange, pink);
        background: -moz-linear-gradient(orange, pink);
        background: -o-linear-gradient(orange, pink);
        background: linear-gradient(orange, pink);
    }
    .degradado2{
        background: -webkit-linear-gradient(top left, #fff, #f66);
        background: -moz-linear-gradient(top left, #fff, #f66);
        background: -o-linear-gradient(top left, #fff, #f66);
        background: linear-gradient(top left, #fff, #f66);
    }
    .degradado3{
        background: -webkit-linear-gradient(180deg, #f0f, #f66);
        background: -moz-linear-gradient(180deg, #f0f, #f66);
        background: -o-linear-gradient(180deg, #f0f, #f66);
        background: linear-gradient(180deg, #f0f, #f66);
    }
    .degradado4{
        background: -webkit-linear-gradient(#00f 50%, #000);
        background: -moz-linear-gradient(#00f 50%, #000);
        background: -o-linear-gradient(#00f 50%, #000);
        background: linear-gradient(#00f 50%, #000);
    }
    .degradado5{
        background: -webkit-linear-gradient(45deg, #66f, #f80, #ffc);
        background: -moz-linear-gradient(45deg, #66f, #f80, #ffc);
        background: -o-linear-gradient(45deg, #66f, #f80, #ffc);
        background: linear-gradient(45deg, #66f, #f80, #ffc);
    }
    .degradado6{
        background: -webkit-linear-gradient(45deg, #66f 10%, #f80 30%, #ffc 60%);
        background: -moz-linear-gradient(45deg, #66f 10%, #f80 30%, #ffc 60%);
        background: -o-linear-gradient(45deg, #66f 10%, #f80 30%, #ffc 60%);
        background: linear-gradient(45deg, #66f 10%, #f80 30%, #ffc 60%);
    }
    .degradado7{
        background: -webkit-linear-gradient(45deg, #66f 160px, #f80 180px, #ffc);
        background: -moz-linear-gradient(45deg, #66f 160px, #f80 180px, #ffc);
        background: -o-linear-gradient(45deg, #66f 160px, #f80 180px, #ffc);
        background: linear-gradient(45deg, #66f 160px, #f80 180px, #ffc);
    }
    .degradado8{
        background: -webkit-linear-gradient(left, #f00, #f80, #ff0, #0f0, #00f, #60f, #c0f);
        background: -moz-linear-gradient(left, #f00, #f80, #ff0, #0f0, #00f, #60f, #c0f);
        background: -o-linear-gradient(left, #f00, #f80, #ff0, #0f0, #00f, #60f, #c0f);
        background: linear-gradient(left, #f00, #f80, #ff0, #0f0, #00f, #60f, #c0f);
    }
    </style>
</head>
<body>    
    <div class="degradado1"></div>
    <div class="degradado2"></div>
    <div class="degradado3"></div>
    <div class="degradado4"></div>
    <div class="degradado5"></div>
    <div class="degradado6"></div>
    <div class="degradado7"></div>
    <div class="degradado8"></div>
</body>
</html>

lunes, 6 de mayo de 2013

CSS3 @font-face Rule

Si se desea importar fuentes de nuestra carpeta podemos realziarlo de esta manera:

 
@font-face {
    font-family: "BebasNeue";
    src: url('../font/BebasNeue/eot/BebasNeue.eot'); /* IE9 Compat Modes */
    src: url('../font/BebasNeue/eot/BebasNeue.eot?#iefix') format('embedded-opentype'), /* IE6-IE8 */
        url('../font/BebasNeue/woff/BebasNeue.woff') format('woff'), /* Modern Browsers */
        url('../font/BebasNeue/ttf/BebasNeue.ttf')  format('truetype'), /* Safari, Android, iOS */
        url('../font/BebasNeue/svg/BebasNeue.svg#BebasNeue') format('svg'), /* Legacy iOS */
        url('../font/BebasNeue/otf/BebasNeue.otf'); /*Original fonts*/
}

Lo mínimo que podría tener son fuentes con estas dos extensiones:

 
@font-face{
    font-family: BebasNeue;
    src: url('../font/BebasNeue/ttf/BebasNeue.ttf'), /* Safari, Android, iOS */
        url('../font/BebasNeue/eot/BebasNeue.eot'); /* IE9 Compat Modes */
}