Web Authoring Practical Notes for IGCSE ICT 0417
Each section includes hands-on examples to solidify understanding of HTML and CSS fundamentals.
Table of Contents
- Introduction to Web Authoring
- HTML Basics
- 2.1 Structure of an HTML Document
- 2.2 Text Formatting Tags
- 2.3 Lists
- 2.4 Hyperlinks
- 2.5 Images
- CSS Basics
- 3.1 Inline, Internal, and External CSS
- 3.2 Basic CSS Properties
- 3.3 CSS Selectors
- Page Layout and Structure
- 4.1 Divisions (
<div>
) - 4.2 Page Layout Techniques
- 4.1 Divisions (
- Practical Example: Creating a Basic Web Page
- Saving and Viewing Web Pages
- Validation and Debugging
- Summary and Tips
1. Introduction to Web Authoring
Web authoring involves creating and designing websites. The IGCSE ICT 0417 syllabus requires a basic understanding of HTML (HyperText Markup Language) and CSS (Cascading Style Sheets) to create simple web pages. This guide provides practical examples with solutions and explanations to help you build a functional website.
2. HTML Basics
2.1 Structure of an HTML Document
The basic HTML structure defines the layout of a web page.
Example: Creating the Page Structure
Expected GUI Output:
When opened in a browser, you’ll see a header that says "Welcome to My Website" and a paragraph below it saying "This is a simple HTML page."
2.2 Text Formatting Tags
Bold and Italics
Expected GUI Output:
The words "Bold Text" will appear in bold, and "Italic Text" will appear in italics.
2.3 Lists
Example: Creating an Unordered and Ordered List
Expected GUI Output:
An unordered (bullet) list with "HTML" and "CSS" and an ordered (numbered) list with "Introduction to HTML" and "CSS Basics."
2.4 Hyperlinks
Example: Adding a Link
Expected GUI Output:
A clickable link "Visit Example" opens in a new tab.
2.5 Images
Example: Adding an Image
Expected GUI Output:
An image with a width of 200 pixels and height of 100 pixels, displayed with an alt description for accessibility.
3. CSS Basics
3.1 Inline, Internal, and External CSS
Example of Inline CSS
Expected GUI Output:
The text "This is red text." will appear in red.
3.2 Basic CSS Properties
Example of Using Colors, Fonts, and Alignment in CSS
Expected GUI Output:
The <h1>
heading will appear in blue, centered, and in Arial font.
3.3 CSS Selectors
- Class Selector
Expected GUI Output:
The paragraph "Highlighted Text" will appear with a yellow background.
4. Page Layout and Structure
4.1 Divisions (<div>
)
Example of Divisions and Background Color
Expected GUI Output:
A light grey box containing the header "About Me" and a short paragraph below it.
4.2 Page Layout Techniques
Box Model and Margins
When applied to a <div>
with the class "container," this code will add spacing around and inside the div, and a solid black border will appear around it.
5. Practical Example: Creating a Basic Web Page
This example combines HTML and CSS to create a complete webpage.
HTML File: index.html
CSS File: styles.css
Expected GUI Output:
- A webpage with a dark header displaying "Welcome to My Portfolio."
- A centered introduction section, a profile image, and a footer with contact information.
6. Saving and Viewing Web Pages
To view the web page:
- Save the HTML file as
index.html
and the CSS file asstyles.css
in the same folder. - Open
index.html
in a web browser to see the formatted page.
7. Validation and Debugging
Use the W3C Validator to check HTML syntax errors:
- Go to the W3C Validator, upload
index.html
, and check for errors. - For CSS, use the CSS Validator to ensure styles are correct.
8. Summary and Tips
- Use Consistent Naming: Always name files and classes consistently.
- Comment Your Code: Adding comments helps in debugging and organizing code.
- Experiment and Practice: Try creating different layouts and styling options to strengthen your understanding.
Understanding the Three Web Development Layers:
Content Layer (HTML):
- This layer involves the structure and content of the webpage. It is created using HTML (HyperText Markup Language).
- Example of HTML Structure:
Presentation Layer (CSS):
- This layer controls the visual appearance of the content. It is handled using CSS (Cascading Style Sheets).
- Example of CSS Code:
Behaviour Layer (JavaScript):
- This layer allows for interactive features and dynamic content using scripting languages like JavaScript.
21.2 Create a Web Page
Creating the Content Layer of a Web Page:
HTML Structure
Head Section:
- Page Title: Displayed in the browser's title bar.
- External Stylesheets: Linked to provide styling.
- Meta Tags: Include charset, description, keywords, author, and viewport settings.
Example of a Head Section:
Body Section:
- Include headings, paragraphs, tables, and images.
Example of Body Section:
Exercise 1: Create a Basic Web Page
- Task: Create a basic HTML web page with the following elements:
- A title in the head section.
- A header (
<h1>
) in the body section. - A paragraph with some text.
- A table with two columns (Name and Age) and two rows of data.
GUI Solution:
- Open a text editor (e.g., Notepad).
- Type the following code:
- Save the file as
index.html
. - Open
index.html
in a web browser.
21.3 Use Stylesheets
Creating the Presentation Layer of a Web Page:
Using CSS:
- Style the elements of the webpage using CSS in an external file or inline styles.
Example of External CSS:
Attaching CSS:
- Use the
<link>
tag in the head section to attach the CSS file.
- Use the
Exercise 2: Apply Styles to Your Web Page
- Task: Modify the web page created in Exercise 1 to include an external stylesheet that changes the background color and font styles.
GUI Solution:
- Create a new file named
styles.css
with the following CSS: - Save the file in the same directory as
index.html
. - Modify the
<head>
section ofindex.html
to include the link to the stylesheet: - Refresh the browser to see the changes.
Additional Concepts
- Tables: Used to structure content. Remember to define headers, rows, and data cells.
- Images: Always provide alternative text for accessibility.
- Hyperlinks: Create links to other pages or resources, ensuring relative paths are used for local files.
Example of Hyperlink:
- Bookmarks: Use the
id
attribute to create internal links.
Example of a Bookmark:
Final Exercise
Exercise 3: Create a Complete Web Page
- Task: Create a complete web page that includes:
- A title.
- A header.
- A paragraph.
- A table with at least three rows.
- A list (ordered or unordered).
- An image.
- A hyperlink to another page (create a dummy
contact.html
). - Internal bookmark links.
GUI Solution:
Follow the previous instructions to create the HTML structure. Here’s an example solution:
Save your files, and open the HTML in a browser to see the complete web page in action.
0 Comments