Skip to content

navya-semantic-interactive-tags#524

Open
navya-1417 wants to merge 1 commit intoaptyInc:mainfrom
navya-1417:navya-structure-basic-tag
Open

navya-semantic-interactive-tags#524
navya-1417 wants to merge 1 commit intoaptyInc:mainfrom
navya-1417:navya-structure-basic-tag

Conversation

@navya-1417
Copy link
Copy Markdown

@navya-1417 navya-1417 commented Sep 30, 2025

Terms and Conditions

  • [
  • ] I Accept losing points if my PR does not follow the best practices mentioned below, which will impact my overall performance in training

HTML Best Practices

  • File Naming Convention:

  • Follow consistent and descriptive naming (e.g., dashboard.html, user-profile.html).

  • Use lowercase letters and hyphens instead of spaces.

  • Page Title:

  • Ensure the <title> tag is descriptive and aligns with the page content.

  • Include meaningful keywords for SEO if applicable.

  • Semantic Markup:

  • Use appropriate tags like <header>, <footer>, <section>, <article> for better readability and accessibility.

  • Accessibility Standards:

  • Ensure the use of alt attributes for images and proper labels for form elements.

  • Use ARIA roles where necessary.

  • Validation:

  • Ensure the code passes HTML validation tools without errors or warnings.

  • Structure and Indentation:

  • Maintain consistent indentation and proper nesting of tags.

  • Attributes:

  • Ensure all required attributes (e.g., src, href, type, etc.) are correctly used and not left empty.

CSS Best Practices

  • File Organization:

  • Use modular CSS files if applicable (e.g., base.css, layout.css, theme.css).

  • Avoid inline styles unless absolutely necessary.

  • Naming Conventions:

  • Use meaningful class names following BEM or other conventions (e.g., block__element--modifier).

  • Code Reusability:

  • Avoid duplicate code; use classes or mixins for shared styles.

  • Responsive Design:

  • Ensure proper usage of media queries for mobile, tablet, and desktop views.

  • Performance Optimization:

  • Minimize the use of unnecessary CSS selectors.

  • Avoid overly specific selectors and ensure selectors are not overly deep (e.g., avoid #id .class1 .class2 p).

  • Consistency:

  • Follow consistent spacing, indentation, and use of units (rem/em vs. px).

  • Maintain a single coding style (e.g., always use double or single quotes consistently).

Javascript Best Practices

  • File Organization:

  • Ensure scripts are modular and logically separated into files if needed.

  • Avoid mixing inline JavaScript with HTML.

  • Logic Optimization:

  • Check for redundancy and ensure the code is optimized for performance.

  • Avoid unnecessary API calls or DOM manipulations.

  • Solution Approach:

  • Confirm that the code solves the given problem efficiently.

  • Consider scalability for future enhancements.

  • Readability:

  • Use clear variable and function names.

  • Add comments for complex logic or algorithms.

  • Error Handling:

  • Ensure proper error handling for API calls or user input validation.

  • Code Quality:

  • Check for potential bugs (e.g., missing await, mishandling of null/undefined values).

  • Avoid unnecessary console.log statements in production code.

  • Security:

  • Avoid hardcoding sensitive data.

  • Sanitize user input to prevent XSS and other vulnerabilities.

  • Best Practices:

  • Use const and let instead of var.

  • Follow ES6+ standards where applicable.

@gemini-code-assist
Copy link
Copy Markdown

Summary of Changes

Hello @navya-1417, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request introduces a comprehensive set of HTML assignments designed to educate users on semantic and interactive web development practices. The changes include the creation of several new HTML files demonstrating key concepts such as structured content using semantic tags, client-side form validation with advanced input types, internal navigation, embedding multimedia, and enhancing form accessibility. These assignments are integrated into the main training topics page, allowing for easy review and interaction.

Highlights

  • New HTML Assignments: A new set of HTML assignments has been added under 'html/3-semantic-interactive-tags/navya/', covering semantic elements, form validation, advanced inputs, linking, media embedding, and accessible forms.
  • Main Page Integration: The 'html/3-semantic-interactive-tags/index.html' file has been updated to include these new assignments, making them accessible via '
    Details' elements that load each assignment in an '<iframe>'.
  • Semantic Structure Demonstration: Assignment 1 ('blog.html') demonstrates the use of semantic HTML5 elements like , , ,
    , , and for better document structure.
  • Form Validation and Advanced Inputs: Assignment 2 ('registration.html') showcases various HTML5 input types and validation attributes (required, pattern, min, max) for robust client-side form validation.
  • Media Embedding and Accessibility: Assignments 4 ('audio-video.html') and 5 ('formbutton.html') illustrate how to embed audio and video content and how to use tags for improved form accessibility.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link
Copy Markdown

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request adds several HTML and CSS files as solutions to the assignments on semantic and interactive tags. The code demonstrates a good understanding of various HTML5 features. However, there are several areas for improvement, particularly regarding HTML semantics, accessibility best practices (like proper use of labels and fieldsets), and avoiding obsolete attributes. I've left specific comments on these points. Addressing them will significantly improve the quality and maintainability of the code.

</main>

<footer>
<p>Contact : <a href="mailto:@abc@gmail.com">xyz@gmail.com</a></p>
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

high

The email address in the mailto link is invalid. It contains two @ symbols. Please correct it to a valid email format.

Suggested change
<p>Contact : <a href="mailto:@abc@gmail.com">xyz@gmail.com</a></p>
<p>Contact : <a href="mailto:xyz@gmail.com">xyz@gmail.com</a></p>

Comment on lines +15 to +64
<label for="firstname">First Name:</label>
<input type="text" placeholder="Enter First Name" pattern="^[A-Za-z]+$" autocomplete="off" required>
<br> <br>
<label for="lastname">Last Name:</label>
<input type="text" placeholder="Enter Last Name" pattern="^[A-Za-z]+$" autocomplete="off" required>

<br><br>

<label for="email">Email:</label>
<input type="email" pattern="^[a-zA-Z0-9._%!-]+@gmail\.com$" placeholder="Enter you Email" required>

<br><br>

<label for="phone number">Phone Number:</label>
<input type="tel" pattern="^(\+91)?[0-9]{10}$" placeholder="Enter Your Number" required>

<br><br>

<label for="dob">Date of Birth:</label>
<input type="date" id="birthday" min="2020-01-01" max="2025-12-31" required>

<br><br>

<legend>Singing Preference</legend>

<br>

<label>Preferred Singing Style:</label><br>
<input type="radio" name="style" value="Classical" required>

<label for="classical">Classical</label><br>
<input type="radio" name="style" value="Pop">

<label for="pop">Pop</label><br>
<input type="radio" name="style" value="Rock">

<label for="rock">Rock</label><br>
<input type="radio" name="style" value="Folk">

<label for="folk">Folk</label><br><br>

<label>Instruments You Play (if any):</label><br>
<input type="checkbox" name="instrument" value="Guitar">
<label for="guitar">Guitar</label><br>
<input type="checkbox" name="instrument" value="Piano">
<label for="piano">Piano</label><br>
<input type="checkbox" name="instrument" value="Drums">
<label for="drums">Drums</label><br>
<input type="checkbox" name="instrument" value="None">
<label for="none">None</label><br><br>
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

high

The labels in this form are not correctly associated with their input fields, which is a critical accessibility issue. This prevents users of assistive technologies from understanding the form, and also prevents users from clicking on a label to focus its input.

Here's a summary of the issues:

  1. Text Inputs: The inputs for 'First Name', 'Last Name', and 'Email' are missing id attributes that should match their labels' for attributes.
  2. Phone Number: The for="phone number" is invalid because it contains a space. It should be a single string like for="phone-number", and the input needs a matching id.
  3. Date of Birth: The label's for="dob" does not match the input's id="birthday". They must be identical.
  4. Radio Buttons & Checkboxes: None of the radio buttons or checkboxes have id attributes to match their corresponding labels' for attributes.

<p>This is a short sample video with captions explaining the content.</p>
<video width="640"controls>
<source src="nature.mp4" type="video/mp4">
<track src="" kind="captions" srclang="en" label="English">
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

high

The src attribute for the <track> element is empty. To provide captions, this attribute must point to a valid WebVTT file (e.g., src="captions.vtt"). If no captions are available, you should remove the <track> element.

Suggested change
<track src="" kind="captions" srclang="en" label="English">
<track src="captions.vtt" kind="captions" srclang="en" label="English">

<h2>Sample Audio</h2>
<p>This audio clip is a short narration about the content shown above.</p>
<audio controls>
<source src="" type="audio/mpeg">
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

high

The src attribute for the audio <source> is empty. You need to provide a valid path to an audio file for the audio player to work.

Suggested change
<source src="" type="audio/mpeg">
<source src="narration.mp3" type="audio/mpeg">

</div>
</div>
<div>
<h2>Assignments</h2>
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

The heading 'Assignments' is used twice on this page, which can be confusing. Since this section lists student submissions, consider renaming this heading to 'Submissions' to better describe its content and improve clarity.

Suggested change
<h2>Assignments</h2>
<h2>Submissions</h2>

Comment on lines +25 to +42
<h2>Blog</h2>
<p>Lorem ipsum dolor sit amet consectetur adipisicing elit. Doloribus ab tempora sequi sed voluptate
similique voluptas magnam exercitationem voluptatum incidunt nihil, fugiat eveniet architecto
quaerat distinctio aperiam obcaecati fugit iusto.</p>
</article>

<article>
<h2>Blog</h2>
<p>Lorem ipsum dolor sit amet consectetur adipisicing elit. Similique eaque animi est dignissimos dicta
quisquam ad explicabo eius, corrupti iste numquam, consequatur at natus temporibus. Modi, ipsa
omnis? Sequi, neque!</p>
</article>
<article>
<h2>Blog</h2>
<p>Lorem ipsum dolor sit amet consectetur adipisicing elit. Similique eaque animi est dignissimos dicta
quisquam ad explicabo eius, corrupti iste numquam, consequatur at natus temporibus. Modi, ipsa
omnis? Sequi, neque!</p>
</article>
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

The <h2> headings for all articles are the same ('Blog'). For better semantics and user experience, each article should have a unique and descriptive heading that reflects its content.

Comment on lines +14 to +38
<legend>Personal Information</legend>
<label for="firstname">First Name:</label>
<input type="text" placeholder="Enter First Name" pattern="^[A-Za-z]+$" autocomplete="off" required>
<br> <br>
<label for="lastname">Last Name:</label>
<input type="text" placeholder="Enter Last Name" pattern="^[A-Za-z]+$" autocomplete="off" required>

<br><br>

<label for="email">Email:</label>
<input type="email" pattern="^[a-zA-Z0-9._%!-]+@gmail\.com$" placeholder="Enter you Email" required>

<br><br>

<label for="phone number">Phone Number:</label>
<input type="tel" pattern="^(\+91)?[0-9]{10}$" placeholder="Enter Your Number" required>

<br><br>

<label for="dob">Date of Birth:</label>
<input type="date" id="birthday" min="2020-01-01" max="2025-12-31" required>

<br><br>

<legend>Singing Preference</legend>
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

The <legend> tag must be a child of a <fieldset> element. You should wrap related groups of form controls (like 'Personal Information' and 'Singing Preference') within <fieldset> elements to improve the form's structure and accessibility.

<legend>Personal Information</legend>
<label for="firstname">First Name:</label>
<input type="text" placeholder="Enter First Name" pattern="^[A-Za-z]+$" autocomplete="off" required>
<br> <br>
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

Using <br> tags for spacing is not a best practice. It's better to use CSS for layout and spacing (e.g., margin or padding). This makes the styling more maintainable and separates structure (HTML) from presentation (CSS). This comment applies to all <br> tags used for layout in this file.

<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Form & Button</title>
<link rel="stylesheet" href="./styles//style.css">
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

There is a double slash // in the stylesheet path. While most browsers will correct this, it's best practice to use a single slash for clean and valid paths.

Suggested change
<link rel="stylesheet" href="./styles//style.css">
<link rel="stylesheet" href="./styles/style.css">

<body>
<details>
<summary>Assignment 1</summary>
<iframe src="./assignment-1/blog.html" frameborder="0" width="100%"></iframe>
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

The frameborder and width attributes on <iframe> are presentational and frameborder is obsolete in HTML5. It's best practice to handle styling with CSS. Consider using a style attribute or a CSS class to set the border and width.

Example:

<iframe src="./assignment-1/blog.html" style="border: none; width: 100%;"></iframe>

This comment applies to all <iframe> elements in this file.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant