Skip to content

Latest commit

 

History

History
38 lines (26 loc) · 857 Bytes

basic-css.md

File metadata and controls

38 lines (26 loc) · 857 Bytes

Basic CSS

Questions

  1. What is the difference between block and inline elements?

  2. Which selector is more specific, a tag selector or class selector?

  3. What is the box model?

  4. What's the difference between margin and padding?

Exercises

  1. Write a CSS rule to make all the text of all paragraphs on a page red.

  2. Write a CSS rule to turn the background color of the link with the .button class blue on hover:

<a href="#" class="button">Learn more</a>
  1. Write a CSS rule to give all list items in the unordered list with the list-primary ID a font size of 30 pixels, but not the ones in the second unordered list.
<ul id="list-primary">
  <li>Home</li>
  <li>About</li>
  <li>Contact</li>
</ul>

<ul>
  <li>John</li>
  <li>Paul</li>
  <li>George</li>
  <li>Ringo</li>
</ul>