Skip to content

navya-css-basic-assignment#527

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

navya-css-basic-assignment#527
navya-1417 wants to merge 1 commit intoaptyInc:mainfrom
navya-1417:navya-css-basic

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 set of foundational CSS assignments, showcasing the application of various styling techniques and responsive design principles. It provides a structured way to review the author's understanding of basic HTML and CSS concepts through three distinct web pages, all accessible via a central index.

Highlights

  • New CSS Assignments: Three new assignments have been added, demonstrating fundamental CSS concepts: a basic HTML page with various styling methods, a responsive recipe page, and a responsive team member gallery.
  • Styling Techniques Demonstrated: The assignments showcase inline, internal, and external CSS styling, providing practical examples of each method.
  • Responsive Design Implementation: Both the recipe page and the team member gallery incorporate media queries to ensure optimal viewing across different device sizes, highlighting responsive web design principles.
  • Centralized Assignment Access: An index.html file has been created to serve as a navigation hub, allowing easy access and review of all three assignments via embedded iframes within collapsible sections.
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 CSS assignments. The HTML structure is generally good, using semantic tags where appropriate. However, there are several opportunities to improve the CSS by adhering more closely to the best practices outlined in the pull request description. My feedback focuses on moving inline and internal styles to external stylesheets for better maintainability, replacing outdated CSS techniques with modern alternatives like Flexbox, and removing obsolete HTML attributes. Following these suggestions will make the code more robust, maintainable, and aligned with current web development standards.

Comment on lines +9 to +25
<style>
body {
background-color: #40cad4;

}

p {
font-size: 18px;

}

img {
max-width: 100%;
height: auto;
display: block;
}
</style>
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

According to the CSS best practices in your PR description, styles should be in modular CSS files. Placing CSS inside a <style> tag in the HTML file (internal CSS) makes it harder to maintain and reuse. Please move these styles to the external stylesheet ./css/style.css to improve separation of concerns.

Comment on lines +8 to +144
<style>
* {
box-sizing: border-box;
margin: 0;
padding: 0;
}

body {
font-family: Arial, Helvetica, sans-serif;
line-height: 1.5;
background-color: #fffaf0;
color: #222;
padding: 16px;
}

.container {
max-width: 900px;
margin: 0 auto;
padding: 16px;
}

#recipe-name {
background-color: #ff8c42;
color: #fff;
text-align: center;
padding: 20px;
border-radius: 8px;
margin-bottom: 16px;
}

#recipe-name h1 {
font-size: 2rem;
font-weight: 700;
line-height: 1.1;
}

#recipe-name p {
margin-top: 8px;
font-size: 1rem;
opacity: 0.95;
}

.section {
padding: 18px;
border-radius: 8px;
margin-bottom: 16px;
}

.ingredients {
background-color: #e9f8ee;
}

.preparation {
background-color: #fff6d6;
}

.image-section {
background-color: #f4f5f6;
text-align: center;
}


h2 {
font-size: 1.25rem;
margin-bottom: 10px;
}

p {
font-size: 1rem;
}

ul {
margin-left: 1.1rem;
margin-top: 8px;
}

ol {
margin-left: 1.1rem;
margin-top: 8px;
}

li {
margin-bottom: 8px;
font-size: 1rem;
}

img {
max-width: 100%;
height: auto;
display: block;
margin: 0 auto;
border-radius: 10px;
}

.caption {
font-style: italic;
margin-top: 10px;
color: #555;
font-size: 0.95rem;
}

footer {
text-align: center;
margin-top: 12px;
color: #555;
font-size: 0.95rem;
}


@media (max-width: 480px) {
#recipe-name h1 {
font-size: 1.4rem;
}

#recipe-name {
padding: 14px;
}

.container {
padding: 12px;
}

h2 {
font-size: 1.05rem;
}

li {
font-size: 0.98rem;
}
}

@media (min-width: 481px) and (max-width: 768px) {
#recipe-name h1 {
font-size: 1.6rem;
}
}
</style>
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

These styles are defined internally within the HTML file. As per the best practices in the PR description, CSS should be organized into modular, external files. This improves code organization, reusability, and maintainability. Please move all the CSS rules within this <style> block to a new external .css file and link it in the <head>.

<p>This is a simple webpage demonstrating HTML and CSS styling using inline, internal, and external methods.</p>

<ul>
<li style="color: blue;">Item 1 (inline CSS)</li>
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

While the text 'Item 1 (inline CSS)' suggests this might be for demonstration, using inline styles with the style attribute is against the best practices you've agreed to in the PR description. It leads to poor maintainability. Please move this style to your external CSS file by using a class.

Comment on lines +1 to +4
* {
margin: 0;
padding: 0;
}
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

It's a good practice to include box-sizing: border-box; in your universal selector. This makes layout and sizing more predictable by including padding and border in the element's total width and height. Your other CSS files in this PR already use it, so adding it here would ensure consistency.

Suggested change
* {
margin: 0;
padding: 0;
}
* {
margin: 0;
padding: 0;
box-sizing: border-box;
}


<body>
<main class="container">
<section id="recipe-name" aria-labelledby="title">
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 ID selectors for styling (e.g., #recipe-name) is generally discouraged because they have very high specificity and are not reusable. This can make your CSS harder to maintain and override. It's better to use classes for styling. This allows for more modular and reusable styles. You can change this to a class and update your CSS accordingly.

Suggested change
<section id="recipe-name" aria-labelledby="title">
<section class="recipe-name" aria-labelledby="title">

Comment on lines +40 to +46
.cards-container {
padding: 14px;
margin: 8px;
border: 1px solid #e6eef3;
background-color: #f7fbff;
font-size: 0;
}
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 font-size: 0 on a container to remove whitespace between inline-block elements is an outdated technique. A more modern and robust approach is to use Flexbox. By setting display: flex on this container, you can remove the font-size: 0 hack. You will also need to remove display: inline-block from the .card elements. You can then use the gap property on this container to manage spacing between cards, which is cleaner than using margins.

<body>
<details>
<summary>Assignment 1</summary>
<iframe src="./assignment-1/css-fundamental.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. You should use CSS to control the border. A good practice is to use a class for the iframe and style it in a <style> block or an external CSS file. For example, you could add .assignment-frame { border: none; }. This would apply to all iframes on this page.

Suggested change
<iframe src="./assignment-1/css-fundamental.html" frameborder="0" width="100%"></iframe>
<iframe class="assignment-frame" src="./assignment-1/css-fundamental.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