Skip to content

Commit 92df645

Browse files
author
LinnAlexandra
committed
Final edits to CSS section
1 parent 5dc8349 commit 92df645

File tree

1 file changed

+17
-49
lines changed

1 file changed

+17
-49
lines changed

index.html

Lines changed: 17 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -1408,7 +1408,7 @@ <h2>CSS classes</h2>
14081408
<!-- SLIDE: CSS -->
14091409
<article class='slide slide-list'>
14101410
<h2>External CSS</h2>
1411-
<p>Instead of duplicating your <code>&lt;style&gt;</code> content for every webpage, make one single CSS document ending with a <code>.css</code> extension and link to it in the <code>&lt;head&gt;</code> tag instead of (or in addition to) a <code>&lt;style&gt;</code> tag.</p>
1411+
<p>Instead of duplicating your <code>&lt;style&gt;</code> content for every webpage, make one single CSS document ending with a <code>.css</code> extension, and link to it in the <code>&lt;head&gt;</code> tag instead of (or in addition to) a <code>&lt;style&gt;</code> tag.</p>
14121412
<pre>
14131413
&lt;head&gt;
14141414
<strong>&lt;link rel="stylesheet" href="styles.css" type="text/css" /&gt;</strong>
@@ -1420,7 +1420,7 @@ <h2>External CSS</h2>
14201420
&lt;/head&gt;
14211421
</pre>
14221422

1423-
<p>Inside styles.css, there is <strong>no</strong> <code>&lt;style&gt;</code> tag:</p>
1423+
<p>Inside styles.css, there is <strong>no</strong> <code>&lt;style&gt;</code> or <code>&lt;/style&gt;</code> tag:</p>
14241424
<pre>
14251425
body {
14261426
background-color: black;
@@ -1441,19 +1441,15 @@ <h2>Exercise #4 (20 minutes)</h2>
14411441
<ul>
14421442
<li>Update your navigation in <code>index.html</code> to look more button-like.</li>
14431443
<li>Create a single <code>styles.css</code> file and link to this external stylesheet from all 3 webpages using the <code>&lt;link&gt;</code> tag. Consolidate all of your CSS into this external stylesheet.</li>
1444-
<li>If you've got extra time, try out some new CSS properties from the cheatsheet and other resources listed on the <a href="#slide-94">CSS resources slide</a>.</li>
1444+
<li>If you've got extra time, try out some new CSS properties from the cheatsheet and other resources listed on the <a href="#slide-88">CSS resources slide</a>.</li>
14451445
</ul>
1446-
<h3>Got questions?</h3>
1447-
<p>
1448-
Post them to Google Moderator: <a href="http://goo.gl/mod/c4cm" target="_blank" >http://goo.gl/mod/c4cm</a>
1449-
</p>
14501446
</article>
14511447

14521448
<!-- SLIDE: CSS -->
14531449
<article class='slide slide-list'>
14541450
<h2>Laying out webpages with CSS</h2>
14551451
<p>Layout is one of the most challenging things to do in CSS because it requires you to think about the whole picture and plan ahead.</p>
1456-
<p>To creating a standard 2-column layout requires us to give dimensions to some of our content, and position it accordingly.</p>
1452+
<p>Creating a standard 2-column layout requires us to give dimensions to some of our content, and position it accordingly.</p>
14571453
<p class="centered"><img src="assets/2-column-webpage.png" width="703" height="411" alt="" /></p>
14581454
</article>
14591455

@@ -1557,8 +1553,8 @@ <h2>Preparing for our group exercise</h2>
15571553
<!-- SLIDE: CSS -->
15581554
<article class='slide slide-list'>
15591555
<h2>Assigning widths</h2>
1560-
<p>It is important to know the overall width of your site so you can select column widths for the main <code>&lt;section&gt;</code> and the <code>&lt;aside&gt;</code> sidebar that will make sense.</p>
1561-
<p>Let's go ahead and set the <code>&lt;header&gt;</code> and <code>&lt;footer&gt;</code> to be 960 pixels wide. We'll add a gray border too, so we can see what's going on.</p>
1556+
<p>It is important to know the overall width of your site, so you can select column widths for the main <code>&lt;section&gt;</code> and the <code>&lt;aside&gt;</code> sidebar that will make sense.</p>
1557+
<p>Let's go ahead and set the <code>&lt;header&gt;</code> and <code>&lt;footer&gt;</code> to be 960 pixels wide. We'll add a grey border too, so we can see what's going on.</p>
15621558
<pre>
15631559
header {
15641560
<strong>width: 960px;</strong>
@@ -1589,9 +1585,9 @@ <h2>Assigning widths</h2>
15891585
border: 1px solid gray;
15901586
}
15911587
</pre>
1592-
<p class="sidenote"><strong>PRO TIP:</strong> Historically, padding wrecked havoc on our math. To avoid headaches, use the <a href="http://paulirish.com/2012/box-sizing-border-box-ftw/" target="_blank">box-sizing property</a> for every website you make to make sure your math adds up.</p>
1588+
<p class="sidenote"><strong>PRO TIP:</strong> Historically, padding could wreak havoc on our column math. To avoid headaches, use the <a href="http://paulirish.com/2012/box-sizing-border-box-ftw/" target="_blank">box-sizing property</a> for every website you make to make sure your math adds up.</p>
15931589
<pre>
1594-
/* apply a natural box layout model to all elements */
1590+
/* apply a more intuitive box layout model to all elements */
15951591
<strong>* {
15961592
-moz-box-sizing: border-box;
15971593
-webkit-box-sizing: border-box;
@@ -1634,7 +1630,7 @@ <h2>Clearing floats</h2>
16341630
<strong>clear: both;</strong>
16351631
}
16361632
</pre>
1637-
<br /><br /><br />
1633+
<br />
16381634
<hr />
16391635
<p class="sidenote">If the elements that are floating are enclosed in another container, you can you apply <code>overflow:auto</code> to the parent container:</p>
16401636
<pre>nav {
@@ -1649,15 +1645,15 @@ <h2>Clearing floats</h2>
16491645
<!-- SLIDE: CSS -->
16501646
<article class='slide slide-list'>
16511647
<h2>CSS id's</h2>
1652-
<p>CSS classes are great when you want to re-apply the same style to multiple HTML elements but sometimes you need to only target an HTML container <strong>once</strong>. This is where an <span class="keyword">ID</span> is useful.</p>
1648+
<p>CSS classes are great when you want to re-apply the same style to multiple HTML elements, but sometimes you only need to target an HTML container <strong>once</strong>. This is where an <span class="keyword">ID</span> is useful.</p>
16531649
<ul>
1654-
<li>Use a <strong>hash</strong> (<code>#</code>) to define CSS selectors that are IDs.<br />
1650+
<li>In your CSS, use a <strong>hash</strong> (<code>#</code>) to define CSS selectors that are IDs.<br />
16551651
e.g. <code>#centered_on_page</code></li>
1656-
<li>Use the <code>id</code> attribute to apply the styles to that element.<br />
1652+
<li>Then in your HTML, use the <code>id</code> attribute to apply the styles to that element.<br />
16571653
e.g. <code>id="centered_on_page"</code><br />
16581654
</li>
16591655
</ul>
1660-
<p class="sidenote"><strong>Important!</strong> You should only have <strong>one</strong> instance of an ID per page. Any more can cause unexpected things to happen with your CSS -- and later, JavaScript.</p>
1656+
<p class="sidenote"><strong>Important!</strong> You should only have <strong>one</strong> instance of an ID per page. Any more can cause unexpected things to happen with your CSS &mdash; and later, JavaScript.</p>
16611657
<textarea class="coder-editor">
16621658
&lt;style&gt;
16631659
#centered_on_page {
@@ -1731,10 +1727,6 @@ <h2>Hands-on time (now until end)</h2>
17311727
<li>Apply some custom colours to your text in any of your web pages.</li>
17321728
<li>Research the <code>background-image</code> property and add a background image to webpages.</li>
17331729
</ul>
1734-
<h3>Got questions?</h3>
1735-
<p>
1736-
Post them to Google Moderator: <a href="http://goo.gl/mod/c4cm" target="_blank">http://goo.gl/mod/c4cm</a>
1737-
</p>
17381730
</article>
17391731

17401732
<!-- SLIDE: CSS -->
@@ -1749,37 +1741,12 @@ <h2>Bonus: Try out web fonts</h2>
17491741
</ol>
17501742
</article>
17511743

1752-
<!-- SLIDE: CSS -->
1753-
<article class='slide slide-list'>
1754-
<h2>Bonus: CSS patterns for fun</h2>
1755-
<p>CSS is great because it can reduce the number of image files you need to create. You can even create <a href="http://lea.verou.me/css3patterns/#" target="_blank">patterns purely out of CSS</a>!</p>
1756-
<ol>
1757-
<li>Click on a pattern that you like.</li>
1758-
<li>Copy the supplied CSS.</li>
1759-
<li>Instead of an "ad" in your sidebar, paste the CSS into your <code>aside</code> selector. Or apply it to your <code>body</code> selector to change up the entire page.</li>
1760-
<li>Important: Due to the differences in CSS support in web browsers, you will need to duplicate the <code>background-image</code> property-value set and replace <code>linear-gradient</code> with <code>-webkit-linear-gradient</code>.</li>
1761-
</ol>
1762-
<pre style="font-size: 14px;">
1763-
/* Based on Cicada stripes from http://lea.verou.me/css3patterns/#cicada-stripes */
1764-
background-color: #026873;
1765-
background-image: linear-gradient(90deg, rgba(255,255,255,.07) 50%, transparent 50%),
1766-
linear-gradient(90deg, rgba(255,255,255,.13) 50%, transparent 50%),
1767-
linear-gradient(90deg, transparent 50%, rgba(255,255,255,.17) 50%),
1768-
linear-gradient(90deg, transparent 50%, rgba(255,255,255,.19) 50%);
1769-
<strong>background-image: -webkit-linear-gradient(0deg, rgba(255,255,255,.07) 50%, transparent 50%),
1770-
-webkit-linear-gradient(0deg, rgba(255,255,255,.13) 50%, transparent 50%),
1771-
-webkit-linear-gradient(0deg, transparent 50%, rgba(255,255,255,.17) 50%),
1772-
-webkit-linear-gradient(0deg, transparent 50%, rgba(255,255,255,.19) 50%);</strong>
1773-
background-size: 13px, 29px, 37px, 53px;
1774-
</pre>
1775-
</article>
1776-
17771744
<!-- SLIDE: CSS -->
17781745
<article class='slide slide-list'>
17791746
<h2>CSS reference</h2>
17801747
<ul class="spacey_list">
17811748
<li>Download a <a href="http://www.cheatography.com/davechild/cheat-sheets/css2/" target="_blank">cheatsheet of CSS selectors and properties</a>.</li>
1782-
<li>Try looking up individual selectors and properties using the CSS section of <a href="https://developer.mozilla.org/en-US/docs/CSS/CSS_Reference" target="_blank">Mozilla's Developer Network</a> for further breakdown.</li>
1749+
<li>Try looking up individual selectors and properties using the CSS section of <a href="https://developer.mozilla.org/en-US/docs/CSS/CSS_Reference" target="_blank">Mozilla's Developer Network</a> for a further breakdown.</li>
17831750
<li>Read articles from <a href="http://www.alistapart.com/" target="_blank">A List Apart</a>.</li>
17841751
<li>And don't forget the "inspect element" option!</li>
17851752
</ul>
@@ -1821,7 +1788,7 @@ <h2>Using FTP to put your site online</h2>
18211788
<h2>Where to get this information</h2>
18221789
<div>
18231790
<p>This information will generally be provided to you by your hosting service provider.</p>
1824-
<p>There ARE conventions regarding what directory your files go into once you have connected to your server via FTP:</p>
1791+
<p>There are conventions regarding what directory your files go into once you have connected to your server via FTP, which can differ depending on your host:</p>
18251792
<ul>
18261793
<li>www</li>
18271794
<li>public</li>
@@ -1837,6 +1804,7 @@ <h2>Transferring your files</h2>
18371804
<div>
18381805
<p>Once you have identified where your files need to go, it is often just a matter of dragging and dropping into your FTP program.</p>
18391806
<p>Once this is done, you can check your web address to see how things are looking!</p>
1807+
<p class="sidenote">Remember to always have an <code>index.html</code> file if you want people to be able to visit your domain directly. For example, <code>ladieslearningcode.com</code> is actually pointing to <code>ladieslearningcode.com/index.html</code>!</p>
18401808
</div>
18411809
</article>
18421810

@@ -1855,7 +1823,7 @@ <h2>Books</h2>
18551823
<article class='slide slide-list'>
18561824
<h2>Validating your HTML</h2>
18571825
<div>
1858-
<p>One of the best ways to make sure that your HTML is being done correctly is to run it through an HTML validator on occasion.</p>
1826+
<p>One of the best ways to make sure that your HTML has been written correctly is to run it through an HTML validator on occasion.</p>
18591827
<p>You can find the HTML validator at <a href="http://validator.w3.org/" target="_blank">http://validator.w3.org/</a></p>
18601828
</div>
18611829
</article>

0 commit comments

Comments
 (0)