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

Q69 of front end development quiz too vague to have a correct answer #6923

Open
2 of 5 tasks
mingfengwan opened this issue Nov 25, 2023 · 2 comments
Open
2 of 5 tasks
Labels
good first issue Good for newcomers help wanted Extra attention is needed

Comments

@mingfengwan
Copy link

I'm submitting an ISSUE: please check one with "x"

  • Documentation issue

Q69. The CSS box model describes how the parts of a CSS box fit together and the size of the box. What is the actual width of the following box's visible part under the standard box model?

box {
  width: 200px;
  padding: 10px;
  margin: 0 15px;
  border: 2px 5px;
}
  • 230px
  • 220px
  • 200px
  • 260px

The question is way too ambiguous. It did not specify whether the box border is considered to be part of the "visible part of the box".

@Ebazhanov Ebazhanov added help wanted Extra attention is needed good first issue Good for newcomers labels Nov 26, 2023
@dakshithadissanayaka
Copy link
Contributor

dakshithadissanayaka commented Nov 27, 2023

The total width of the box can be calculated as follows:

Total width

width
+
padding-left
+
padding-right
+
border-left
+
border-right
+
margin-left
+
margin-right
Total width=width+padding-left+padding-right+border-left+border-right+margin-left+margin-right

Substitute the given values:
Total width

200
px
+
10
px
+
10
px
+
2
px
+
5
px
+
0
px
+
15
px
Total width=200px+10px+10px+2px+5px+0px+15px

Calculating this gives:
Total width

242
px
Total width=242px

Therefore, the correct answer is not among the options provided. The closest option is 260px, but the exact total width is 242px.

❤️

@mingfengwan
Copy link
Author

The total width of the box can be calculated as follows:

Total width

width + padding-left + padding-right + border-left + border-right + margin-left + margin-right Total width=width+padding-left+padding-right+border-left+border-right+margin-left+margin-right

Substitute the given values:

Total width
200 px + 10 px + 10 px + 2 px + 5 px + 0 px + 15 px Total width=200px+10px+10px+2px+5px+0px+15px

Calculating this gives:

Total width
242 px Total width=242px

Therefore, the correct answer is not among the options provided. The closest option is 260px, but the exact total width is 242px.

❤️

The issue is that no clear definition for "visible part" exists. I would argue that the "visible part" doesn't include margins, but may or may not include borders.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

3 participants