├── exercises ├── 05-Float-example │ ├── styles.css │ ├── solution.hide.css │ ├── README.md │ ├── README.es.md │ ├── index.html │ └── test.js ├── 06-center-content │ ├── styles.css │ ├── solution.hide.css │ ├── README.md │ ├── index.html │ ├── solution.hide.html │ ├── README.es.md │ └── test.js ├── 02-Display-none │ ├── styles.css │ ├── solution.hide.css │ ├── README.md │ ├── index.html │ ├── README.es.md │ └── test.js ├── 04-Move-image-behind-the-text │ ├── styles.css │ ├── solution.hide.css │ ├── README.md │ ├── README.es.md │ ├── index.html │ └── test.js ├── 07-Sidebar │ ├── styles.css │ ├── solution.hide.css │ ├── index.html │ ├── README.md │ ├── README.es.md │ └── test.js ├── 08-Split-Screen-in-three │ ├── styles.css │ ├── solution.hide.css │ ├── index.html │ ├── README.md │ ├── README.es.md │ └── test.js ├── 01-Hello-World │ ├── README.md │ └── README.es.md ├── 09.1-Before-and-After │ ├── index.html │ ├── styles.css │ ├── solution.hide.css │ ├── README.md │ ├── README.es.md │ └── test.js ├── 09.2-Calendar-icon │ ├── index.html │ ├── styles.css │ ├── solution.hide.css │ ├── README.md │ └── README.es.md ├── 03-Position-relative-vs-absolute │ ├── index.html │ ├── styles.css │ ├── README.md │ └── README.es.md ├── 10-static-layout │ ├── index.html │ ├── styles.css │ ├── solution.hide.css │ ├── README.md │ └── README.es.md └── 09-Beautify │ ├── styles.css │ ├── index.html │ ├── solution.hide.html │ ├── solution.hide.css │ ├── README.md │ ├── README.es.md │ └── test.js ├── css-layouts-badge.png ├── .learn └── assets │ ├── 0B62fyP.png │ ├── 69N2q6G.png │ ├── AlDLXvy.png │ ├── BKz8ozg.png │ ├── GWK2xA2.png │ ├── XX6daZ3.png │ ├── ccOZ42Q.png │ ├── f4hm3qp.png │ ├── ham9E91.png │ ├── preview.png │ ├── z-index.png │ ├── 09-Beauty.png │ ├── cat-funny.jpeg │ ├── jim-carrie.png │ ├── img-three-parts.png │ └── image-layout-beauty.png ├── .gitpod.Dockerfile ├── .vscode └── settings.json ├── .gitignore ├── .gitpod.yml ├── .github └── workflows │ └── learnpack-audit.yml ├── .devcontainer └── devcontainer.json ├── learn.json ├── README.md └── README.es.md /exercises/05-Float-example/styles.css: -------------------------------------------------------------------------------- 1 | #myImage{ 2 | max-width: 250px; 3 | } -------------------------------------------------------------------------------- /exercises/06-center-content/styles.css: -------------------------------------------------------------------------------- 1 | body{ 2 | background:blue; 3 | } -------------------------------------------------------------------------------- /exercises/02-Display-none/styles.css: -------------------------------------------------------------------------------- 1 | /* your code here */ 2 | #myFirstH2{ 3 | visibility: visible; 4 | } -------------------------------------------------------------------------------- /css-layouts-badge.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/4GeeksAcademy/css-layouts-tutorial-exercises/HEAD/css-layouts-badge.png -------------------------------------------------------------------------------- /exercises/04-Move-image-behind-the-text/styles.css: -------------------------------------------------------------------------------- 1 | #myImage { 2 | position: absolute; 3 | left: 0px; 4 | top: 0px; 5 | } 6 | -------------------------------------------------------------------------------- /.learn/assets/0B62fyP.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/4GeeksAcademy/css-layouts-tutorial-exercises/HEAD/.learn/assets/0B62fyP.png -------------------------------------------------------------------------------- /.learn/assets/69N2q6G.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/4GeeksAcademy/css-layouts-tutorial-exercises/HEAD/.learn/assets/69N2q6G.png -------------------------------------------------------------------------------- /.learn/assets/AlDLXvy.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/4GeeksAcademy/css-layouts-tutorial-exercises/HEAD/.learn/assets/AlDLXvy.png -------------------------------------------------------------------------------- /.learn/assets/BKz8ozg.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/4GeeksAcademy/css-layouts-tutorial-exercises/HEAD/.learn/assets/BKz8ozg.png -------------------------------------------------------------------------------- /.learn/assets/GWK2xA2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/4GeeksAcademy/css-layouts-tutorial-exercises/HEAD/.learn/assets/GWK2xA2.png -------------------------------------------------------------------------------- /.learn/assets/XX6daZ3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/4GeeksAcademy/css-layouts-tutorial-exercises/HEAD/.learn/assets/XX6daZ3.png -------------------------------------------------------------------------------- /.learn/assets/ccOZ42Q.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/4GeeksAcademy/css-layouts-tutorial-exercises/HEAD/.learn/assets/ccOZ42Q.png -------------------------------------------------------------------------------- /.learn/assets/f4hm3qp.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/4GeeksAcademy/css-layouts-tutorial-exercises/HEAD/.learn/assets/f4hm3qp.png -------------------------------------------------------------------------------- /.learn/assets/ham9E91.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/4GeeksAcademy/css-layouts-tutorial-exercises/HEAD/.learn/assets/ham9E91.png -------------------------------------------------------------------------------- /.learn/assets/preview.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/4GeeksAcademy/css-layouts-tutorial-exercises/HEAD/.learn/assets/preview.png -------------------------------------------------------------------------------- /.learn/assets/z-index.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/4GeeksAcademy/css-layouts-tutorial-exercises/HEAD/.learn/assets/z-index.png -------------------------------------------------------------------------------- /exercises/05-Float-example/solution.hide.css: -------------------------------------------------------------------------------- 1 | #myImage { 2 | max-width: 250px; 3 | float: left; 4 | margin-right: 4px; 5 | } 6 | -------------------------------------------------------------------------------- /.learn/assets/09-Beauty.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/4GeeksAcademy/css-layouts-tutorial-exercises/HEAD/.learn/assets/09-Beauty.png -------------------------------------------------------------------------------- /.learn/assets/cat-funny.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/4GeeksAcademy/css-layouts-tutorial-exercises/HEAD/.learn/assets/cat-funny.jpeg -------------------------------------------------------------------------------- /.learn/assets/jim-carrie.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/4GeeksAcademy/css-layouts-tutorial-exercises/HEAD/.learn/assets/jim-carrie.png -------------------------------------------------------------------------------- /.learn/assets/img-three-parts.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/4GeeksAcademy/css-layouts-tutorial-exercises/HEAD/.learn/assets/img-three-parts.png -------------------------------------------------------------------------------- /.learn/assets/image-layout-beauty.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/4GeeksAcademy/css-layouts-tutorial-exercises/HEAD/.learn/assets/image-layout-beauty.png -------------------------------------------------------------------------------- /exercises/04-Move-image-behind-the-text/solution.hide.css: -------------------------------------------------------------------------------- 1 | #myImage { 2 | position: absolute; 3 | left: 0px; 4 | top: 0px; 5 | z-index: -1; /* Any number below 0 works */ 6 | } 7 | -------------------------------------------------------------------------------- /exercises/06-center-content/solution.hide.css: -------------------------------------------------------------------------------- 1 | body { 2 | background: blue; 3 | } 4 | 5 | .myDiv { 6 | background: grey; 7 | width: 400px; 8 | margin: auto; 9 | } 10 | -------------------------------------------------------------------------------- /exercises/07-Sidebar/styles.css: -------------------------------------------------------------------------------- 1 | .wrapper { 2 | width: 100%; 3 | height: 100px; 4 | } 5 | 6 | .sidebar { 7 | background: #999; 8 | } 9 | 10 | .content { 11 | background: #2e6833; 12 | } 13 | -------------------------------------------------------------------------------- /.gitpod.Dockerfile: -------------------------------------------------------------------------------- 1 | FROM gitpod/workspace-full:latest 2 | 3 | USER gitpod 4 | 5 | RUN npm i jest@29.7.0 jest-environment-jsdom@29.7.0 -g 6 | RUN npm i @learnpack/learnpack@2.1.47 -g && learnpack plugins:install @learnpack/html@1.1.7 7 | -------------------------------------------------------------------------------- /.vscode/settings.json: -------------------------------------------------------------------------------- 1 | { 2 | "files.autoSave": "afterDelay", 3 | "files.autoSaveDelay": 700, 4 | "editor.minimap.enabled": false, 5 | "workbench.editorAssociations": { 6 | "*.md": "vscode.markdown.preview.editor" 7 | } 8 | } -------------------------------------------------------------------------------- /exercises/08-Split-Screen-in-three/styles.css: -------------------------------------------------------------------------------- 1 | body { 2 | margin: 0; 3 | } 4 | 5 | .boxA { 6 | background: #4682B4; 7 | 8 | } 9 | 10 | .boxB { 11 | background: #A9A9A9; 12 | 13 | } 14 | 15 | .boxC { 16 | background: #FFA500; 17 | } 18 | -------------------------------------------------------------------------------- /exercises/07-Sidebar/solution.hide.css: -------------------------------------------------------------------------------- 1 | .wrapper { 2 | display: flex; 3 | width: 100%; 4 | height: 100px; 5 | } 6 | 7 | .sidebar { 8 | background: #999; 9 | width: 30%; 10 | } 11 | 12 | .content { 13 | background: #2e6833; 14 | width: 70%; 15 | } 16 | -------------------------------------------------------------------------------- /exercises/02-Display-none/solution.hide.css: -------------------------------------------------------------------------------- 1 | /* your code here */ 2 | #myFirstH2 { 3 | visibility: hidden; 4 | } 5 | 6 | #mySecondH2 { 7 | display: none; 8 | } 9 | 10 | #myUL li { 11 | display: inline; 12 | } 13 | 14 | strong { 15 | display: block; 16 | } 17 | -------------------------------------------------------------------------------- /exercises/01-Hello-World/README.md: -------------------------------------------------------------------------------- 1 | # Welcome to Layouts 2 | 3 | During this lesson you will learn: 4 | 5 | 1. Display vs Position. 6 | 7 | 2. Display: Flex property. 8 | 9 | 3. Float property. 10 | 11 | 4. How to center content. 12 | 13 | 5. Sidebar layouts. 14 | 15 | 6. Using `:before` and `:after`. 16 | -------------------------------------------------------------------------------- /exercises/01-Hello-World/README.es.md: -------------------------------------------------------------------------------- 1 | # Welcome to Layouts 2 | 3 | Durante esta lección aprenderás: 4 | 5 | 1. Display vs Position. 6 | 7 | 2. La propiedad Display: Flex. 8 | 9 | 3. La propiedad Float. 10 | 11 | 4. Cómo centrar contenido. 12 | 13 | 5. Diseños de sidebars. 14 | 15 | 6. Usar `:before` y `:after`. 16 | -------------------------------------------------------------------------------- /exercises/09.1-Before-and-After/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 |
5 | 6 | 7 |7
12 | 13 | 14 | -------------------------------------------------------------------------------- /exercises/05-Float-example/README.md: -------------------------------------------------------------------------------- 1 | # `05` Float example 2 | 3 | `float` moves the element to the side of the document (left or right). 4 | 5 | Use `float` to place the image like this: 6 | 7 |  8 | 9 | ## 💡 Hint: 10 | 11 | You will probably have to use `margin-right` to leave the proper space between the text and the image. -------------------------------------------------------------------------------- /exercises/05-Float-example/README.es.md: -------------------------------------------------------------------------------- 1 | # `05` Float example 2 | 3 | `float` mueve el elemento a un lado del documento (izquierda o derecha). 4 | 5 | Usa `float` para colocar la imagen así: 6 | 7 |  8 | 9 | ## 💡 Pista: 10 | 11 | Probablemente tendrás que usar `margin-right` para dejar el espacio correspondiente entre el texto y la imagen. 12 | -------------------------------------------------------------------------------- /exercises/08-Split-Screen-in-three/solution.hide.css: -------------------------------------------------------------------------------- 1 | body { 2 | margin: 0; 3 | } 4 | 5 | .wrapper { 6 | display: flex; 7 | width: 100%; 8 | height: 100px; 9 | } 10 | 11 | .boxA { 12 | background: #4682B4; 13 | width: 33.33%; 14 | } 15 | 16 | .boxB { 17 | background: #A9A9A9; 18 | width: 33.33%; 19 | } 20 | 21 | .boxC { 22 | background: #FFA500; 23 | width: 33.33%; 24 | } 25 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Ignore everything 2 | /* 3 | 4 | !.gitignore 5 | !.gitpod.yml 6 | !.gitpod.Dockerfile 7 | !learn.json 8 | !README.md 9 | !README.es.md 10 | !.vscode 11 | 12 | !/exercises 13 | !/exercises/* 14 | 15 | !/.learn 16 | /.learn/** 17 | !/.learn/learn.json 18 | !/.learn/resets 19 | !/.learn/resets/** 20 | !/.learn/assets 21 | !/.learn/assets/** 22 | 23 | *.pyc 24 | __pycache__/ 25 | .pytest_cache/ 26 | -------------------------------------------------------------------------------- /exercises/08-Split-Screen-in-three/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 |This is a paragraph.
13 |This is another paragraph.
14 |
20 |
21 |
22 |
--------------------------------------------------------------------------------
/exercises/02-Display-none/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 | This is a paragraph, with some words more important than others
18 |This is another paragraph.
19 | 20 | 21 | -------------------------------------------------------------------------------- /exercises/02-Display-none/README.es.md: -------------------------------------------------------------------------------- 1 | # `02` Display None 2 | 3 | ## 📝 Instrucciones: 4 | 5 | 1. Esconde el primer elemento `
12 | 13 | At vero eos et accusamus et iusto odio dignissimos ducimus qui blanditiis praesentium voluptatum deleniti atque corrupti quos dolores et 14 | quas molestias excepturi sint occaecati cupiditate non provident, similique sunt in culpa qui officia deserunt mollitia animi, id est 15 | laborum et dolorum fuga. Et harum quidem rerum facilis est et expedita distinctio. Nam libero tempore, cum soluta nobis est eligendi optio 16 | cumque nihil impedit. 17 |
18 | 19 | 20 | -------------------------------------------------------------------------------- /exercises/10-static-layout/solution.hide.css: -------------------------------------------------------------------------------- 1 | /* your code here */ 2 | .wrapper { 3 | padding: 0px 10px; 4 | } 5 | 6 | .secondWrapper { 7 | display: flex; 8 | } 9 | 10 | nav { 11 | width: 20%; 12 | } 13 | 14 | section { 15 | width: 80%; 16 | margin-left: 10px; 17 | } 18 | 19 | /************************************** 20 | DON'T CHANGE ANYTHING AFTER THIS LINE 21 | **************************************/ 22 | 23 | *, 24 | *:before, 25 | *:after { 26 | -moz-box-sizing: border-box; 27 | -webkit-box-sizing: border-box; 28 | box-sizing: border-box; 29 | } 30 | 31 | body { 32 | background: #2980b9; 33 | color: #fff; 34 | font-family: Helvetica; 35 | text-align: center; 36 | margin: 0; 37 | } 38 | 39 | header, 40 | nav, 41 | section { 42 | border: 1px solid rgba(255, 255, 255, 0.8); 43 | margin-bottom: 10px; 44 | border-radius: 3px; 45 | } 46 | 47 | header { 48 | padding: 10px 0; 49 | } 50 | 51 | nav, 52 | section { 53 | padding: 100px 0; 54 | } 55 | -------------------------------------------------------------------------------- /.github/workflows/learnpack-audit.yml: -------------------------------------------------------------------------------- 1 | # This workflow will do a clean install of node dependencies, cache/restore them, build the source code and run tests across different versions of node 2 | # For more information see: https://help.github.com/actions/language-and-framework-guides/using-nodejs-with-github-actions 3 | 4 | name: Learnpack audit 5 | 6 | on: 7 | push: 8 | branches: [ main ] 9 | pull_request: 10 | branches: [ main ] 11 | 12 | jobs: 13 | build: 14 | 15 | runs-on: ubuntu-latest 16 | 17 | strategy: 18 | matrix: 19 | node-version: [20.x] 20 | # See supported Node.js release schedule at https://nodejs.org/en/about/releases/ 21 | 22 | steps: 23 | - uses: actions/checkout@v2 24 | - name: Use Node.js ${{ matrix.node-version }} 25 | uses: actions/setup-node@v2 26 | with: 27 | node-version: ${{ matrix.node-version }} 28 | - run: npm install @learnpack/learnpack@latest -g 29 | - run: learnpack audit -------------------------------------------------------------------------------- /exercises/09-Beautify/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 |We are going to explain in this paragraph the 3 most common signs that you should look into yourself to recognize if you are learning.
15 |If you can't sleep, what's better than watching videos of cats? click here
28 | 29 | 30 | 31 | -------------------------------------------------------------------------------- /exercises/06-center-content/solution.hide.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 |We are going to explain in this paragraph the 3 most common signs that you should look into yourself to recognize if you are learning.
15 |If you can't sleep, what's better than watching videos of cats? click here
27 | tag', () => {
47 | let p = document.querySelectorAll("p")
48 |
49 | expect(p.length).toBeGreaterThan(0)
50 | })
51 |
--------------------------------------------------------------------------------
/exercises/09.2-Calendar-icon/README.es.md:
--------------------------------------------------------------------------------
1 | # `09.2` Calendar Icon
2 |
3 | En este ejercicio, usarás los pseudoelementos `::before` y `::after` para construir un ícono que simule la apariencia de un calendario clásico con anillos de sujeción. El objetivo es aplicar estilos creativos con CSS para generar formas visuales sin usar imágenes externas.
4 |
5 | El elemento base es un `div` con la clase `.calendar`, que contiene un elemento ``. Ya se han creado los pseudoelementos, pero su posición, color y forma no están correctamente definidos.
6 |
7 | 
8 |
9 |
10 |
11 | ## 📝 Instrucciones:
12 |
13 | 1. Usa `position: absolute` para posicionar adecuadamente los pseudoelementos `::before` y `::after` del contenedor `.calendar`, de modo que representen los bordes o marcas superiores del calendario.
14 |
15 | 2. Aplica también `position: absolute` a los pseudoelementos `::before` y `::after` del elemento `` (que actúan como anillos o sujetadores).
16 |
17 | 3. Ajusta sus colores para que coincidan entre sí y simulen visualmente el metal o plástico del anillo.
18 |
19 | 4. Aplica `border-radius` a los pseudoelementos de `` para que tomen una forma circular, simulando un anillo visto desde el frente (2D).
20 |
21 |
22 |
23 | ## 💡 Pista:
24 |
25 | + Si no colocas los pseudoelementos en `position: absolute`, seguirán ocupando espacio en el flujo del documento.
26 | + Puedes usar propiedades como `width`, `height`, `background-color`, `border-radius` y `top`, `left`, etc. para posicionar y estilizar los anillos.
27 | + Este ejercicio no tiene pruebas debido a que se puede llegar a la solución con diferentes valores, por lo que cuando el resultado de tu código se vea similar al ejemplo, puedes pasar al siguiente ejercicio.
28 |
29 |
30 |
31 |
--------------------------------------------------------------------------------
/exercises/07-Sidebar/README.es.md:
--------------------------------------------------------------------------------
1 | # `07` Sidebar
2 |
3 | Una estructura común en los sitios web modernos es el diseño con una **barra lateral** (o *sidebar*) a la izquierda y un **contenido principal** a la derecha. Este patrón se usa, por ejemplo, en paneles de administración, sitios de noticias o mensajería.
4 |
5 |
6 | A partir de este ejercicio, aprenderás a usar `Flexbox`, una técnica moderna de CSS que te permite organizar los elementos dentro de un contenedor de manera flexible y sencilla. Cuando usas `display: flex;` en un contenedor, sus elementos hijos se colocan automáticamente **uno al lado del otro**, a menos que indiques lo contrario. Esto lo hace ideal para construir layouts como este.
7 |
8 |
9 |
10 | Por lo tanto el objetivo de este ejercicio será replicar un diseño de dos columnas en la misma línea: una barra lateral del 30% de ancho y un área de contenido del 70%.
11 |
12 |
13 | 
14 |
15 | ## 📝 Instrucciones:
16 |
17 | 1. Crea un `div` contenedor con clase `wrapper`.
18 | 2. Asegúrate de que:
19 | - El `div.wrapper` tenga `width: 100%` y `height: 100px`.
20 | - Use `display: flex` para colocar sus elementos en línea.
21 | 3. Dentro del contenedor, coloca:
22 | - Un `div.sidebar` con `width: 30%` y color de fondo **gris**.
23 | - Un `div.content` con `width: 70%` y color de fondo **verde**.
24 |
25 |
26 | ### 💡 Pistas
27 |
28 | - No necesitas modificar el HTML, solo aplicar o completar los estilos CSS.
29 | - Usa colores de fondo para visualizar mejor las áreas.
30 | - No uses `float`, ni `position` en este ejercicio.
31 |
32 |
--------------------------------------------------------------------------------
/exercises/10-static-layout/README.md:
--------------------------------------------------------------------------------
1 | # `10` Static Layout
2 |
3 | En este ejercicio practicarás cómo distribuir elementos horizontalmente dentro de un contenedor usando **Flexbox** y otras propiedades fundamentales de CSS.
4 |
5 | El objetivo es construir una estructura web básica compuesta por un encabezado y dos bloques principales alineados en una misma fila: un menú lateral de navegación y una sección de contenido.
6 |
7 | El archivo HTML ya viene preparado y **no debe ser modificado**. Los elementos que vas a estilizar son:
8 |
9 | - `.wrapper`: contenedor principal de toda la página.
10 | - `