Skip to content

Instantly share code, notes, and snippets.

@highercomve
Created July 14, 2014 05:12
Show Gist options
  • Save highercomve/f9653f345889eb3dd636 to your computer and use it in GitHub Desktop.
Save highercomve/f9653f345889eb3dd636 to your computer and use it in GitHub Desktop.
Ejemplo Parallax
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Ejemplo de Parallax sencillo | Escuelaweb.net</title>
<link rel="stylesheet" href="css/parallax.css">
</head>
<body>
<header>
<div class="row">
<h1>Ejemplo de parallax simple solo con CSS</h1>
</div>
</header>
<section class="fondo-parallax fondo-1 modulo-alto">
<div class="row">
<header>
<h2 class="titulo-gigante">Todos quieren Parallax</h2>
</header>
</div>
</section>
<section class="fondo-parallax fondo-2 modulo-alto">
<div class="row">
<header>
<h2 class="titulo-gigante">Todos quieren Parallax</h2>
</header>
</div>
</section>
<section class="fondo-parallax fondo-3 modulo-alto">
<div class="row">
<header>
<h2 class="titulo-gigante">Todos quieren Parallax</h2>
</header>
</div>
</section>
</body>
</html>
body {
font-family: Helvetica;
margin: 0;
padding: 0;
}
header {
padding: 1em;
background-color: #f2f2f2;
}
header h1 {
color: #000;
font-weight: normal;
text-transform: capitalize;
font-variant: small-caps;
text-align: center;
}
.row {
max-width: 940px;
margin: 0 auto;
}
section header {
background-color: transparent;
}
.fondo-parallax {
background-attachment: fixed;
background-repeat: no-repeat;
background-position: center center;
background-size: cover;
}
.fondo-1 {
background-image: url(../images/banner-bg.jpg);
}
.fondo-2 {
background-image: url(../images/home_header.jpg);
}
.fondo-3 {
background-image: url(../images/intro-bg.jpg);
}
.modulo-alto {
padding: 1em;
min-height: 600px;
text-align: center;
}
.titulo-gigante {
margin: 15em 0;
display: inline-block;
padding: 2em 3em;
border: 2px solid white;
color: white;
background-color: rgba(0, 0, 0, 0.3);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment