Skip to content

Commit c99836a

Browse files
authored
Merge pull request #1628 from ironhack-labs/uros/feat/add-faq-section
Add FAQs section
2 parents 53c9edf + 4782066 commit c99836a

File tree

1 file changed

+219
-50
lines changed

1 file changed

+219
-50
lines changed

README.md

Lines changed: 219 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -9,19 +9,13 @@
99
We use the Slack app almost every day to keep our communications with our classmates and the **Ironhack** team, but today we will be focusing on their landing page. In today's lab, we'll recreate Slack's landing page while ensuring it's responsive and adapts well to different screens. You can see the web page that we will be cloning [here](https://www.figma.com/proto/k77VYVA70WcPYRLvg4QmIf/LAB-CSS-Slack-Clone?node-id=125%3A3&scaling=scale-down-width&page-id=125%3A2&starting-point-node-id=125%3A3&hide-ui=1).
1010

1111

12-
1312
The goal of the lab is to create a *responsive* landing page using **CSS** and **Flexbox**.
1413

15-
16-
17-
1814
## Requirements
1915

2016
- Fork this repo
2117
- Clone this repo
2218

23-
24-
2519
## Submission
2620

2721
- Upon completion, run the following commands:
@@ -40,12 +34,8 @@ The goal of the lab is to create a *responsive* landing page using **CSS** and *
4034

4135
The `starter_code` folder contains all the files you'll need. The `images` folder contains all the images you'll need for your page, although most of them are already displayed on the page.
4236

43-
44-
4537
**The `index.html` already contains all the text and content needed. We will be focusing on the CSS and styling!**
4638

47-
48-
4939
During each iteration, the first step you should do is to inspect the provided screenshots. These are included in each iteration, along with a preview of the final result. Use these as a starting point for implementing your styles.
5040

5141
<br />
@@ -58,7 +48,7 @@ The first step during every iteration will be to inspect the design files. These
5848
5949
Figma is great because it allows designers and developers to collaborate on projects while also making it simple to share and preview web page designs.
6050
61-
When you begin working as a developer, your team will likely use Figma to hand off to you the designs of the features you will be asked to create. We're going to assume you've never seen Figma before, so don't worry. The following short videos should get you up to speed:
51+
When you begin working as a developer, your team will likely use Figma to hand off to you the designs of the features you will be asked to create. We're going to assume you've never seen Figma before, so don't worry. The following short videos should get you up to speed:
6252
6353
- [What is Figma?](https://www.youtube.com/watch?v=_d8GG2QZYAM)
6454
- [Figma for Frontend developers [ in 5 minutes ]](https://www.youtube.com/watch?v=hbN9RGcQFNU)
@@ -79,8 +69,6 @@ We will start by focusing on the styles for mobile screens first! :iphone: Oh! R
7969

8070
When done, your page should look like this: [Preview - Mobile](https://www.figma.com/proto/k77VYVA70WcPYRLvg4QmIf/LAB-CSS-Slack-Clone?node-id=68%3A2762&scaling=scale-down&page-id=68%3A2761&starting-point-node-id=68%3A2762&show-proto-sidebar=1&hide-ui=1)
8171

82-
83-
8472
<br>
8573

8674
Use the following page screenshot as the guide:
@@ -90,13 +78,11 @@ Use the following page screenshot as the guide:
9078
<img src="https://education-team-2020.s3.eu-west-1.amazonaws.com/web-dev/m1/lab-flexbox-slack/Slack+Home+Page+-+420px.png" width="200px"/>
9179
<br/>
9280

81+
9382
[Back to top](#iteration-1--mobile-screens-width--768px)
9483
</details>
9584

9685

97-
98-
99-
10086
<!--
10187
10288
You can inspect the page styles here:
@@ -119,23 +105,16 @@ You can inspect the page styles here:
119105
### Iteration 2 | Small Screens (width > 768px and width < 1024px)
120106

121107
Let's start growing our screen size. In this iteration, you will work on making the website look great on small screens (iPads, tablets, or larger smartphones). You will have to use CSS [media queries](https://developer.mozilla.org/en-US/docs/Web/CSS/Media_Queries/Using_media_queries) to apply the style and layout changes. Take a look at the preview and the screenshot to see the changes that are needed. Your task is to work on the following:
122-
123-
124-
125108
- The **header** should go from 1 column to display 2 columns: one with the content and buttons, and the other with the image.
126109
- The **company logos** should be displayed in a single row.
127110
- The **images** in the sections in the **main** part should be fully displayed and aligned to the left or right side of the page, respectively.
128111
- The **section "Teams large and small rely on Slack"** should have the list items and the buttons displayed horizontally as rows.
129112
- The **sub-footer** items, previously displayed as a column, should now be displayed in a single row.
130113

131-
132-
133114
<br>
134115

135116
When done, your page should look like this: [Preview - Small Screens](https://www.figma.com/proto/k77VYVA70WcPYRLvg4QmIf/LAB-CSS-Slack-Clone?node-id=49%3A1508&scaling=scale-down&page-id=68%3A2976&starting-point-node-id=49%3A1508&hide-ui=1)
136117

137-
138-
139118
<br>
140119

141120
Use the following page screenshot as the guide:
@@ -145,6 +124,7 @@ Use the following page screenshot as the guide:
145124
<img src="https://education-team-2020.s3.eu-west-1.amazonaws.com/web-dev/m1/lab-flexbox-slack/Slack+Home+Page+-+768px.png" width="550px"/>
146125
<br/>
147126

127+
148128
[Back to top](#iteration-2--small-screens-width--768px-and-width--1024px)
149129
</details>
150130

@@ -159,35 +139,22 @@ You can inspect the page styles here:
159139
-->
160140

161141

162-
163-
164-
165142
<br>
166143

167-
168-
169144
----
170145

171146

172-
173147
### Iteration 3 | Medium Screens (width > 1024px and width < 1440px)
174148

175-
We'll continue by focusing on devices with medium-sized screens (notebooks and bigger tablets). Similar to the previous iteration, you will have to use CSS media queries to apply the style and layout changes. The most noticeable changes for this viewport size are:
176-
177-
178-
149+
We'll continue by focusing on devices with medium-sized screens (notebooks and bigger tablets). Similar to the previous iteration, you will have to use CSS media queries to apply the style and layout changes. The most noticeable changes in this viewport size are:
179150
- The **navbar** should now display all the menu links. The previously displayed menu icon should now be hidden.
180151
- The **sections** in the **main** part should now display the content in 2 columns: one column for the heading and text, and the other for the image.
181152
- The **section "Welcome to your new digital HQ"** should now have the buttons displayed horizontally as rows.
182153

183-
184-
185154
<br>
186155

187156
When done, your page should look like this: [Preview - Medium Screens](https://www.figma.com/proto/k77VYVA70WcPYRLvg4QmIf/LAB-CSS-Slack-Clone?node-id=49%3A2159&scaling=scale-down&page-id=68%3A2977&starting-point-node-id=49%3A2159&hide-ui=1)
188157

189-
190-
191158
<br>
192159

193160
Use the following page screenshot as the guide:
@@ -197,7 +164,6 @@ Use the following page screenshot as the guide:
197164
<img src="https://education-team-2020.s3.eu-west-1.amazonaws.com/web-dev/m1/lab-flexbox-slack/Slack+Home+Page+-+1024px.png" />
198165
<br/>
199166

200-
201167
[Back to top](#iteration-3--medium-screens-width--1024px-and-width--1440px)
202168
</details>
203169

@@ -225,21 +191,13 @@ You can inspect the page styles here:
225191
### BONUS: Iteration 4 | Large Screens (width > 1440px)
226192

227193
Last one! Some small changes and we are done! In this iteration we are targeting large-screen devices such as desktops and laptops:
228-
229-
230-
231194
- The **signup buttons** in the **header** should now be displayed horizontally, next to each other.
232-
233195
- Additionally, the image shown in the **header** should be centered and fully visible.
234196

235-
236-
237197
<br>
238198

239199
When done, your page should look like this: [Preview - Large Screens](https://www.figma.com/proto/k77VYVA70WcPYRLvg4QmIf/LAB-CSS-Slack-Clone?node-id=49%3A2489&scaling=scale-down&page-id=68%3A2978&starting-point-node-id=49%3A2489&hide-ui=1)
240200

241-
242-
243201
<br>
244202

245203
Use the following page screenshot as the guide:
@@ -249,8 +207,6 @@ Use the following page screenshot as the guide:
249207
<img src="https://education-team-2020.s3.eu-west-1.amazonaws.com/web-dev/m1/lab-flexbox-slack/Slack+Home+Page+-+1440px.png" />
250208
<br/>
251209

252-
253-
254210
[Back to top](#iteration-4--large-screens-width--1440px)
255211

256212
</details>
@@ -263,10 +219,223 @@ You can inspect the page styles here: [Figma file - Large Screens]()
263219
264220
-->
265221

222+
<br />
266223

267224

268-
<br />
269225

226+
Happy coding! :heart:
227+
228+
<br>
229+
230+
## FAQs
231+
232+
<br>
233+
234+
<details>
235+
<summary>I am stuck in the exercise and don't know how to solve the problem or where to start.</summary>
236+
<br>
237+
238+
If you are stuck in your code and don't know how to solve the problem or where to start, you should take a step back and try to form a clear question about the specific issue you are facing. This will help you narrow down the problem and come up with potential solutions.
239+
240+
241+
For example, is it a concept that you don't understand, or are you receiving an error message that you don't know how to fix? It is usually helpful to try to state the problem as clearly as possible, including any error messages you are receiving. This can help you communicate the issue to others and potentially get help from classmates or online resources.
242+
243+
244+
Once you have a clear understanding of the problem, you will be able to start working toward the solution.
245+
246+
[Back to top](#faqs)
247+
</details>
248+
249+
250+
251+
<details>
252+
<summary>How do I center align HTML text elements?</summary>
253+
<br>
254+
255+
To center align HTML *text elements*, you can use the `text-align` property and set it to `center`. This property can be applied to any *inline* or *block-level* element.
256+
257+
Here is an example of how you can use the `text-align` property to center align multiple text elements:
258+
259+
**HTML**
260+
261+
```html
262+
<div>
263+
<h2>This is a title</h2>
264+
265+
<p>This is some text in here</p>
266+
</div>
267+
```
268+
269+
**CSS**
270+
271+
```css
272+
/* CSS */
273+
274+
p {
275+
text-align: center; /* Center align all p elements */
276+
}
277+
278+
h2 {
279+
text-align: center; /* Center align all h2 elements */
280+
}
281+
```
282+
283+
This will center align all `p` and `h2` elements within the parent `div`.
284+
285+
For more information, check: [W3C: Centering Things](https://www.w3.org/Style/Examples/007/center.en.html)
286+
287+
[Back to top](#faqs)
288+
</details>
289+
290+
291+
292+
<details>
293+
<summary>How do I center align HTML block elements?</summary>
294+
<br>
295+
296+
To center align a block-level element, such as a `div`, `h1`, etc., you can use the `margin` property and set it to `auto`. This will center the element horizontally within its parent container.
297+
298+
Here is an example of how you can do this:
299+
300+
**HTML**
301+
302+
```html
303+
<section>
304+
<div>
305+
<p> Lorem ipsum dolor sit amet consectetur, adipisicing elit.</p>
306+
</div>
307+
</section>
308+
```
309+
310+
**CSS**
311+
312+
```css
313+
/* CSS */
314+
315+
div {
316+
width: 500px;
317+
margin: 0 auto;
318+
}
319+
```
320+
321+
This will set the `width` property of the `div` to 500 pixels and we set the left and right margins to be equal by using `margin: 0 auto;`.
322+
323+
[Back to top](#faqs)
324+
</details>
325+
326+
<details>
327+
<summary>How do I center align an HTML image element?</summary>
328+
<br>
329+
330+
There are a few ways you can center align an image element.
331+
332+
##### 1. Align an image using `text-align`
333+
334+
To center an image element in HTML, you can use the `text-align` property on the parent element, such as `div`. Example:
335+
336+
**HTML**
337+
338+
```html
339+
<div>
340+
<img src="https://placehold.co/300x150.png" />
341+
</div>
342+
```
343+
344+
**CSS**
345+
346+
```css
347+
div {
348+
text-align: center;
349+
}
350+
```
351+
352+
This will center align all the children elements within the `section` element, including the `img` element.
353+
354+
<br>
355+
356+
##### 2. Align an image as a block element
357+
358+
The other way is converting the image into a block element and using `margin: 0 auto`. Here is an example:
359+
360+
**HTML**
361+
362+
```html
363+
<section>
364+
<img src="https://placehold.co/300x150.png" />
365+
</section>
366+
```
367+
368+
**CSS**
270369

370+
```css
371+
img {
372+
display: block;
373+
margin: 0 auto;
374+
}
375+
```
376+
377+
This will center the image horizontally within the parent `section` element. The `display: block` property is used to make the image a *block-level* element, allowing the `margin: 0 auto` property to work. The `margin: 0 auto` property sets the left and right margins to be equal, centering the element within its parent container.
378+
379+
[Back to top](#faqs)
380+
</details>
381+
382+
<details>
383+
<summary>How can I change the header from having 1 column to having 2 columns?</summary>
384+
<br>
385+
386+
To change the header of an HTML page from having one column to having two columns using Flexbox, you should do the following in your CSS:
387+
388+
1. Use the `display` property and set it to `flex`.
389+
2. Add the `flex-direction` property and set it to `column` to arrange the elements in a column.
390+
3. Add the `justify-content` property to align the elements horizontally
391+
4. Use the `align-items` property to align them vertically.
392+
393+
```css
394+
header {
395+
display: flex;
396+
flex-direction: column; /* Arrange elements in a column */
397+
justify-content: space-between; /* Align horizontally */
398+
align-items: center; /* Align vertically */
399+
}
400+
```
401+
402+
To make the header responsive and change it to a two column layout on screens that are wider than 800 pixels, use a media query and set the `flex-direction` property to `row`:
403+
404+
```css
405+
@media (min-width: 800px) {
406+
header {
407+
flex-direction: row;
408+
}
409+
410+
/* Change the width of nested div elements */
411+
header > div {
412+
width: 50%;
413+
}
414+
}
415+
```
416+
417+
On smaller screens, the header will maintain a single column layout, but on screens larger than 800 pixels wide, it will change to a two column layout.
418+
419+
[Back to top](#faqs)
420+
</details>
421+
422+
<details>
423+
<summary>Why are my media query styles not displaying properly on my browser?</summary>
424+
<br>
425+
426+
When using media queries to create a responsive layout, it is recommended to start with the default styles for mobile (smaller) screens, and then use media queries at the end of your stylesheet to apply styles for each increasing viewport size.
427+
428+
429+
430+
There are a few possible reasons why your media query styles may not be properly displayed on your browser.
431+
432+
1. Check that you already have default styles for mobile screens, where applicable. These styles should be placed at the beginning of your stylesheet, before your media queries.
433+
2. Make sure you have placed your media queries at the end of your stylesheet after your regular styles. This is because media queries are applied after regular styles, so if you place them before your regular styles, they will be overridden.
434+
3. Make sure that you have the correct syntax in your media query. The correct syntax is `@media (expression) {...}`.
435+
4. Make sure that you are using the correct media query expression. For example, if you are trying to target screens that are wider than 800 pixels, you should use the `min-width` in your expression, like this: `@media (min-width: 800px) {...}.`
436+
437+
For more information on CSS media queries, check: [MDN: Beginner's guide to media queries](https://developer.mozilla.org/en-US/docs/Learn/CSS/CSS_layout/Media_queries)
438+
439+
[Back to top](#faqs)
440+
</details>
271441

272-
Happy coding! ❤️

0 commit comments

Comments
 (0)