¿Cómo crear una imagen de página completa con AMP?
Video Tutorial
Imagen de página completa con AMP
Aprenda a crear una imagen de fondo que cubra toda la ventana del navegador con AMP. El siguiente ejemplo le ayudara a insertar una imagen de fondo receptiva a pantalla completa
Paso 1 Agregar el compenente
Ejemplo
<script async src='https://cdn.ampproject.org/v0.js'/>
Paso 2 Agregar el siguiente código justo después de la apertura <body>
Ejemplo
<amp-img alt="AMP" height="320" layout="responsive" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgna6DREWTHFutz3mV-I3UyFo5NcNal54Z-614hcbYofnm6VXhYP6F1HMiLoFJhCif58Cd0HsfPSkaBVksC6CcnObCUCPPVQ3ILN2qcoy0RkfXDnOewkao9HZp7qDFKNqpgRq8FqKegeQ9l/s1600/amp-html.jpg" width="500"></amp-img>
Paso 3 Cambie la URL de imagen
Paso 4 Demostración
A continuación la estructura completa del ejemplo
Ejemplo
<!doctype html>
<html ⚡>
<head>
<meta charset="utf-8">
<script async src="https://cdn.ampproject.org/v0.js"></script>
<link rel="canonical" href="https://www.amphtmlenespanol.com/">
<meta name="viewport" content="width=device-width,minimum-scale=1,initial-scale=1">
<style amp-custom>
</style>
<style amp-boilerplate>body{-webkit-animation:-amp-start 8s steps(1,end) 0s 1 normal both;-moz-animation:-amp-start 8s steps(1,end) 0s 1 normal both;-ms-animation:-amp-start 8s steps(1,end) 0s 1 normal both;animation:-amp-start 8s steps(1,end) 0s 1 normal both}@-webkit-keyframes -amp-start{from{visibility:hidden}to{visibility:visible}}@-moz-keyframes -amp-start{from{visibility:hidden}to{visibility:visible}}@-ms-keyframes -amp-start{from{visibility:hidden}to{visibility:visible}}@-o-keyframes -amp-start{from{visibility:hidden}to{visibility:visible}}@keyframes -amp-start{from{visibility:hidden}to{visibility:visible}}</style><noscript><style amp-boilerplate>body{-webkit-animation:none;-moz-animation:none;-ms-animation:none;animation:none}</style></noscript>
</head>
<body>
<amp-img alt="AMP" height="320" layout="responsive" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgna6DREWTHFutz3mV-I3UyFo5NcNal54Z-614hcbYofnm6VXhYP6F1HMiLoFJhCif58Cd0HsfPSkaBVksC6CcnObCUCPPVQ3ILN2qcoy0RkfXDnOewkao9HZp7qDFKNqpgRq8FqKegeQ9l/s1600/amp-html.jpg" width="500"></amp-img>
</body>
</html>
<html ⚡>
<head>
<meta charset="utf-8">
<script async src="https://cdn.ampproject.org/v0.js"></script>
<link rel="canonical" href="https://www.amphtmlenespanol.com/">
<meta name="viewport" content="width=device-width,minimum-scale=1,initial-scale=1">
<style amp-custom>
</style>
<style amp-boilerplate>body{-webkit-animation:-amp-start 8s steps(1,end) 0s 1 normal both;-moz-animation:-amp-start 8s steps(1,end) 0s 1 normal both;-ms-animation:-amp-start 8s steps(1,end) 0s 1 normal both;animation:-amp-start 8s steps(1,end) 0s 1 normal both}@-webkit-keyframes -amp-start{from{visibility:hidden}to{visibility:visible}}@-moz-keyframes -amp-start{from{visibility:hidden}to{visibility:visible}}@-ms-keyframes -amp-start{from{visibility:hidden}to{visibility:visible}}@-o-keyframes -amp-start{from{visibility:hidden}to{visibility:visible}}@keyframes -amp-start{from{visibility:hidden}to{visibility:visible}}</style><noscript><style amp-boilerplate>body{-webkit-animation:none;-moz-animation:none;-ms-animation:none;animation:none}</style></noscript>
</head>
<body>
<amp-img alt="AMP" height="320" layout="responsive" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgna6DREWTHFutz3mV-I3UyFo5NcNal54Z-614hcbYofnm6VXhYP6F1HMiLoFJhCif58Cd0HsfPSkaBVksC6CcnObCUCPPVQ3ILN2qcoy0RkfXDnOewkao9HZp7qDFKNqpgRq8FqKegeQ9l/s1600/amp-html.jpg" width="500"></amp-img>
</body>
</html>
Comentarios
Disqus comments:
Facebook comments: