CS Grade 6-8

CS: HTML and CSS Basics

Build simple web pages with structure and style

View Answer Key
Name:
Date:
Score: / 12

Build simple web pages with structure and style

CS - Grade 6-8

Instructions: Read each problem carefully. Write clear answers and include code when asked. Use correct HTML and CSS syntax.
  1. 1
    A split diagram showing a plain webpage structure beside a styled version of the same page.

    Explain the difference between HTML and CSS in a web page.

  2. 2

    Write the HTML for a level 1 heading that says My Favorite Website.

  3. 3

    Write the HTML for a paragraph that says I am learning to build web pages.

  4. 4
    A browser link being clicked and leading to another webpage.

    Look at this HTML: <a href="https://www.example.com">Visit Example</a>. Explain what the href attribute does.

  5. 5

    Write the HTML for an image with the file name cat.png and the alt text A gray cat sitting.

  6. 6

    Write a CSS rule that makes all paragraph text blue.

  7. 7

    In the CSS rule h2 { font-size: 24px; }, identify the selector, property, and value.

  8. 8

    Write a CSS rule that gives the body of a page a light gray background color.

  9. 9

    A page has this HTML: <p class="warning">Save your work often.</p>. Write a CSS rule that makes only elements with the warning class red.

  10. 10

    Fix the HTML error in this line: <h1>Welcome to My Page<h1>

  11. 11
    A screen reader helping a person understand an image description.

    Explain why alt text is important for images on a web page.

  12. 12
    A nested webpage structure with a top information section and a larger visible content section.

    Write a short HTML page structure that includes html, head, title, and body tags. The title should be My Page and the body should include one paragraph that says Hello, web.

LivePhysics™.com CS - Grade 6-8

More CS Worksheets

See all CS worksheets

More Grade 6-8 Worksheets

See all Grade 6-8 worksheets