<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en-GB">
	<id>http://wiki.asterix.co.za/html/index.php?action=history&amp;feed=atom&amp;title=Introduction_to_CSS</id>
	<title>Introduction to CSS - Revision history</title>
	<link rel="self" type="application/atom+xml" href="http://wiki.asterix.co.za/html/index.php?action=history&amp;feed=atom&amp;title=Introduction_to_CSS"/>
	<link rel="alternate" type="text/html" href="http://wiki.asterix.co.za/html/index.php?title=Introduction_to_CSS&amp;action=history"/>
	<updated>2026-05-20T17:32:40Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.40.1</generator>
	<entry>
		<id>http://wiki.asterix.co.za/html/index.php?title=Introduction_to_CSS&amp;diff=5&amp;oldid=prev</id>
		<title>Prothumia: Created page with &quot;Here is an introduction to Cascading Style Sheets (CSS) into our coding of HTML pages!  &#039;&#039;&#039;Case study&#039;&#039;&#039;  [http://red.asterix.co.za/original/ Red.Asterix.co.za/original] is a simple, single-paged website that I have put up for you.  This is quite an old web page- from 2008!- so let&#039;s see if it still works   Hit &#039;&#039;&#039;Ctrl-&#039;+&#039;&#039;&#039;&#039; if you need, just to get a bit closer to what I&#039;m about to tell you.  And spend some time playing with this page.  Click here, cli...&quot;</title>
		<link rel="alternate" type="text/html" href="http://wiki.asterix.co.za/html/index.php?title=Introduction_to_CSS&amp;diff=5&amp;oldid=prev"/>
		<updated>2023-11-18T19:04:44Z</updated>

		<summary type="html">&lt;p&gt;Created page with &amp;quot;Here is an introduction to &lt;a href=&quot;/html/index.php?title=CSS&quot; title=&quot;CSS&quot;&gt;Cascading Style Sheets (CSS)&lt;/a&gt; into our coding of &lt;a href=&quot;/html/index.php?title=HTML&quot; title=&quot;HTML&quot;&gt;HTML pages&lt;/a&gt;!  &amp;#039;&amp;#039;&amp;#039;Case study&amp;#039;&amp;#039;&amp;#039;  [http://red.asterix.co.za/original/ Red.Asterix.co.za/original] is a simple, single-paged website that I have put up for you.  This is quite an old web page- from 2008!- so let&amp;#039;s see if it still works   Hit &amp;#039;&amp;#039;&amp;#039;Ctrl-&amp;#039;+&amp;#039;&amp;#039;&amp;#039;&amp;#039; if you need, just to get a bit closer to what I&amp;#039;m about to tell you.  And spend some time playing with this page.  Click here, cli...&amp;quot;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;Here is an introduction to [[CSS|Cascading Style Sheets (CSS)]] into our coding of [[HTML|HTML pages]]!&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Case study&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
[http://red.asterix.co.za/original/ Red.Asterix.co.za/original] is a simple, single-paged website that I have put up for you.  This is quite an old web page- from 2008!- so let&amp;#039;s see if it still works&lt;br /&gt;
&lt;br /&gt;
 Hit &amp;#039;&amp;#039;&amp;#039;Ctrl-&amp;#039;+&amp;#039;&amp;#039;&amp;#039;&amp;#039; if you need, just to get a bit closer to what I&amp;#039;m about to tell you.&lt;br /&gt;
 And spend some time playing with this page.  Click here, click there, click everywhere!&lt;br /&gt;
&lt;br /&gt;
Take your browser out of maximise and change the width of your browser to see how my web page behaves.&lt;br /&gt;
You&amp;#039;ll see my motorbike on the right hand side knows how to stay in the right place&lt;br /&gt;
&lt;br /&gt;
== Testing of web pages ==&lt;br /&gt;
&lt;br /&gt;
Clicking on my images in Firefox works well- showing you a bigger image (which is what I wanted!), but, alas, Chrome thinks I want to download the images when I click on them!  This is why I test your web pages in multiply browsers.  &lt;br /&gt;
&lt;br /&gt;
The marks I&amp;#039;ll award you will be based on the browser that gives me the worst result for your work!  For example, if I was making the persona who wrote this page, Peter Zulu 8E, I&amp;#039;d mark him according to what Chrome is showing me!- viz: That the thumbnails are not launching a bigger image for the website visitor to see.&lt;br /&gt;
&lt;br /&gt;
 To be reasonable, I&amp;#039;ll only test your work on Firefox, Chrome and Edge&lt;br /&gt;
&lt;br /&gt;
== View page source ==&lt;br /&gt;
&lt;br /&gt;
Once you&amp;#039;ve got to know my web page, hit &amp;#039;&amp;#039;&amp;#039;Ctrl-U&amp;#039;&amp;#039;&amp;#039; on my web page to view my source code.&lt;br /&gt;
&lt;br /&gt;
...or, if you&amp;#039;d rather do this the long way around, feel free to use your mouse to first right-click on my web page ...and then slowly move your pointer to the bit that says, &amp;quot;View page source&amp;quot; ...and click!&lt;br /&gt;
&lt;br /&gt;
(All this is the same on both Firefox and Chrome- at least on the computer I&amp;#039;m using now)&lt;br /&gt;
&lt;br /&gt;
 Yes, [[Dragon]], it really does look neat!  You are going to [[CSS|love CSS]]!&lt;br /&gt;
&lt;br /&gt;
== Style! ==&lt;br /&gt;
&lt;br /&gt;
 [[Phoenix]] : Are you calling a css file into the code or doing the css code in the html file?&lt;br /&gt;
&lt;br /&gt;
This is a good question!- we&amp;#039;ll work on both of these options over the next couple of weeks&lt;br /&gt;
&lt;br /&gt;
When you see a tag that you do not know, ask!  There are clues here, as to what comes next.  Use [https://www.w3schools.com/ W3Schools] to read up on these tags and others you might see.  Here, look...&lt;br /&gt;
&lt;br /&gt;
=== [https://www.w3schools.com/tags/tag_link.asp link tag] ===&lt;br /&gt;
&lt;br /&gt;
It&amp;#039;s this &amp;lt;link&amp;gt; tag that is pointing to my [[CSS|CSS file]], that you are unable to see on my web server.  The only thing you can see is the [[HTML]] that makes up my [[home|index.html]] web page.&lt;br /&gt;
&lt;br /&gt;
When you want to see my [[CSS|CSS file]], I will have to give it to you! ...but first.....&lt;br /&gt;
&lt;br /&gt;
Do you see my &amp;lt;link&amp;gt; tag, that I have in the &amp;lt;head&amp;gt; of this web page?  Here is a reformatted version of this line, to emphasise what I want you to see......&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  &amp;lt;link&lt;br /&gt;
       rel  = &amp;quot;stylesheet&amp;quot; &lt;br /&gt;
       href = &amp;quot;rearViewMirror.css&amp;quot;&lt;br /&gt;
       type = &amp;quot;text/css&amp;quot;&lt;br /&gt;
   /&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This is how you tell your HTML page to make use of a style sheet that is stored somewhere on your web server.  Look at the bit that says &amp;#039;&amp;#039;&amp;#039;href&amp;#039;&amp;#039;&amp;#039; and you will see the name of the [[CSS|CSS file]] that [http://red.asterix.co.za/original/ this web page] makes use of&lt;br /&gt;
&lt;br /&gt;
Now before we look into [[CSS]], I want you to get a copy of this web page running on your very own computer!&lt;br /&gt;
&lt;br /&gt;
== Local copy of this web page ==&lt;br /&gt;
&lt;br /&gt;
I want you to look at my page source and do the following&lt;br /&gt;
&lt;br /&gt;
* Hit &amp;#039;&amp;#039;&amp;#039;Ctrl-A&amp;#039;&amp;#039;&amp;#039; which will select all the text on my web page&lt;br /&gt;
* Hit &amp;#039;&amp;#039;&amp;#039;Ctrl-C&amp;#039;&amp;#039;&amp;#039; which will copy what you have just selected onto your clipboard&lt;br /&gt;
* Use Notepad to open a file called &amp;#039;&amp;#039;&amp;#039;mirror.html&amp;#039;&amp;#039;&amp;#039; on your desktop (or some place you&amp;#039;re not going to lose later)&lt;br /&gt;
* Hit &amp;#039;&amp;#039;&amp;#039;Ctrl-V&amp;#039;&amp;#039;&amp;#039; which will paste what&amp;#039;s on your clipboard into [[Notepad]]&lt;br /&gt;
* Tell Notepad to save this file&lt;br /&gt;
* Close Notepad&lt;br /&gt;
&lt;br /&gt;
And keep fingers crossed that you&amp;#039;ve remembered what I&amp;#039;ve said about turning, &amp;quot;Hide extensions of known file types&amp;quot; off.  Be careful to not end up with a file named &amp;#039;&amp;#039;&amp;#039;mirror.html.txt&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
Now you can tell your current Internet browser to open your local copy of &amp;#039;&amp;#039;&amp;#039;mirror.html&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
QUESTION : What do you see?&lt;br /&gt;
&lt;br /&gt;
 Yes, [[Phoenix]]! ...no style!&lt;br /&gt;
&lt;br /&gt;
==== Mirror folder ====&lt;br /&gt;
&lt;br /&gt;
You are about to end up with a number of files.  It would be best for you to open a folder called &amp;quot;Mirror&amp;quot; (let&amp;#039;s all use a folder called &amp;quot;Mirror&amp;quot;, to help me see what you have on your computer later!)&lt;br /&gt;
&lt;br /&gt;
Place your &amp;#039;&amp;#039;&amp;#039;mirror.html&amp;#039;&amp;#039;&amp;#039; into your Mirror folder&lt;br /&gt;
&lt;br /&gt;
=== And what else is missing ===&lt;br /&gt;
&lt;br /&gt;
Before anyone asks for a copy of my style sheet, we want to get our images to work!&lt;br /&gt;
&lt;br /&gt;
QUESTION : What do you see?  I would like to know.&lt;br /&gt;
&lt;br /&gt;
  [[Dragon]] : &amp;#039;&amp;#039;&amp;quot;the same thing just more stripped down and no pictures&amp;quot;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
Good!  That is exactly what I want you to see!  It means that you only have &amp;#039;&amp;#039;&amp;#039;mirror.html&amp;#039;&amp;#039;&amp;#039; in your Mirror folder.  Now go back to [http://red.asterix.co.za/original/ my website] and fetch the missing images, to put into your Mirror folder!- right next to &amp;#039;&amp;#039;&amp;#039;mirror.html&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
Look at the code to see lines like this one...&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  &amp;lt;a href=&amp;quot;batoutofhell.bmp&amp;quot;&amp;gt;&lt;br /&gt;
      &amp;lt;img class=&amp;quot;RightThumb&amp;quot; src=&amp;quot;bat1icon.jpg&amp;quot; alt=&amp;quot;Bat Out Of Hell&amp;quot; /&amp;gt;&lt;br /&gt;
  &amp;lt;/a&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This tells you that there are two images that you need...&lt;br /&gt;
&lt;br /&gt;
* The smaller one is &amp;#039;&amp;#039;&amp;#039;bat1icon.jpg&amp;#039;&amp;#039;&amp;#039; that I use as a thumbnail&lt;br /&gt;
* The bigger one is &amp;#039;&amp;#039;&amp;#039;batoutofhell.bmp&amp;#039;&amp;#039;&amp;#039; that I use as my full size image&lt;br /&gt;
&lt;br /&gt;
Get all of of the images that are used into your &amp;quot;Mirror&amp;quot; folder!- and be sure to not change any filenames!  Some of them are lo-res for thumbnails, some are a bit bigger for when a visitor wants to see a larger version of the image&lt;br /&gt;
&lt;br /&gt;
Now tell your Internet browser to refresh your page with your local copy of &amp;#039;&amp;#039;&amp;#039;mirror.html&amp;#039;&amp;#039;&amp;#039; and tell me what you see!&lt;br /&gt;
&lt;br /&gt;
  [[Dragon]] : pictures!&lt;br /&gt;
&lt;br /&gt;
GOOD!  You know how to get images downloaded and put into the correct location!  Well done!  I think you deserve an [[easter egg|Easter Egg]] for this!&lt;br /&gt;
&lt;br /&gt;
So, [[Dragon]]!  What you see is images, but the style is still missing!  Right!?&lt;br /&gt;
&lt;br /&gt;
 [[Dragon]] : yes theres no style &lt;br /&gt;
&lt;br /&gt;
Yes!  [[student|Everyone]], I want you to focus on some tags in my code, before I start to tell you about [[CSS]]&lt;br /&gt;
&lt;br /&gt;
== Setting the style ==&lt;br /&gt;
&lt;br /&gt;
=== Use of [https://www.w3schools.com/tags/tag_span.asp span tag] ===&lt;br /&gt;
&lt;br /&gt;
Look for this line....&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  &amp;lt;span&amp;gt;The skies were pure&amp;lt;/span&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Here I am using a &amp;lt;span&amp;gt; tag.  You will also see that I have not told &amp;lt;span&amp;gt; what to do!  In fact, right now (without [[CSS]]!), &amp;lt;span&amp;gt; is doing nothing.  All I have done here, is put a &amp;lt;span&amp;gt; into my code, that I can use later in CSS!&lt;br /&gt;
&lt;br /&gt;
Look to see that I have used &amp;lt;span&amp;gt; in a number of places in my code...&lt;br /&gt;
&lt;br /&gt;
=== Use of [https://www.w3schools.com/tags/tag_div.asp div tag] ===&lt;br /&gt;
&lt;br /&gt;
There is something else I want you to notice in my code- my use of well placed &amp;lt;div&amp;gt; tags&lt;br /&gt;
&lt;br /&gt;
 I have well placed, &amp;#039;&amp;#039;&amp;#039;divisions&amp;#039;&amp;#039;&amp;#039; in my HTML code!&lt;br /&gt;
&lt;br /&gt;
Be sure to see this, before we move on!  Let&amp;#039;s put the start of one division here, for us to talk about..&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  &amp;lt;div&amp;gt;&amp;lt;span&amp;gt;The skies were pure&amp;lt;/span&amp;gt; and the fields were green ..... &amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Right, we&amp;#039;ll talk about [[tags|these tags]] again a bit later&lt;br /&gt;
&lt;br /&gt;
== Now it gets interesting ==&lt;br /&gt;
&lt;br /&gt;
Think about these questions...&lt;br /&gt;
&lt;br /&gt;
# How do we make what is inside my &amp;#039;&amp;#039;&amp;#039;span tags&amp;#039;&amp;#039;&amp;#039; turn into capitals?&lt;br /&gt;
# How do we make what is inside my &amp;#039;&amp;#039;&amp;#039;span tags&amp;#039;&amp;#039;&amp;#039; turn blue?&lt;br /&gt;
# How do we make the very first letter of what I have in my &amp;#039;&amp;#039;&amp;#039;div tag&amp;#039;&amp;#039;&amp;#039; do a number of things?&lt;br /&gt;
## it turns red!&lt;br /&gt;
## it drops a line!&lt;br /&gt;
## it is now italic!&lt;br /&gt;
# How do we make everything in my &amp;#039;&amp;#039;&amp;#039;div&amp;#039;&amp;#039;&amp;#039; tag turn yellow!  (except for what is inside my &amp;#039;&amp;#039;&amp;#039;span tag&amp;#039;&amp;#039;&amp;#039;)&lt;br /&gt;
# Why is some of my text in red? (...not just the first letter of my &amp;#039;&amp;#039;&amp;#039;div tags&amp;#039;&amp;#039;&amp;#039;)&lt;br /&gt;
# How did we make the background turn black?&lt;br /&gt;
# How did some text become centered?&lt;br /&gt;
&lt;br /&gt;
It&amp;#039;s easy!  I use a cascading style sheet!- to tell &amp;#039;&amp;#039;&amp;#039;div&amp;#039;&amp;#039;&amp;#039; and &amp;#039;&amp;#039;&amp;#039;span&amp;#039;&amp;#039;&amp;#039; and other tags to do what I want them to!&lt;br /&gt;
&lt;br /&gt;
== Who is ready to see my style sheet? ==&lt;br /&gt;
&lt;br /&gt;
  [[Phoenix]] : Ready&lt;br /&gt;
  [[Dragon]] : ready&lt;br /&gt;
&lt;br /&gt;
GREAT! ...and are you looking forward to this!?&lt;br /&gt;
&lt;br /&gt;
  [[Dragon]] :  somewhat ...said with a big smile!&lt;br /&gt;
&lt;br /&gt;
This stuff is brilliant!  ...&amp;#039;&amp;#039;&amp;#039;&amp;lt;big&amp;gt;Here is &amp;lt;big&amp;gt;[[RearViewMirror.css|my style sheet]]&amp;lt;/big&amp;gt;&amp;lt;/big&amp;gt;&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
Open this style sheet in [[Notepad]] and READ the file!  Try see answers to the questions that I have just asked you!&lt;br /&gt;
&lt;br /&gt;
Also note that the filename of my style sheet is exactly correct!  It is a perfect match...&lt;br /&gt;
&lt;br /&gt;
* letter-for-letter&lt;br /&gt;
* case-for-case&lt;br /&gt;
&lt;br /&gt;
...to the filename that my &amp;lt;link&amp;gt; tag is asking for&lt;br /&gt;
&lt;br /&gt;
Once you have this CSS file sitting right next to your &amp;#039;&amp;#039;&amp;#039;mirror.html&amp;#039;&amp;#039;&amp;#039;, hit refresh (F5) and tell me what you see!&lt;br /&gt;
&lt;br /&gt;
 [[Dragon]] : it works!&lt;br /&gt;
&lt;br /&gt;
Yes!  The style simply flows in!&lt;br /&gt;
&lt;br /&gt;
== Deprecated tags ==&lt;br /&gt;
&lt;br /&gt;
=== [https://www.w3schools.com/tags/tag_font.asp font tag] ===&lt;br /&gt;
&lt;br /&gt;
Be sure to know which tags are deprecated or no longer supported!  If you use tags that are deprecated and/or no longer supported, I will mark you down ...let&amp;#039;s use a word like... badly!  Let me say that again:  Do not use tags that are deprecated and/or no longer supported on any web pages that you build for me.&lt;br /&gt;
&lt;br /&gt;
In other words, if the persona Peter Zulu 8E was in my Web Development class this year, I&amp;#039;d fail [his web page], for two reasons...&lt;br /&gt;
&lt;br /&gt;
* It works on Firefox, but it does not work properly on Chrome!&lt;br /&gt;
* It still has &amp;lt;font&amp;gt; tags!&lt;br /&gt;
&lt;br /&gt;
The fact that my web page has declared itself to be [[HTML|HTML 4.0]] is no excuse!- as per the line right at the top of my web page.  Here, look...&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  &amp;lt;!DOCTYPE HTML PUBLIC &amp;quot;-//W3C//DTD HTML 4.0 Transitional//EN&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
I might be lenient in the use of deprecated tags, but I certifiably will not allow any tags flagged as, &amp;quot;not supported&amp;quot; on any web pages you work on for me- even if that is in regard to [[HTML|HTML 5]].&lt;br /&gt;
&lt;br /&gt;
Now that I have pointed you to the [https://www.w3schools.com/tags/tag_doctype.asp HTML &amp;lt;!DOCTYPE&amp;gt; declaration], I am placing a mark onto your usage of this tag!- onto ever web page you have on your website.&lt;br /&gt;
&lt;br /&gt;
== Closing ==&lt;br /&gt;
&lt;br /&gt;
Now my lecture is done.  You have now been dropped into the shallow end of the pool, regarding [[CSS|cascading style sheets]]!  I have given you the start that you need!&lt;br /&gt;
&lt;br /&gt;
Now what I want you to do is play with the code&lt;br /&gt;
&lt;br /&gt;
* Change the colours&lt;br /&gt;
* Change the fonts&lt;br /&gt;
&lt;br /&gt;
Get to know how [[CSS]] looks and how it connects.  And, yes, there is stuff for me to explain to you!- like why do some things you see start with a &amp;#039;,&amp;#039; (a dot)&lt;br /&gt;
&lt;br /&gt;
We&amp;#039;ll work through details like this in my next lecture&lt;br /&gt;
&lt;br /&gt;
=== Next steps ===&lt;br /&gt;
&lt;br /&gt;
Somebody ask me if you can now add some CSS to your website&lt;br /&gt;
&lt;br /&gt;
 [[Phoenix]] : Can I please&lt;br /&gt;
 [[Munki]] : Please&lt;br /&gt;
&lt;br /&gt;
You new goal is make your websites look [http://red.asterix.co.za/ just like this], except for the wording that you will have on your own website.  Start by writing something about yourself into the [[center]] of your [portfolio|[portfolio.html]] pages (such as [http://phoenix.asterix.co.za/portfolio.html this one for Phoinix])&lt;br /&gt;
&lt;br /&gt;
This is to show me that you know how to get [[CSS]] started on your [[web page]]s.  Once you have shown me this and you have all your web pages in place, all on the same [[CSS|CSS file]], I will allow you to change what you have in your CSS files- to set your individual styling on your [[website]]s&lt;br /&gt;
&lt;br /&gt;
== Notes ==&lt;br /&gt;
&lt;br /&gt;
* Be sure to note how neat my CSS file is!  Keep it this way, or lose marks when I look at your [[CSS]]&lt;br /&gt;
* For more, go to the [https://www.w3schools.com/css/ CSS Tutorial] on W3Schools&lt;br /&gt;
&lt;br /&gt;
&amp;lt;small&amp;gt;&lt;br /&gt;
[[Main Page]] |&lt;br /&gt;
[[Basic web design]] |&lt;br /&gt;
[[navigation table|Navigation]] |&lt;br /&gt;
[[Ranking]] |&lt;br /&gt;
[[support website|Support]] |&lt;br /&gt;
[http://www.asterix.co.za/ Asterix Home]&lt;br /&gt;
&amp;lt;/small&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[Category:Design]]&lt;br /&gt;
[[Category:Lecture]]&lt;/div&gt;</summary>
		<author><name>Prothumia</name></author>
	</entry>
</feed>