Skip to content

Commit

Permalink
Show example of what the CSS would look like without nesting
Browse files Browse the repository at this point in the history
  • Loading branch information
Kalikoze committed May 21, 2024
1 parent 934c82d commit 76024fe
Showing 1 changed file with 24 additions and 0 deletions.
24 changes: 24 additions & 0 deletions lessons/module-2/advanced-css.md
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,30 @@ Nesting allows you to define styles for nested elements in a more intuitive and

In this example, we define styles for a navigation bar and its nested list items and links. The nesting structure mirrors the HTML structure, making it easier to understand and maintain the CSS code.

<section class="solution">
### CSS Without Nesting

Here is what the CSS would look like without nesting:
```css
.navbar {
background-color: #333;
}

.navbar ul {
list-style-type: none;
}

.navbar ul li {
display: inline-block;
}

.navbar ul li a {
color: #fff;
text-decoration: none;
}
```
</section>

<section class="note">
### Use nesting with CAUTION

Expand Down

0 comments on commit 76024fe

Please sign in to comment.