Skip to content

navya-advance-tags-html#525

Open
navya-1417 wants to merge 1 commit intoaptyInc:mainfrom
navya-1417:navya-advance-tags
Open

navya-advance-tags-html#525
navya-1417 wants to merge 1 commit intoaptyInc:mainfrom
navya-1417:navya-advance-tags

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 collection of HTML assignments designed to explore and implement advanced web technologies. It provides practical examples for embedding external content securely using iframes, and demonstrates how to create reusable, encapsulated components with custom elements and Shadow DOM. The changes aim to enhance understanding of these modern HTML features through hands-on examples.

Highlights

  • New HTML Assignments: Three new HTML assignment files have been added, demonstrating advanced HTML features.
  • Iframe Usage: The iframe.html file showcases embedding external content like YouTube videos and Google Maps using the <iframe> tag.
  • Secure Iframe Embedding: The widget.html file demonstrates secure <iframe> usage by incorporating sandbox and allow attributes to restrict content capabilities.
  • Custom Elements with Shadow DOM: The shadowdom.html file illustrates the creation of a custom HTML element (<my-card>) utilizing Shadow DOM and an HTML <template> for encapsulated styling and structure.
  • Consolidated Index Page: An index.html file has been added to provide a central entry point, embedding each of the three assignments within <details> and <iframe> elements for easy access and viewing.
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 three HTML assignments demonstrating the use of iframe, template, and Shadow DOM. The implementation is good, but there are several instances of using obsolete HTML attributes (frameborder) and inline CSS styles. My review focuses on replacing these with modern CSS practices by using a <style> block, which improves maintainability and adheres to best practices.


<h2>YouTube Video</h2>
<iframe width="560" height="315" src="https://www.youtube.com/embed/dQw4w9WgXcQ" title="YouTube video player"
frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture"
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 attribute is obsolete in HTML5. It's recommended to use CSS for styling borders. Please remove this attribute and define the border style in a <style> block in the <head> section. This will also help centralize styles, as you have another iframe with an inline style for its border.

Suggested change
frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture"
allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture"

<h2>Location Map</h2>
<iframe
src="https://www.google.com/maps/embed?pb=!1m18!1m12!1m3!1d3153.019556200289!2d-122.41941518468144!3d37.77492977975978!2m3!1f0!2f0!3f0!3m2!1i1024!2i768!4f13.1!3m3!1m2!1s0x80858064e8bfa6f3%3A0x9f2c1ec8145d1ecf!2sSan+Francisco%2C+CA!5e0!3m2!1sen!2sin!4v1696079876543!5m2!1sen!2sin"
width="600" height="450" style="border:0;" allowfullscreen="" loading="lazy"
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

As per the best practices in the PR description, inline styles should be avoided. It's better to move this style to a <style> block in the <head>. This allows for better separation of concerns and easier maintenance.

Suggested change
width="600" height="450" style="border:0;" allowfullscreen="" loading="lazy"
width="600" height="450" allowfullscreen="" loading="lazy"

<h1>Secure Embedded Widget</h1>

<iframe src="https://www.youtube.com/embed/dQw4w9WgXcQ" width="600" height="400" title="Secure Widget"
sandbox="allow-scripts allow-same-origin" allow="fullscreen; autoplay" style="border:1px solid #ccc;">
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

Inline styles are discouraged for maintainability. Please move this style to a <style> block in the <head> section. This aligns with the CSS best practices mentioned in the PR description.

Suggested change
sandbox="allow-scripts allow-same-origin" allow="fullscreen; autoplay" style="border:1px solid #ccc;">
sandbox="allow-scripts allow-same-origin" allow="fullscreen; autoplay">

<body>
<details>
<summary>Assignment 1</summary>
<iframe src="./assignment-1/iframe.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 attribute is obsolete in HTML5 and should be replaced with CSS. This comment also applies to the other iframes on lines 21 and 28. You can add a <style> block in the <head> to set border: none; for all iframe elements in this file.

Suggested change
<iframe src="./assignment-1/iframe.html" frameborder="0" width="100%"></iframe>
<iframe src="./assignment-1/iframe.html" width="100%"></iframe>

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