You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This technique should be avoided but it's good to know how it works in case you encounter it.
41
+
42
+
**INTERNAL** - uses `<style>` and is included in the `<head>` element.
43
+
44
+
```
45
+
<head>
46
+
<title>Page Title</title>
47
+
<style>
48
+
h1 {
49
+
font-size: 16px;
50
+
}
51
+
</style>
52
+
</head>
53
+
<body>
54
+
<p>I'm still writing CSS!</p>
55
+
</body>
56
+
```
57
+
58
+
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.
59
+
60
+
The **external** method is most widely used. Refer back to the original presentation [here](../index.html#slide41).
Copy file name to clipboardExpand all lines: index.html
+21-41Lines changed: 21 additions & 41 deletions
Original file line number
Diff line number
Diff line change
@@ -646,7 +646,7 @@ <h2>Adding images</h2>
646
646
* http://slipsum.com/
647
647
* and [many more](http://meettheipsums.com/)!
648
648
649
-
For your reference, [exercise3-about.html](project/examples/exercise3-about.html) can be found in your **examples** folder but only look if you get stuck! Try asking a mentor first!
649
+
For reference, [exercise3-about.html](project/examples/exercise3-about.html) can be found in the **examples** folder but look only if you're stuck!
650
650
</section>
651
651
652
652
<sectionclass="slide title" data-markdown>
@@ -657,9 +657,9 @@ <h2>Adding images</h2>
657
657
<sectionclass="slide" data-markdown>
658
658
##CSS & HTML
659
659
660
-
CSS is its own language and has different syntax rules than HTML but it the two are closely paired. CSS is made up of rules that refer to HTML elements and define what those elements should look like.
660
+
CSS is a different language from HTMl and has its own syntax rules though the two are closely paired. CSS is made up of rules that refer to HTML elements and define what those elements should look like.
661
661
662
-
CSS separates content (i.e. text) from presentation (i.e. text colour) and helps to reduce redundancy and save time.
662
+
CSS separates content (i.e. text) from presentation (i.e. text colour) and helps to reduce redundancy.
663
663
664
664
Older presentational HTML tags like `<center>` and `<font>` should no longer be used because CSS takes care of presentation and styles.
665
665
</section>
@@ -684,7 +684,7 @@ <h2>Adding images</h2>
684
684
</section>
685
685
686
686
<sectionclass="slide">
687
-
<h2>CSS Syntax</h2>
687
+
<h2>CSS Terminology & Syntax</h2>
688
688
689
689
<pre><code>h1 {
690
690
color: blue;
@@ -706,6 +706,18 @@ <h2>CSS Syntax</h2>
706
706
</ul>
707
707
</section>
708
708
709
+
<sectionclass="slide">
710
+
<h2>Write some CSS</h2>
711
+
<p>Let's change the styles of the paragraphs on this slide using <code>font-size</code>.</p>
712
+
713
+
<textareaclass="snippet">p {
714
+
715
+
}</textarea>
716
+
<divclass="example">
717
+
<p>Lorem ipsum dolor sit amet, consectetur adipisicing elit. Ipsam nesciunt sint beatae dolor dolorum aliquid quis explicabo vitae numquam, quas illo dolore molestiae ratione, perferendis, deleniti nemo ea voluptatibus! Quibusdam.</p>
718
+
</div>
719
+
</section>
720
+
709
721
<sectionclass="slide" data-markdown>
710
722
##Descendant selectors
711
723
@@ -724,9 +736,7 @@ <h2>CSS Syntax</h2>
724
736
}
725
737
```
726
738
727
-
Feel free to skip a level but be mindful of specificity rules. For example, `nav ul li a` would override `nav a` because it's more specific.
728
-
729
-
However, it’s usually easier to start with generic selectors and make them more specific, as needed, rather than starting with very specific selectors and adding extra markup or classes to try to override the styles.
739
+
Feel free to skip a level but be mindful of specificity rules. For example, `nav ul li a` would override `nav a` because it's more specific. It’s usually easier to start with generic selectors and make them more specific, as needed, rather than starting with very specific selectors and adding extra markup or classes to try to override the styles.
730
740
</section>
731
741
732
742
<sectionclass="slide" data-markdown>
@@ -754,43 +764,13 @@ <h2>CSS Syntax</h2>
754
764
</section>
755
765
756
766
<sectionclass="slide" data-markdown>
757
-
##Referencing CSS - Inline & Internal
758
-
759
-
There are three ways to include (otherwise known as *referencing*) CSS in an HTML page.
767
+
##Referencing CSS
760
768
761
-
**INLINE** - can be added to any HTML element using the `style` *attribute*.
This technique should be avoided but it's good to know how it works in case you encounter it.
768
-
769
-
**INTERNAL** - uses `<style>` and is included in the `<head>` element.
770
-
771
-
```
772
-
<head>
773
-
<title>Page Title</title>
774
-
<style>
775
-
h1 {
776
-
font-size: 16px;
777
-
}
778
-
</style>
779
-
</head>
780
-
<body>
781
-
<p>I'm still writing CSS!</p>
782
-
</body>
783
-
```
784
-
785
-
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.
786
-
</section>
787
-
788
-
<sectionclass="slide" data-markdown>
789
-
##Referencing CSS - External
769
+
There are three ways to include (otherwise known as *referencing*) CSS in an HTML page. Today we'll be using the **external** method. To read more about **inline** and **internal**, view [this extra resource](framework/extras-referencing-css.html).
790
770
791
-
The external method links to a separate style sheet file and is recommended because it separates the CSS from the HTML document. The style sheet is referenced in the `<head>` of the document. Only the CSS file needs to be updated rather than the CSS block on every single page.
771
+
The external method links to a separate style sheet file and is recommended because it separates the CSS from the HTML document. Only the CSS file needs to be updated.
792
772
793
-
Referenced in the head element with a `<link>` tag and two **attributes**, `rel` (relationship) and `href`. Just like creating links, the value of the `href` points to the location of the style sheet.
773
+
The style sheet is referenced in the `<head>` of the document with a `<link>` tag and two **attributes**, `rel` (relationship) and `href`. Just like links, the value of `href` points to the location of the style sheet.
794
774
795
775
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.
0 commit comments