0% found this document useful (0 votes)
58 views3 pages

HTML and CSS Webpage Assignment

hy

Uploaded by

makeh71663
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
58 views3 pages

HTML and CSS Webpage Assignment

hy

Uploaded by

makeh71663
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

ASSIGNMENT 2:

HTML and CSS Basics

Submission deadline : Tuesday 15th of October 2024

OBJECTIVE:

To assess your understanding of basic HTML tags, forms, tables, lists, and the fundamental
concepts of CSS for styling.

INSTRUCTIONS:

 Create a webpage that consists of three sections:


1. A profile information form using various HTML form elements.
2. A table to display a simple summary of data.
3. A formatted article using basic HTML tags and styled with CSS.
 Use HTML to structure the content and CSS for basic styling.

PART 1: PROFILE INFORMATION FORM

Create a form to collect user information. Use the following fields:

1. Full Name (input text)


2. Email Address (input email)
3. Password (input password)
4. Date of Birth (input date)
5. Gender (radio buttons: Male, Female, Other)
6. Hobbies (checkboxes: Reading, Traveling, Music, Sports)
7. Country (select dropdown with at least 4 options)
8. Profile Picture (file upload)
9. Short Bio (textarea)
10. Phone Number (input tel)
11. Favorite Color (input color)
12. Website URL (input url)

Include:

 A submit button
 A reset button

Requirements:

 Use appropriate HTML input types for each field.


 Include labels for each input field.
 Ensure the form is properly grouped using fieldset and legend.
PART 2: DATA SUMMARY TABLE
Create a table that summarizes user information:

Field Description Value


Full Name User's full name (Your Input)
Email Address User's email address (Your Input)
Date of Birth User's date of birth (Your Input)
Add at least 5 more rows to the table using data from the form (e.g., gender, hobbies, etc.).
 Use the <table>, <thead>, <tbody>, and <tfoot> tags.
 Apply basic CSS to style the table (e.g., borders, padding, alternating row colors).

PART 3: FORMATTED ARTICLE WITH LISTS


Write a short article on "The Importance of Learning Web Development."

Structure the article with:

 A Heading (<h1>)
 A Subheading (<h2>)
 At least one paragraph (<p>) describing the topic
 An unordered list (<ul>) of benefits (e.g., increased job opportunities, creativity,
problem-solving)
 An ordered list (<ol>) of steps to start learning web development (e.g., 1. Learn HTML,
2. Practice CSS, 3. Explore JavaScript, etc.)
 An image (<img>) relevant to web development with proper alt text
 A link (<a>) to an external resource on web development

Part 4: Basic CSS Styling

Add basic styling to your webpage using CSS:

1. Set the font style for the whole page to Arial.


2. Center-align the main heading (<h1>).
3. Apply a background color to the form section.
4. Set the width of the form to 500px and add padding and margins.
5. Add borders to the table and style the header row differently.
6. Add a hover effect to the link in the article (e.g., change color on hover).
7. Use CSS Flexbox or CSS Grid to create a responsive layout.
8. Add any other custom styling to enhance the visual appearance of the page.

Submission Guidelines:

 Submit the HTML file and an external CSS file.


 Ensure your code is well-formatted and includes comments where necessary.
Sample Output of The Webpage
(Students can change styles or add some more feature if they want)

Common questions

Powered by AI

Hover effects can be implemented using the ':hover' pseudo-class in CSS. They improve web interactions by visually indicating interactivity, such as changing a link's color when a mouse pointer is over it. This is achieved by defining a different style for the link when the ':hover' state is triggered, allowing users to intuitively understand which elements are clickable . For example, changing the link's color on hover not only enhances the visual appeal but also provides a visual cue that encourages user engagement with the content .

CSS Flexbox and Grid are powerful techniques for creating responsive layouts. Flexbox provides a one-dimensional layout model, ideal for arranging items in a single direction (row or column), and is great for aligning elements and distributing space within a container . CSS Grid offers a two-dimensional layout system, allowing for complex layouts that are both responsive and maintain structural integrity across different screen sizes. These methods help in making a website adaptable to various devices, ensuring usability and aesthetics without necessitating separate designs for each device size .

Essential HTML tags for structuring a web form include the <form> tag to define the form itself and the <input> tag for user input fields such as text, email, password, date, and URL. Each input field needs to be paired with a corresponding <label> element for accessibility purposes . You can use a <fieldset> to group related fields and a <legend> to provide a title for the group. For example, grouping personal information like 'Full Name', 'Email Address', and 'Date of Birth' can be done within a <fieldset> to ensure semantic grouping within the form .

Requiring students to submit well-formatted HTML and CSS code with comments cultivates several educational benefits. It encourages clarity and organization, making code easier to read and maintain, which is critical for collaboration in professional settings . Comments enhance understanding by explaining complex logic or important sections, aiding both the author and future reviewers in deciphering the code's intent. However, challenges include the potential for students to over-comment, leading to clutter, or mis-comment, providing misleading information, which requires careful monitoring in teaching .

Basic CSS can enhance a table's appearance by adding properties like borders, padding, and alternating row colors. Borders can be added using the 'border' property on <table>, <th>, and <td> elements to clearly define table cells. Padding improves readability by adding space inside table cells via the 'padding' property, ensuring text doesn't touch the edges . Alternating row colors using ':nth-child()' pseudo-classes improve readability by visually distinguishing adjacent rows. This makes it easier for users to follow information across the table visually .

Key considerations for implementing form field inputs include using the correct input type attributes (e.g., 'email' for email addresses, 'date' for dates) which provide logical and user-friendly input methods with appropriate keyboard layouts for mobile users . Accessibility is enhanced by associating inputs with labels, using 'for' attributes with the corresponding input 'id', and grouping related fields with <fieldset> and <legend> elements to assist screen readers. Usability improves with well-organized elements, placeholder text for guidance, and validation attributes to prevent user errors . This comprehensive approach ensures that forms are accessible by all users, including those using assistive technologies .

A complete form for collecting user profile information should include text input fields (for full name and email), a password field, a date selector, radio buttons for gender, checkboxes for hobbies, a dropdown select for country, and file upload for profile picture, among others . CSS enhances the user experience by ensuring aesthetic consistency and user-friendly interfaces through styling form elements—setting widths, background colors, and margins—and enhancing accessibility with contrast and padding adjustments. Using CSS to center-align elements and apply responsive design principles further improves usability across devices .

Learning web development offers several benefits, such as increased job opportunities, fostering creativity, and enhancing problem-solving skills. The structured article lists these benefits in an unordered list (<ul>), making it easy to identify each point. Initial steps to start include learning HTML, practicing CSS, and exploring JavaScript, which are organized in an ordered list (<ol>). This structured approach not only highlights the compelling reasons to pursue web development but also offers a clear roadmap for beginners, indicating a comprehensive strategy for starting in the field .

Using CSS Grid to create responsive layouts significantly enhances the maintainability and scalability of web design projects by allowing for complex yet manageable grid-based layouts, which can be easily adjusted with minimal code changes . Grid's two-dimensional capabilities mean that designers can control layout dynamics without relying on verbose HTML structures, leading to cleaner code that is easier to troubleshoot and modify. This is crucial in scaling as project complexity grows, enabling consistent layouts across a multitude of screen sizes and devices, thus optimizing development workflows and future-proofing designs .

Integrating multimedia elements like images and hyperlinks significantly enhances user engagement and experience by breaking up text, providing visual illustration, and offering further resources. An image with appropriate alt text adds visual appeal and context to a web development article . Hyperlinks extend the content's informational value by directing users to additional pertinent resources, complementing the narrative and supporting the article's claims . These elements should be contextually relevant and enhance, rather than distract from, the main content, providing a richer, more versatile reading experience .

You might also like