Professional Documents
Culture Documents
Table of Contents
Introduction ....................................................................................................................................2 Downloading the Data Files ..........................................................................................................2 Adding Links to the Navigation Bar ............................................................................................2 Checkpoint One..............................................................................................................................3 Working with Images ....................................................................................................................4 Using CSS3 Properties to Visually Enhance the Page ................................................................5 Checkpoint Two .............................................................................................................................6 Creating a Page Specific Heading ................................................................................................6 Saving the Page as a Template ......................................................................................................7 Creating a Video Page for the Website ........................................................................................8 Embedding a YouTube Video .....................................................................................................8 Checkpoint Three...........................................................................................................................8
For additional handouts, visit http://www.calstatela.edu/handouts. For video tutorials, visit http://www.youtube.com/mycsula.
Introduction
Websites can be created by using one of many programming languages (e.g., HTML, JSP, PHP, ASP, ASP.NET, or Perl). Among those languages, HTML is the most basic text-based language that has been used in web design since 1989. HTML consists of two parts: 1) content that will be displayed in a web browser, and 2) markup or tags, which are encoded information that are generally hidden from web page viewers. This three-part handout will help users create a basic website using fundamental HTML knowledge that they can build on with more advanced techniques. This second part builds upon the web page that was created in the first handout. It covers adding links to the navigation bar, working with images, adding multimedia objects such as a YouTube video, and creating a web page template.
a.navbuttons{ text-align:center; height:30px; padding-left:14px; padding-right:14px; line-height:30px; margin:0px; display:inline-block; font-size:13px; color:black; text-decoration:none; }
NOTE: text-align centers the text horizontally; padding-left and padding-right add some extra space to the links; line-height centers the text vertically (make sure it is the same height as the regular height); display:inline-block makes the link a horizontal block instead of just text.
6. To add a mouse over effect to the navigation bar links, add a new line before the closing </style> tag, and then type the following CSS rule. a.navbuttons:hover{ background-color:#FFD400; color:black; text-decoration:none; cursor:pointer; }
Checkpoint One
This is the first of three checkpoints within this handout. Make sure that the index.html file that is being updated is similar to the checkpoint_1.html file located in the data files folder (see Figure 1 and Figure 2 for the recently changed areas of the document).
Figure 1 New CSS Rules in the checkpoint_1.html File HTML5 and CSS3 Part 2: Adding Multimedia to the Web Page 3
2. To remove the border that was added in the Part 1 handout, locate the div.wrapper selector between the opening <style> tag and the closing </style> tag, and then delete the following declaration. border:1px solid black; To insert a banner image: 1. Between the opening <div class="banner"> tag and its corresponding closing </div> tag, type the following code. <img src="images/csula_banner.gif" /> 2. To link the banner image to the home page, add the opening <a href="index.html"> tag before <img src="images/csula_banner.gif" />, and then add the closing </a> tag after <img src="images/csula_banner.gif" /> (see Figure 4).
3. Some browsers may add a border around a linked image. To prevent this from happening, add a new line before the closing </style> tag, and then type the following CSS rule. img{ border:0; }
2. To add a gradient background to the navigation bar, locate the div.nav selector between the opening <style> tag and the closing </style> tag, and then add the following declarations to the rule. background-image: -moz-linear-gradient(top, #787a80, #000000); background-image: -webkit-gradient(linear, center top, center bottom, from(#787a80), to(#000000)); background-image: -o-linear-gradient(top, #787a80, #000000);
NOTE: All three of these declarations produce the same result, but each one applies to a different browser. Do not replace the background-color declaration; simply add these declarations at the end of the rule.
3. To make the link text in the navigation bar readable, locate the a.navbuttons selector between the opening <style> tag and the closing </style> tag, and change the value of the color property from black to white (see Figure 5).
4. To see the result, save the file, and then view the web page in a browser window. To learn more about CSS3, visit http://w3schools.com/css3.
Checkpoint Two
This is the second checkpoint within this handout. Make sure that the index.html file that is being updated is similar to the checkpoint_2.html file located in the data files folder (see Figure 6 for the recently changed areas of the document).
2. Add a new line between the opening <div class="trim"> tag and its corresponding closing </div> tag, and then type the following code. The header of this page is Home. <span class="header">Home</span> 3. To define two new classes for the trim and header, add a new line before the closing </style> tag, and then type the following CSS rules. The end result should be a trim at the top of the main content. div.trim{ background-color:#FFD400; width:750px; height:60px; position:relative; top:0px; font-size:30px; /* The stuff below this is CSS3 styling and not required, but recommended */ -webkit-box-shadow:0px 2px 6px #000; -moz-box-shadow:0px 2px 6px #000; border-radius:1px 1px 4px 4px; text-shadow:inset 3px 3px 3px #000; } .header{ color:#003399; position:absolute; top:10px; text-shadow:2px 2px 2px grey; left:10px; } 4. To see the result, save the file, and then refresh the page in the browser window.
NOTE: Make sure to save the file in the same directory that contains the index.html file.
4. Click the Save button. 5. To add a header to the new page, add the word Videos between the opening <span class="header"> tag and the closing </span> tag.
7. To see the result, save the file, and then view the web page in a browser window.
Checkpoint Three
This is the third checkpoint within this handout. Make sure that the videos.html file that is being created is similar to the checkpoint_3.html file located in the data files folder (see Figure 7 and Figure 8 for the recently changed areas of the document).