Chapter Three
An Introduction to Web Page Design
Introduction
Welcome to the beginning of the Web Page Class. In this class we are going to learn the basic building blocks of web pages and how to use them. This can appear to be very complicated. Let’s look at where we ultimately are going. Open a web page in your favorite web browser (i.e. Internet Explorer, Google Chrome, Mozilla Firefox, etc.). Position your mouse cursor on the page, not over an image, and right-click. In the menu that appears, select “View Source” or “View Page Source”. What appears is the code that creates this page in your browser (see example below).
Looks complicated doesn’t it? It is complicated; however, it is built out of a Figure 1 Internet Explorer Page Showing Page Source bunch of small components that you will learn during the remainder of this class. If you stick with me and do the little exercises
I ask of you during the semester, by its end you will be well on your way toward being able combine them and create such pages on your own.
XHTML, HTML, and CSS
The code that makes up a webpage consists of two types of coding, the code that defines and organizes the information on the page and the code that formats the information in the webpage. The code that defines and organizes the information on the webpage in XHTML or HTML. We will be using XHTML (see figure 2 for a timeline of XHTL/HTML development).
Figure 2 Timeline of the Development of XHTML and HTML What’s the difference and why XHTML? HTML, which stands for HyperText
Markup Language, was used in the beginning for the creation of web pages. Each version has added features, making it easier to create more complex webpages. HTML designers have made sure that there is compatibility across the differing versions. If I open a later HTML file in an older browser, or vice versa, it either works or shows the problematic materials in plaintext. (Compare this with MS Office, where a more recent file will not open in an earlier version of Office without some work on your part.) As mentioned earlier, we will be using XHTML (eXtensible HyperText Markup
Language) in this class. Like HTML, XHTML has more strict rules, for example requiring all elements to be closed, that results in the creation of more consistent page code. This has the advantage of developing coding habits resulting in pages that are likely to appear the same, despite whatever browser the user may choose to use.
Where does CSS fit in? CSS stands for cascading style sheets. Most of the formatting and styling of our page occurs through CSS code. Using CSS code, we can format pages across our website so that they have the same formatting and thus a similar appearance. For examples the titles on one page, has the same color, line- spacing, font-size, font-size, etc. as the titles on other webpages throughout our website. This also has the advantage that we can make one change to our CSS file and it effects our entire website. This saves time and cuts down on the stress of having to touch every page to make such changes. We will get into using CSS in the last two- thirds of this class.
Obtaining the Skeleton File and the Notepad++ Editor
There are certain components that every XHTML/HTML file must have. I will show pictures, but I want you to be able to see them personally on your computer.
This will also prepare us for when you begin to create your own webpages. Go to my teacher website (within the RCHS website; http://www.russell.kyschools.us/olc/teacher.aspx?s=245 ) and within the Web Page
Development section you will see a folder titled: “XHTML Files”. Inside this folder you will find a file named “skeleton.html” (see figure 3 below). Right-click on this file and select “Save Target As” or whatever your option may be to download a copy of this file. Notice where it is saved on your computer. (Don’t worry about the skeleton2.html file, you don’t need it at present. On your desktop, right-click and select “New” and Figure 3 Finding the Skeleton File on Teacher Website in the menu, that appears select
“Folder”.
Name this folder “Web Page Development”. Open this folder and paste a copy of the skeleton file inside. The skeleton file is the foundation for everything we will do this semester and thus we need to keep a copy around.
To make sure we have a copy for our later projects, we will copy this one and rename it for each of our projects and practice exercises. Inside the “Web Page
Development” folder, right-click, select “New”, and then select “Folder”. Name this folder “Practice One”. Open the “Practice One” folder and paste the skeleton file inside. Right-click on this skeleton file and If the Notepad++ program is not rename it “index.html”. Right-click on available in the menu that opens, we will need to install it before we “index.html” and in the menu that appears, continue. Open www.ninite.com in your web browser and select select “Edit with Notepad++”. This will Notepad++ in the Developer Tools open the index file in the Notepad++ section. Then click on “Get Your Ninite” and the installer will be editor. We will be using this editor downloaded to your computer. When the installer is finished throughout this semester to create downloading, right-click on the file webpages. and select “Run as administrator” if this option is available. If it is not available, select “Run”. Your
teacher may need to enter authorization for your install to The Components of a Web Page complete.
The screenshot at the top of the next page (see figure 4) shows what you see when you open the index.html file in the Notepad++ program. Note as we have only Figure 4 Screenshot of index.html File Open in Notepad++
changed the name of the skeleton file, there is not a difference between the skeleton file and the index file that we have opened in the editor. Let’s examine the differing parts of the skeleton that we can see. Please follow along on your screen.
The first line contains a DOCTYPE declaration. It must be on the first line of each web document and tells the web browser the version of HTML in which the document is written. Notice that the DOCTYPE starts with a “<” and ends with a
“>”. This brings up an important principle found in XHTML, every component has some sort of opening and closing code. Take note of these as we go through the skeleton and later when we introduce various XHTML components. The next section is the HTML section. Find the