Skip to content

Commit 8c6d27f

Browse files
Revised content.
1 parent e625816 commit 8c6d27f

File tree

1 file changed

+25
-4
lines changed

1 file changed

+25
-4
lines changed

framework/extras-referencing-css.html

Lines changed: 25 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -31,15 +31,17 @@
3131

3232
There are three ways to include (otherwise known as *referencing*) CSS in an HTML page.
3333

34-
**INLINE** - can be added to any HTML element using the `style` *attribute*.
34+
###**INLINE**
35+
Can be added to any HTML element using the `style` *attribute*.
3536

3637
```
3738
<p style="color: blue;">I'm writing CSS!</p>
3839
```
3940

40-
This technique should be avoided but it's good to know how it works in case you encounter it.
41+
This technique is not as common because it's harder to maintain but it's good to know how it works, just in case.
4142

42-
**INTERNAL** - uses `<style>` and is included in the `<head>` element.
43+
###INTERNAL
44+
Uses `<style>` and is included in the `<head>` element.
4345

4446
```
4547
<head>
@@ -57,7 +59,26 @@
5759

5860
This method is preferred over *inline* css, however it is still inefficient because if you had multiple web pages, the style block and any revisions would have to be replicated on every single page.
5961

60-
The **external** method is most widely used. Refer back to the original presentation [here](../index.html#slide40).
62+
###EXTERNAL
63+
CSS is written in a separate stylesheet file.
64+
65+
The **external** method is most widely used. A separate file with a `.css` extension is linked to the HTML file. This method is recommended in most cases because it separates the CSS from the HTML document. The link to the stylesheet is referenced in the `<head>` on any page where these styles need to be included. Only the CSS file needs to be updated rather than the CSS block on every single page.
66+
67+
Referenced in the head element with a `<link>` tag and two **attributes**, `rel` and `href`. Just like creating links, the value of the `href` points to the location of the stylesheet.
68+
69+
Though it is not required, css files are often saved in a css folder for organization, so make sure the file path points to the appropriate directory.
70+
71+
The `rel` attribute describes the relationship.
72+
73+
```
74+
<head>
75+
<title>Page Title</title>
76+
<meta charset="utf-8">
77+
<link rel="stylesheet" href="css/style.css">
78+
</head>
79+
```
80+
81+
**Pro tip!** Sublime Text shortcut: type "link" + tab key. Ta da!
6182
</section>
6283
</main><!-- cls main section -->
6384

0 commit comments

Comments
 (0)