Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Question about exercise 10E #52

Open
eminahadzicc opened this issue Jul 11, 2023 · 3 comments
Open

Question about exercise 10E #52

eminahadzicc opened this issue Jul 11, 2023 · 3 comments

Comments

@eminahadzicc
Copy link

So, in exercise 10D the drawing looks like 4 vertical divs and 2 horizontal divs (in the third vertical one).
When I finished exercise 10E, that's the picture I was following to build the html code. After finishing I saw that in the solution, the only divs that are used are 1 for the 'whole' block with vertically everything in it, and 1 for the horizontal blocks. I'll attach a picture of what my code looked like and under it the code from the solution.
I did succeed in making it look like it was supposed to, but I totally did too much and I can't figure out why it was not needed to add all the divs?
Especially after making the divs for the youtube page, where we also used 2 divs for the 2 vertical parts.

Scherm­afbeelding 2023-07-11 om 19 15 01

Scherm­afbeelding 2023-07-11 om 19 11 17

Scherm­afbeelding 2023-07-11 om 19 19 34

I hope I explained it well, if not please let me know so I can clarify :-) Thanks in advance!

@StudioProgrammar
Copy link

StudioProgrammar commented Jul 12, 2023

Hi! The reason it wasn't necessary to have the two vertical divs is due to the fact that you could just use margin-left on the elements rather than containers that holds the elements. Remember, a div is a container that is used to affect elements within it in a certain way. It also can be used to separate whole groups of elements from other groups.

In this lesson, after styling both the icon and the subtitle, the only thing left was to create space between the two. That can easily be done with margin-left. Your method would still work except you would have to use the margin of the containers rather than the actual elements since they are inside. I guess what I'm saying is that you would have less work if you just directly affected the elements rather than put them into containers.

Note: I keep mentioning margin-left because that's what I did (I applied it to the subtitle) but you could also use margin-right but apply it to the icon.

@Mountainboy2
Copy link

Mountainboy2 commented Jul 13, 2023 via email

@eminahadzicc
Copy link
Author

Hi! The reason it wasn't necessary to have the two vertical divs is due to the fact that you could just use margin-left on the elements rather than containers that holds the elements. Remember, a div is a container that is used to affect elements within it in a certain way. It also can be used to separate whole groups of elements from other groups.

In this lesson, after styling both the icon and the subtitle, the only thing left was to create space between the two. That can easily be done with margin-left. Your method would still work except you would have to use the margin of the containers rather than the actual elements since they are inside. I guess what I'm saying is that you would have less work if you just directly affected the elements rather than put them into containers.

Note: I keep mentioning margin-left because that's what I did (I applied it to the subtitle) but you could also use margin-right but apply it to the icon.

Ah, I understand, makes sense. Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants