Skip to content

Instantly share code, notes, and snippets.

@scabbiaza
Last active February 12, 2018 10:40
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save scabbiaza/d8f7834b1ddfe9ddac3bd345135720cf to your computer and use it in GitHub Desktop.
Save scabbiaza/d8f7834b1ddfe9ddac3bd345135720cf to your computer and use it in GitHub Desktop.
CSS interview questions
  1. Difference between px, em, rem
<style>
  html, body {
    font-size: 10px;
  }
  div {
    font-size: 15px;
  }
  div a {
    font-size: 0.5em;
  }
  div span {
    font-size: 0.5rem;
  }
</style>
<body>
  <div>
    <a>what is my font size?</a>
    <span>what is my font size?</span>
  </div>
</body>
  1. Write a css selector for links without href attribute

  2. How to center a block horizontally and vertically?

  3. Responsive vs Adaptive vs Separate Mobile Site. Difference? Pro and cons?

  4. On the screen with 320px width resolution, will the image be loaded?

<style>
  body {
    background: url("https://farm5.staticflickr.com/4273/34312689953_7a4b3487c3_h.jpg");
  }
  @media screen and (max-width: 480px) {
    body {
      background: green;
    }
  }
</style>
<body>
</body>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment