Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: TheOdinProject/css-exercises
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: main
Choose a base ref
...
head repository: drwsss/css-exercises
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: main
Choose a head ref
Can’t automatically merge. Don’t worry, you can still create the pull request.
  • 17 commits
  • 21 files changed
  • 1 contributor

Commits on Jan 21, 2022

  1. Exercise completed

    drwsss committed Jan 21, 2022
    Copy the full SHA
    b5c9cb6 View commit details
  2. Starting the exercise

    drwsss committed Jan 21, 2022
    Copy the full SHA
    1620b6b View commit details
  3. Finished exercise

    drwsss committed Jan 21, 2022
    Copy the full SHA
    cd3bf85 View commit details
  4. Finished exercise

    drwsss committed Jan 21, 2022
    Copy the full SHA
    0871e82 View commit details
  5. Finished exercise

    drwsss committed Jan 21, 2022
    Copy the full SHA
    283013e View commit details
  6. Finished exercise

    drwsss committed Jan 21, 2022
    Copy the full SHA
    93f455d View commit details
  7. Finished exercise

    drwsss committed Jan 21, 2022
    Copy the full SHA
    555159e View commit details

Commits on Jan 22, 2022

  1. Finished exercise

    drwsss committed Jan 22, 2022
    Copy the full SHA
    d40b18b View commit details
  2. Finished exercise

    drwsss committed Jan 22, 2022
    Copy the full SHA
    e870329 View commit details
  3. Finished exercise

    drwsss committed Jan 22, 2022
    Copy the full SHA
    0c48491 View commit details
  4. Finished exercise

    drwsss committed Jan 22, 2022
    Copy the full SHA
    8845ec1 View commit details
  5. Finished exercise

    drwsss committed Jan 22, 2022
    Copy the full SHA
    2656174 View commit details
  6. Finished exercise

    drwsss committed Jan 22, 2022
    Copy the full SHA
    809a5d7 View commit details

Commits on Jan 23, 2022

  1. Finished exercise

    drwsss committed Jan 23, 2022
    Copy the full SHA
    41afe09 View commit details
  2. Finished exercise

    drwsss committed Jan 23, 2022
    Copy the full SHA
    7cc8336 View commit details
  3. Copy the full SHA
    f8343b3 View commit details
  4. Finished exercise

    drwsss committed Jan 23, 2022
    Copy the full SHA
    37441ea View commit details
3 changes: 3 additions & 0 deletions flex/01-flex-center/style.css
Original file line number Diff line number Diff line change
@@ -3,6 +3,9 @@
border: 4px solid midnightblue;
width: 400px;
height: 300px;
display: flex;
align-items: center;
justify-content: center;
}

.box {
27 changes: 26 additions & 1 deletion flex/02-flex-header/style.css
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
.header {
font-family: monospace;
font-family: FreeMono, monospace;
background: papayawhip;
/* from here */
display: flex;
justify-content: space-between;
align-items: stretch;
}

.logo {
@@ -9,11 +13,32 @@
color: tomato;
background: white;
padding: 4px 32px;
/* from here */
text-align: center;
flex: 2 1 0;
}

ul {
/* this removes the dots on the list items*/
list-style-type: none;
/* from here */
padding: 0;
margin: 0;
display: flex;
align-items: center;
}

.left-links,
.right-links {
display: flex;
}

.left-links {
justify-content: flex-start;
}

.right-links {
justify-content: flex-end;
}

a {
26 changes: 15 additions & 11 deletions flex/03-flex-header-2/index.html
Original file line number Diff line number Diff line change
@@ -9,18 +9,22 @@
</head>
<body>
<div class="header">
<div class="logo">
LOGO
<div class="to-the-left">
<div class="logo">
LOGO
</div>
<ul class="links">
<li><a href="google.com">link-one</a></li>
<li><a href="google.com">link-two</a></li>
<li><a href="google.com">link-three</a></li>
</ul>
</div>
<div class="to-the-right">
<button class="notifications">
1 new notification
</button>
<div class="profile-image"></div>
</div>
<ul class="links">
<li><a href="google.com">link-one</a></li>
<li><a href="google.com">link-two</a></li>
<li><a href="google.com">link-three</a></li>
</ul>
<button class="notifications">
1 new notification
</button>
<div class="profile-image"></div>
</div>
</body>
</html>
42 changes: 42 additions & 0 deletions flex/03-flex-header-2/style.css
Original file line number Diff line number Diff line change
@@ -46,3 +46,45 @@ a {
ul {
list-style-type: none;
}

/* solution */

.header {
margin: 8px;
display: flex;
justify-content: space-between;
align-items: center;
}

.logo {
margin: 10px;
}

.to-the-left,
.to-the-right {
display: flex;
flex: 1 1 0;
align-items: center;
}

.to-the-left {
}

.to-the-right {
justify-content: flex-end;
}

ul {
margin: 0;
padding: 0;
display: flex;
align-items: center;
}

li {
margin: 0 10px;
}

button {
margin: 10px;
}
26 changes: 18 additions & 8 deletions flex/04-flex-information/index.html
Original file line number Diff line number Diff line change
@@ -10,17 +10,27 @@
<body>
<div class="title">Information!</div>

<img src="./images/barberry.png" alt="barberry">
<div class="text">This is a type of plant. We love this one.</div>
<div class="plants">
<div class="barberry">
<img src="./images/barberry.png" alt="barberry">
<div class="text">This is a type of plant. We love this one.</div>
</div>

<img src="./images/chilli.png" alt="chili">
<div class="text">This is another type of plant. Isn't it nice</div>
<div class="chilli">
<img src="./images/chilli.png" alt="chili">
<div class="text">This is another type of plant. Isn't it nice</div>
</div>

<img src="./images/pepper.png" alt="pepper">
<div class="text">We have so many plants. Yay plants.</div>
<div class="pepper">
<img src="./images/pepper.png" alt="pepper">
<div class="text">We have so many plants. Yay plants.</div>
</div>

<img src="./images/saffron.png" alt="saffron">
<div class="text">I'm running out of things to say about plants.</div>
<div class="saffron">
<img src="./images/saffron.png" alt="saffron">
<div class="text">I'm running out of things to say about plants.</div>
</div>
</div>

<!-- disregard this section, it's here to give attribution to the creator of these icons -->
<div class="footer">
19 changes: 19 additions & 0 deletions flex/04-flex-information/style.css
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
body {
font-family: 'Courier New', Courier, monospace;
text-align: center;
}

img {
@@ -23,4 +24,22 @@ img {
align-items: center;
justify-content: center;
background: #eee;
}

/* solution */

.title {
margin-bottom: 32px;
}

.plants {
display: flex;
gap: 52px;
}

.barberry,
.chilli,
.pepper,
.saffron {
max-width: 200px;
}
32 changes: 32 additions & 0 deletions flex/05-flex-modal/style.css
Original file line number Diff line number Diff line change
@@ -63,4 +63,36 @@ button.cancel {
background: white;
border: 1px solid #ddd;
color: royalblue;
}

/* solution */

.modal {
display: flex;
flex-wrap: wrap;
align-items: center;
}

.header {
font-size: large;
font-weight: bold;
flex: 20;
}

.icon {
margin: 10px;
}

.close-button {
margin: 10px;
align-items: flex-start;
justify-self: flex-end;
}

.text {
padding: 0 10px 0 62px;
}

button.continue {
margin: 20px 10px 20px 62px;
}
42 changes: 42 additions & 0 deletions flex/06-flex-layout/style.css
Original file line number Diff line number Diff line change
@@ -25,3 +25,45 @@ input {
width: 400px;
margin-bottom: 16px;
}

/* solution */

body {
display: flex;
flex-direction: column;
justify-content: space-between;
}

.header,
.footer {
display: flex;
justify-content: space-between;
}

ul,
il {
list-style: none;
display: flex;
margin: 15px;
padding: 0;
gap: 10px;
}

a {
text-decoration: none;
color: black;
}

.content {
display: flex;
flex-direction: column;
align-items: center;
}

.footer {
background-color: #eee;
}

button {
padding: 10px;
}
32 changes: 18 additions & 14 deletions flex/07-flex-layout-2/index.html
Original file line number Diff line number Diff line change
@@ -12,22 +12,26 @@
MY AWESOME WEBSITE
</div>

<div class="sidebar">
<ul>
<li><a href="google.com">⭐ - link one</a></li>
<li><a href="google.com">🦸🏽‍♂️ - link two</a></li>
<li><a href="google.com">🖌️ - link three</a></li>
<li><a href="google.com">👌🏽 - link four</a></li>
</ul>
<div class="content">
<div class="sidebar">
<ul>
<li><a href="google.com">⭐ - link one</a></li>
<li><a href="google.com">🦸🏽‍♂️ - link two</a></li>
<li><a href="google.com">🖌️ - link three</a></li>
<li><a href="google.com">👌🏽 - link four</a></li>
</ul>
</div>

<div class="cards">
<div class="card">Lorem ipsum dolor sit amet consectetur adipisicing elit. Tempora, eveniet? Dolorem dignissimos maiores non delectus possimus dolor nulla repudiandae vitae provident quae, obcaecati ipsam unde impedit corrupti veritatis minima porro?</div>
<div class="card">Lorem ipsum dolor sit, amet consectetur adipisicing elit. Quasi quaerat qui iure ipsam maiores velit tempora, deleniti nesciunt fuga suscipit alias vero rem, corporis officia totam saepe excepturi odit ea.</div>
<div class="card">Lorem ipsum dolor sit amet consectetur, adipisicing elit. Nobis illo ex quas, commodi eligendi aliquam ut, dolor, atque aliquid iure nulla. Laudantium optio accusantium quaerat fugiat, natus officia esse autem?</div>
<div class="card">Lorem ipsum dolor sit amet consectetur adipisicing elit. Necessitatibus nihil impedit eius amet adipisci dolorum vel nostrum sit excepturi corporis tenetur cum, dolore incidunt blanditiis. Unde earum minima laboriosam eos!</div>
<div class="card">Lorem ipsum dolor sit amet consectetur, adipisicing elit. Nobis illo ex quas, commodi eligendi aliquam ut, dolor, atque aliquid iure nulla. Laudantium optio accusantium quaerat fugiat, natus officia esse autem?</div>
<div class="card">Lorem ipsum dolor sit amet consectetur adipisicing elit. Necessitatibus nihil impedit eius amet adipisci dolorum vel nostrum sit excepturi corporis tenetur cum, dolore incidunt blanditiis. Unde earum minima laboriosam eos!</div>
</div>
</div>

<div class="card">Lorem ipsum dolor sit amet consectetur adipisicing elit. Tempora, eveniet? Dolorem dignissimos maiores non delectus possimus dolor nulla repudiandae vitae provident quae, obcaecati ipsam unde impedit corrupti veritatis minima porro?</div>
<div class="card">Lorem ipsum dolor sit, amet consectetur adipisicing elit. Quasi quaerat qui iure ipsam maiores velit tempora, deleniti nesciunt fuga suscipit alias vero rem, corporis officia totam saepe excepturi odit ea.</div>
<div class="card">Lorem ipsum dolor sit amet consectetur, adipisicing elit. Nobis illo ex quas, commodi eligendi aliquam ut, dolor, atque aliquid iure nulla. Laudantium optio accusantium quaerat fugiat, natus officia esse autem?</div>
<div class="card">Lorem ipsum dolor sit amet consectetur adipisicing elit. Necessitatibus nihil impedit eius amet adipisci dolorum vel nostrum sit excepturi corporis tenetur cum, dolore incidunt blanditiis. Unde earum minima laboriosam eos!</div>
<div class="card">Lorem ipsum dolor sit amet consectetur, adipisicing elit. Nobis illo ex quas, commodi eligendi aliquam ut, dolor, atque aliquid iure nulla. Laudantium optio accusantium quaerat fugiat, natus officia esse autem?</div>
<div class="card">Lorem ipsum dolor sit amet consectetur adipisicing elit. Necessitatibus nihil impedit eius amet adipisci dolorum vel nostrum sit excepturi corporis tenetur cum, dolore incidunt blanditiis. Unde earum minima laboriosam eos!</div>

<div class="footer">
The Odin Project ❤️
</div>
60 changes: 60 additions & 0 deletions flex/07-flex-layout-2/style.css
Original file line number Diff line number Diff line change
@@ -25,4 +25,64 @@ body {
border: 1px solid #eee;
box-shadow: 2px 4px 16px rgba(0,0,0,.06);
border-radius: 4px;
}

/* solution */

body {
display: flex;
flex-direction: column;
flex: 1;
}

ul,
ol {
list-style: none;
margin: 0;
padding: 0;
}

a {
text-decoration: none;
font-size: 24px;
color: white;
}

.header {
display: flex;
font-size: 32px;
font-weight: 900;
padding-left: 16px;
align-items: center;
}

.content {
display: flex;
}

.sidebar {
min-width: 300px;
padding: 16px;
}

.cards {
display: flex;
flex-direction: row;
flex-wrap: wrap;
gap: 32px;
justify-content: space-around;
align-content: center;
padding: 32px;
}

.card {
min-width: 200px;
max-width: 300px;
}

.footer {
display: flex;
flex-direction: column-reverse;
justify-content: center;
align-items: center;
}
10 changes: 9 additions & 1 deletion foundations/01-css-methods/index.html
Original file line number Diff line number Diff line change
@@ -3,12 +3,20 @@
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<link rel="stylesheet" href="./style.css">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Methods for Adding CSS</title>
<style>
p {
background-color: green;
color: white;
font-size: 18px;
}
</style>
</head>
<body>
<div>Style me via the external method!</div>
<p>I would like to be styled with the internal method, please.</p>
<button>Inline Method</button>
<button style="background-color: orange; font-size: 18px;">Inline Method</button>
</body>
</html>
7 changes: 7 additions & 0 deletions foundations/01-css-methods/style.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
div {
background-color: red;
color: white;
font-size: 32px;
text-align: center;
font-weight: 900;
}
6 changes: 3 additions & 3 deletions foundations/02-class-id-selectors/index.html
Original file line number Diff line number Diff line change
@@ -9,9 +9,9 @@
</head>
<body>
<p>Number 1 - I'm a class!</p>
<div>Number 2 - I'm one ID.</div>
<p>Number 3 - I'm a class, but cooler!</p>
<div>Number 4 - I'm another ID.</div>
<div class="second">Number 2 - I'm one ID.</div>
<p class="third">Number 3 - I'm a class, but cooler!</p>
<div class="fourth">Number 4 - I'm another ID.</div>
<p>Number 5 - I'm a class!</p>
</body>
</html>
19 changes: 19 additions & 0 deletions foundations/02-class-id-selectors/style.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
p {
background-color: rgb(226, 60, 87);
font-family: Verdana, 'DejaVu Sans', Geneva, Tahoma, sans-serif
}

.second {
color: blue;
font-size: 36px;
}

.third {
font-size: 24px;
}

.fourth {
background-color: rgb(119, 214, 119);
font-size: 24px;
font-weight: bold;
}
4 changes: 2 additions & 2 deletions foundations/03-grouping-selectors/index.html
Original file line number Diff line number Diff line change
@@ -8,7 +8,7 @@
<link rel="stylesheet" href="style.css">
</head>
<body>
<button>Click Me!</button>
<button>No, Click Me!</button>
<button class="button one">Click Me!</button>
<button class="button two">No, Click Me!</button>
</body>
</html>
13 changes: 13 additions & 0 deletions foundations/03-grouping-selectors/style.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
.button {
font-size: 28px;
font-family: Arial, Helvetica, 'Times New Roman', sans-serif;
}

.one {
background-color: black;
color: white;
}

.two {
background-color: yellow;
}
9 changes: 9 additions & 0 deletions foundations/04-chaining-selectors/style.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
.avatar.proportioned {
width: 300px;
height: auto;
}

.avatar.distorted {
width: 200px;
height: 400px;
}
6 changes: 6 additions & 0 deletions foundations/05-descendant-combinator/style.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
.container .text {
background-color: yellow;
color: red;
font-size: 20px;
text-align: center;
}
12 changes: 6 additions & 6 deletions foundations/06-cascade-fix/style.css
Original file line number Diff line number Diff line change
@@ -3,15 +3,15 @@
color: hsl(0, 100%, 50%);
}

.small-para {
font-size: 12px;
}

.para {
font-size: 22px;
}

.confirm {
.small-para {
font-size: 12px;
}

#confirm-button.confirm {
background: green;
color: white;
font-size: 20px;
@@ -24,7 +24,7 @@
font-size: 20px;
}

.child {
.text > .child {
color: red;
font-size: 14px;
}
10 changes: 5 additions & 5 deletions margin-and-padding/margin-and-padding-1/style.css
Original file line number Diff line number Diff line change
@@ -7,22 +7,22 @@ body {
background: pink;
border: 3px solid blue;
/* CHANGE ME */
padding: 0px;
margin: 0px;
padding: 32px;
margin: 12px;
}

.two {
background: lightblue;
border: 3px solid purple;
/* CHANGE ME */
margin-bottom: 0px;
margin-bottom: 48px;
}

.three {
background: peachpuff;
border: 3px solid brown;
width: 200px;
/* CHANGE ME */
padding: 0px;
margin-left: 0px;
padding: 32px;
margin-left: auto;
}
11 changes: 11 additions & 0 deletions margin-and-padding/margin-and-padding-2/style.css
Original file line number Diff line number Diff line change
@@ -7,21 +7,32 @@ body {
width: 400px;
background: #fff;
margin: 16px auto;
padding: 8px;
}

.title {
background: #e3f4ff;
margin: 8px;
font-size: 16px;
padding: 8px;
}

.content {
background: #e3f4ff;
margin: 8px;
padding: 18px 6px;
}

.button-container {
background: #e3f4ff;
margin: 8px;
padding: 8px;
text-align: center;
}

button {
background: white;
border: 1px solid #eee;
display: block;
margin: 0 auto;
}