Simon Yu

Introduction of CSS

  1. What does CSS stand for?
    • Cascading Style Sheet.

  2. What does CSS achieve in web pages?
    • The style and layout information of the web pages.

  3. What are the benefits of using CSS in web pages?
    • CSS can quickly and easily restyle any element.

  4. How to import a Style Sheet from within HTML?
    • By using the HTML <link> tag, like <link rel='stylesheet' type='text/css' href='style.css' />

  5. Why is it a better way to use IDs?
    • For setting the style of a specific element.

  6. Give an example to use ID?
    • <div id='iblue'>Hello there</div>
      #iblue { font-style:italic; color:blue; }

  7. How do you use classes?
    • For setting the styles of multiple elements.
      <div class='iblue'>Hello there</div>
      .iblue { font-style:italic; color:blue; }

  8. What is the difference between ID and Class?
    • ID is For setting the style of a specific element while class is For setting the style of a specific element.

  9. What are the symbols for ID and Class?
    • IDs use a # symbol while class statement use a . symbol.

  10. What is a CSS rule?
    • A statement or series of statements that tells the web browser how to render a certain element or elements on the page.

  11. What is a selector?
    • The element to which the rules will be applied.

  12. What is a semicolon?
    • Semicolons are used to separate multiple CSS statements on the same line.

  13. How can you use multiple assignments?
    • We can concatenate them on the same line, place them one per line, or space them out a little more.

  14. Why is it important to use comments?
    • Comments are explanatory statements that help anyone reading and understanding it's source code.

  15. What is the symbol for comments?
    • /* ... */

  16. What is a default style?
    • Default styles are created as a fallback for when a web page doesn't have any style defined.

  17. What is a user style?
    • User styles are created by users and they will override any default styles.

  18. What is the external style sheet?
    • External style sheets allow user to use one style sheet on multiple web pages and they will override any default styles.

  19. What is the internal style?
    • Internal style can be used to override the styling in any external style sheets loaded in at the same time.

  20. What is the inline style?
    • Inline styles are where you assign a property to an element.

  21. What is a type selector?
    • The type selector specifies the HTML element to style, such as <p> or <i>.

  22. What is a descendant selector?
    • The descendant selector applies styles to elements that are contained within other elements.

  23. What is a child selector?
    • The child selector selects only those elements that are direct children of another element.

  24. What is a ID selector?
    • The ID selector styles the element with the specified id.

  25. What is a class selector?
    • The class selector styles all elements with the specified class.