Skip to content

Commit

Permalink
Intro to CSS: Update terminology from "self-closing" to "void" for li…
Browse files Browse the repository at this point in the history
…nk element (#28634)
  • Loading branch information
youssef-el-atmani authored Aug 14, 2024
1 parent 80c02d2 commit eea6d17
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions foundations/html_css/css-foundations/intro-to-css.md
Original file line number Diff line number Diff line change
Expand Up @@ -283,7 +283,7 @@ Now that we've learned some basic syntax, you might be wondering *how* to add al

#### External CSS

External CSS is the most common method you will come across, and it involves creating a separate file for the CSS and linking it inside of an HTML's opening and closing `<head>` tags with a self-closing `<link>` element:
External CSS is the most common method you will come across, and it involves creating a separate file for the CSS and linking it inside of an HTML's opening and closing `<head>` tags with a void `<link>` element:

```html
<!-- index.html -->
Expand All @@ -306,7 +306,7 @@ p {
}
```

First, we add a self-closing `<link>` element inside of the opening and closing `<head>` tags of the HTML file. The `href` attribute is the location of the CSS file, either an absolute URL or, what you'll be utilizing, a URL relative to the location of the HTML file. In our example above, we are assuming both files are located in the same directory. The `rel` attribute is required, and it specifies the relationship between the HTML file and the linked file.
First, we add a void `<link>` element inside of the opening and closing `<head>` tags of the HTML file. The `href` attribute is the location of the CSS file, either an absolute URL or, what you'll be utilizing, a URL relative to the location of the HTML file. In our example above, we are assuming both files are located in the same directory. The `rel` attribute is required, and it specifies the relationship between the HTML file and the linked file.

Then inside of the newly created `styles.css` file, we have the selector (the `div` and `p`), followed by a pair of opening and closing curly braces, which create a "declaration block". Finally, we place any declarations inside of the declaration block. `color: white;` is one declaration, with `color` being the property and `white` being the value, and `background-color: black;` is another declaration.

Expand Down

0 comments on commit eea6d17

Please sign in to comment.