By the end of this chapter, you will be able to:
Mastering these skills will help you build strong foundations in web design, making your websites functional and visually appealing.
Web design is a critical skill for computer science professionals in Kenya, enabling the creation of effective and user-friendly websites that support business, education, government, and other sectors. Understanding HTML, the foundational language of the web, is essential for structuring content and ensuring accessibility across devices. This chapter focuses on basic HTML elements, equipping learners with the skills to build simple yet semantically correct web pages relevant to local contexts such as online banking platforms, university portals, and county government websites.
Basic HTML elements form the building blocks of any web document. Their proper use ensures content is well-organized, readable, and accessible to users and search engines alike. For Kenyan developers working on projects like e-commerce sites for retail businesses or informational pages for healthcare providers, mastering these elements is fundamental.
<p> ElementThe <p> tag is used to define paragraphs in HTML, providing structure and readability to textual content on web pages. It is essential for separating blocks of text, which improves user experience and accessibility, especially for screen readers used in institutions such as county hospitals or educational websites.
<p> Element<p> element divides content into manageable paragraphs, helping users digest information in chunks rather than a continuous wall of text.<p> elements, enhancing readability without additional CSS.<p> tag, making content more navigable for visually impaired users.<p><p> tags rather than relying on line breaks or spacing.<div> or <h1> inside <p> tags, as this is invalid HTML.<p> for any natural paragraph, including introductions, descriptions, and explanations.<p> for semantic structure rather than purely visual formatting.lang attribute on <p> to specify the language for accessibility tools.<p><p> tags to create spacing, instead of CSS margins or padding, leads to inconsistent layouts.<p> tags and placing text directly inside <body> can cause accessibility and SEO issues.<p> results in rendering problems.<p> tags for one logical paragraph fragments content unnecessarily.<p> tags can cause browsers to auto-correct in unpredictable ways, affecting the page layout.In a SACCO website, paragraphs created with <p> tags can clearly separate information about loan products, membership criteria, and contact details, enhancing user navigation. Similarly, university online portals use <p> tags to present course descriptions and admission guidelines in a readable format.
<br> ElementThe <br> tag inserts a line break within text, forcing content to continue on the next line without starting a new paragraph. It is an inline element used for minor formatting adjustments, particularly where a new line is needed but the semantic grouping remains the same.
<br> Element<br><br> sparingly, only when a new line is needed but the content remains part of the same paragraph.<br> to create vertical space; CSS margins or padding are more appropriate.<br> can separate lines cleanly.<br> helps maintain semantic clarity.<br> to replace paragraph breaks or headings.<br><br> for layout purposes makes maintenance harder and reduces responsiveness on different devices.<br> and <p> for similar purposes can confuse document structure.<br> tags can inflate HTML file size, affecting page load times.<br> with proper semantic tags reduces SEO effectiveness.A county government website listing office addresses might use <br> to separate street, city, and postal code lines within a single contact block. Similarly, a retail business’s product descriptions could use <br> to break lines within specifications or usage instructions without starting new paragraphs.
<h1> ElementThe <h1> tag defines the highest-level heading in an HTML document, playing a key role in content hierarchy, SEO, and accessibility. In Kenyan professional web projects, such as university portals or banking websites, proper use of <h1> enhances user orientation and search engine ranking.
<h1> Element<h1> to understand the main subject, influencing ranking.<h1> to provide quick navigation to main content.<h1> per page to represent the main heading; additional headings should use <h2> to <h6>.<h1> near the top of the HTML document within the <body>.<h1> is concise but descriptive of the page purpose.<h1> purely for styling; semantic meaning is paramount.<h1> with ARIA landmarks for enhanced accessibility on complex sites like county government portals.<h1><h1> tags on a single page dilutes semantic importance and confuses assistive technologies.<h1> markup harms SEO and accessibility.<h1> reduces clarity of page structure to search engines and users.<h1> too far down the document body can impair screen reader navigation.<h1> tags reduces search relevance and user understanding.A banking website’s homepage might use <h1> to display the institution’s name and tagline, signaling the primary focus of the page. In an educational institution’s site, <h1> could highlight the university name or department, guiding prospective students and staff to relevant information quickly.
<p> element in structuring web content and how it benefits users in Kenyan government websites. (10 marks)<br> element and discuss why overusing it can be problematic, with examples from Kenyan retail websites. (10 marks)<h1> element for SEO and accessibility, including five guidelines for its proper use in Kenyan educational portals. (10 marks)Create a free account to open more of this chapter.
Free: practical guides, quick cards, workplace scenarios and more.
Create a free accountThis chapter explored fundamental HTML elements essential for structuring web content, focusing on the paragraph element
, the line break
, and the primary heading
<p> element in an HTML document? (2 marks) <p> HTML element and describe how it is used in structuring content on a web page. (4 marks) <br> and <p> elements in HTML and provide an example of when to use each. (4 marks) Type: Individual
| Tools & Equipment | Materials |
|---|---|
| Functional computer with text editor | Plain paper for notes |
| Internet access for reference |
| S/N | Item | Quantity |
|---|---|---|
| 1 | Functional computer with text editor | 1 Pc per Candidate |
| 2 | Internet access for reference | 1 Pc per Candidate |
| 3 | Plain paper for notes | 1 Sheet per Candidate |
| Items to be Evaluated | Marks Available | Marks Obtained | Comments |
|---|---|---|---|
| TASK 1: Create HTML document with paragraphs and line breaks | |||
| Launched the text editor and created a new HTML file named index.html (Award 2 marks for launching and creating file, zero otherwise) | 2 | ||
| Added the basic HTML structure including <!DOCTYPE html>, <html>, <head> with title, and <body> tags (Award 1 mark for each correct element or zero) | 4 | ||
| Created three distinct paragraph elements using <p> tags (Award 2 marks for each correctly coded paragraph or zero) | 6 | ||
| Inserted at least two <br> tags within paragraphs to create line breaks as specified (Award 2 marks for each paragraph correctly using <br> tags or zero) | 4 | ||
| Saved the HTML file correctly and previewed in a browser without errors (Award 2 marks for correctly saved and error-free preview) | 2 | ||
| Sub-Total | 18 | ||
| PRODUCT CHECKLIST | |||
| HTML file contains three paragraphs with correct <p> tags and line breaks using <br> tags as required (Award up to 10 marks based on correctness and structure) | 10 | ||
| HTML document validates with no syntax errors (Award 4 marks for valid HTML code) | 4 | ||
| File size does not exceed 5KB (Award 3 marks if file size is within limit, zero otherwise) | 3 | ||
| Sub-Total | 17 | ||
| GRAND TOTAL | 35 | ||
Type: Individual
| Tools & Equipment | Materials |
|---|---|
| Functional computer with text editor installed | Plain A4 paper |
| S/N | Item | Quantity |
|---|---|---|
| 1 | Functional computer with text editor installed | 1 Pc per Candidate |
| 2 | Plain A4 paper | 1 Sheet per Candidate |
| Items to be Evaluated | Marks Available | Marks Obtained | Comments |
|---|---|---|---|
| TASK 1: Use heading elements to structure an HTML document | |||
| Launched the text editor and created the HTML file 'company_homepage.html' (Award 2 marks for launching editor and creating file or zero) | 2 | ||
| Added an H1 heading representing the main page title (Award 3 marks for correct use of single H1 or zero) | 3 | ||
| Added at least two H2 headings to represent main sections (Award 2 marks each for two correct H2 headings or zero) | 4 | ||
| Added at least three headings using H3 or H4 to represent subsections (Award 2 marks each for three correct H3/H4 headings or zero) | 6 | ||
| Ensured headings follow correct hierarchical order (no skipping levels) (Award 3 marks for correct hierarchical order or zero) | 3 | ||
| Used semantic and meaningful text content in each heading element (Award 2 marks for meaningful headings or zero) | 2 | ||
| Sub-Total | 20 | ||
| PRODUCT CHECKLIST | |||
| Final HTML document 'company_homepage.html' contains at least 7 headings with correct H1 to H4 tags, proper nesting, and meaningful text content (Award up to 10 marks for completeness, correctness, and semantic structure) | 10 | ||
| Sub-Total | 10 | ||
| GRAND TOTAL | 30 | ||
At the start of this chapter we promised you would be able to:
Tick each one you can genuinely do.
So, are you there yet?
You're competent when you can confidently do 50% or more of what this chapter promised.
Sign in to record how you're doing.