Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
37 changes: 37 additions & 0 deletions css/advanced/Assignment-1/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Responsive Layout - Flexbox</title>
<link rel="stylesheet" href="style.css">
</head>
<body>

<header>
<h1>My Website</h1>
<nav>
<ul>
<li><a href="#">Home</a></li>
<li><a href="#">About</a></li>
<li><a href="#">Services</a></li>
<li><a href="#">Contact</a></li>
</ul>
</nav>
</header>
<main>
<article>
<h2>Welcome</h2>
<p>This is a responsive page using Flexbox layout.</p>
</article>
<aside>
<h2>Sidebar</h2>
<p>Extra links and resources go here.</p>
</aside>
</main>

<footer>
<p>&copy; 2025 My Website</p>
</footer>
</body>
</html>
69 changes: 69 additions & 0 deletions css/advanced/Assignment-1/style.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@

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

body {
font-family: Arial, sans-serif;
line-height: 1.6;
}

header {
background: #0d0a99;
color: #fff;
padding: 20px;
text-align: center;
}
Comment on lines +13 to +18
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

Consider using CSS custom properties (variables) for colors. This improves maintainability and makes it easier to manage the color scheme of your site, especially as it grows. You can define the colors in the :root selector and then reuse them throughout your stylesheet.

For example:

:root {
  --primary-color: #0d0a99;
  --text-color: #fff;
  --article-bg: #2c13a8;
  --aside-bg: #4d119b;
  --footer-bg: #3f12ba;
}

header {
  background: var(--primary-color);
  color: var(--text-color);
  padding: 20px;
  text-align: center;
}


nav ul {
list-style: none;
display: flex;
justify-content: center;
gap: 20px;
margin-top: 10px;
}

nav a {
color: #fff;
text-decoration: none;
}

main {
display: flex;
padding: 20px;
gap: 20px;
}

article {
flex: 3;
background: #2c13a8;
color: #fff;
padding: 20px;
border-radius: 8px;
}

aside {
flex: 1;
background: #4d119b;
color: #fff;
padding: 20px;
border-radius: 8px;
}

footer {
background: #3f12ba;
color: #fff;
text-align: center;
padding: 15px;
margin-top: 20px;
bottom: auto;
}
Comment on lines +55 to +62
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 bottom: auto; property on line 61 is redundant because auto is the default value for the bottom property. It can be removed to make the code cleaner without affecting the layout.

footer {
  background: #3f12ba;
  color: #fff;
  text-align: center;
  padding: 15px;
  margin-top: 20px;
}


@media (max-width: 768px) {
main {
flex-direction: column;
flex:1;
}
Comment on lines +65 to +68
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 flex: 1; property on line 67 has no effect. The flex property applies to flex items (direct children of a flex container), but the parent of main (the <body> element) is not a flex container. This line can be safely removed.

  main {
    flex-direction: column;
  }

}
60 changes: 60 additions & 0 deletions css/advanced/Assignment-2/animations.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>CSS Animation & Media Queries</title>
<style>
body {
font-family: Arial, sans-serif;
margin: 0;
padding: 0;
display: flex;
justify-content: center;
align-items: center;
height: 100vh;
background: #f0f0f0;
}
.box {
width: 150px;
height: 150px;
background: #3498db;
border-radius: 10px;
display: flex;
justify-content: center;
align-items: center;
color: white;
font-weight: bold;
animation: bounce 2s infinite;
}
Comment on lines +18 to +29
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

Consider using CSS custom properties (variables) for colors. This makes your theme easier to manage and change, especially when you have different colors for different states or screen sizes as you do in the media queries.

For example:

:root {
  --box-bg-large: #3498db;
  --box-bg-medium: #e67e22;
  --box-bg-small: #2ecc71;
  --box-text-color: white;
}

.box {
  /* ... */
  background: var(--box-bg-large);
  color: var(--box-text-color);
  /* ... */
}

Then in your media queries, you would just update the background color property.

@keyframes bounce {
0%, 100% {
transform: translateY(0);
}
50% {
transform: translateY(-50px);
}
}
@media (max-width: 768px) {
.box {
width: 120px;
height: 120px;
font-size: 14px;
background: #e67e22;
}
}

@media (max-width: 480px) {
.box {
width: 90px;
height: 90px;
font-size: 12px;
background: #2ecc71;
}
}
</style>
Comment on lines +7 to +55
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

For better maintainability, separation of concerns, and to leverage browser caching, it's a best practice to move CSS styles from the <style> tag into a separate .css file. You can then link to it using <link rel="stylesheet" href="animations.css"> in the <head>. This aligns with the "File Organization" best practice for CSS which was noted in the PR description.

</head>
<body>
<div class="box">Hello Guys..!</div>
</body>
</html>