Skip to content

Instantly share code, notes, and snippets.

@yowainwright
Last active November 29, 2017 21:12
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save yowainwright/054983fa6c51fffa16de5eceb34abf94 to your computer and use it in GitHub Desktop.
Save yowainwright/054983fa6c51fffa16de5eceb34abf94 to your computer and use it in GitHub Desktop.
General CSS Front-end Interview Questions

Listed below are a few CSS questions for discussing CSS in an interview setting. Each answer should be a short sentence and be answerable over the phone. The question format is more to spur conversation rather than to define merit.

What is difference between the CSS property values inherit and initial? What is an example of when this is signicant?

the value inherit takes the value of it's parent the value initial takes the browsers initial value of that html element inherit could be used for links (<a>) within a title element (<h1—6>) to inherit colors, etc initial could be used to override a normalized style for optimal browser specific css.

What is reason to avoid using a *clear-fix? Why might not using a clear-fix be beneficial?

* A clear-fix is used to contain content within a parent element

set the value of overflow to hidden If access to psuedo elements :after, :before, is needed

What is defining a specific unit of measure (px, em, rem, pt) for line-height generally best?

By using a number relative (ie 1) to a font-size, line-height remain relative to the font rather than defining display. Combining the 2, font spacing and display spacing can be problematic.

What are some pluses and minuses to using a CSS framework or writing CSS from scratch?

CSS frameworks provide support from a large community Vanilla CSS defines styling relative to a specific product

CSS frameworks can lead to bloat that exists within the HTML Vanilla CSS are subject to browser updates and changes without support from a large community

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment