Practice the basic purpose, syntax, and use of HTML elements and CSS rules for creating simple web pages.
Read each problem carefully. Write clear answers and include code when asked. Use correct HTML and CSS syntax.
Build simple web pages with structure and style
CS - Grade 6-8
- 1
Explain the difference between HTML and CSS in a web page.
- 2
Write the HTML for a level 1 heading that says My Favorite Website.
- 3
Write the HTML for a paragraph that says I am learning to build web pages.
- 4
Look at this HTML: <a href="https://www.example.com">Visit Example</a>. Explain what the href attribute does.
- 5
Write the HTML for an image with the file name cat.png and the alt text A gray cat sitting.
- 6
Write a CSS rule that makes all paragraph text blue.
- 7
In the CSS rule h2 { font-size: 24px; }, identify the selector, property, and value.
- 8
Write a CSS rule that gives the body of a page a light gray background color.
- 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
Fix the HTML error in this line: <h1>Welcome to My Page<h1>
- 11
Explain why alt text is important for images on a web page.
- 12
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.