210 likes | 352 Views
Creating Simple Pages. HTML Overview. Objectives:. Students will learn: How HTML tagging works How browsers display tagged documents How an HTML document is structured. Introducing…..the HTML Tag. All web pages are formatted using HTML tags
E N D
Creating Simple Pages HTML Overview
Objectives: • Students will learn: • How HTML tagging works • How browsers display tagged documents • How an HTML document is structured
Introducing…..the HTML Tag • All web pages are formatted using HTML tags • An abbreviation of a formatting instruction or page element • Most HTML tags are container tags • 2 tags (beginning and end) • Wrapped around a range of text • End tag looks same as start tag, except it has a /. • <tag>the content the tag affects </tag> • A few tags are standalone tags • Drop them into place where you want an element to appear • Standalone elements do not need end tags • <tag>other content
Assembling a Web Page • 4 Step Process • Setting up the HTML document. • Formatting text. • Adding graphical elements • Adding a hypertext link.
Step 1: Setting Up The HTML Document • Giving the document basic structure • All web pages require a set of structural tags that help the browser sort out the parts of the document. • HTML documents have two parts • Head (also called a header) • <head> • Contains descriptive information about the document (title) • Body • <body> • Contains the actual content that displays in the browser window • You must identify the document as being written n HTML with <html> tags.
Step 1: Setting Up The HTML Document Basic HTML skeleton structure <html> <head> </head> <body> </body> </html>
Let’s Try It Complete Exercise 6-1 Part 1handout
Step 1: Setting Up The HTML Document • Giving the page a title • Title is the name you give a page and it shows up in the title bar at the top of the browser window. • Use <title> container tags and it goes within the head of the document • Importance of title • Listed in Favorites or Bookmarks menu • First thing search engines look at when indexing pages
Step 1: Setting Up The HTML Document • Saving and Viewing the page • Save with the ending .htm or .html in order to be recognized by the browser as a web document
Let’s Try It Complete Exercise 6-1 Part 2handout
Step 2: Formatting Text • Let’s Try It • Complete Exercise 6 parts 3 and 4
Step 3: Adding Graphical Elements • Introducing attributes • Attributes are instructions added within a tag to modify its behavior or appearance. • Example: <tag attribute=“value”> • Attributes can appear in standalone tags or container tags. • Appear only in the beginning tag of the container tags • Example: <tag attribute=“value”>affected text</tag>
Step 3: Adding Graphical Elements • About Attributes • Go only in the opening container tag • Closing tag includes just the tag name • Most (not all) take values, which follows an equals sign (=) after the attributes name • Value must be a number, word, string of text, URL or measurement • Attribute value should always appear within quotation marks. • Several attributes can be added within a single tag • Some attributes are required • Src within an <img> tag.
Let’s Try It Complete Exercise 6 part 5
Step 4: Adding a Hypertext Link • Linking • Links are added with a container tag called an anchor <a>…</a> • Placed around the text that you want to serve as a link • Need to specify which page you want to link to • href= • Required attribute • Give the browser the URL of the target page
Let’s Try It Complete Exercise 6 part 6
When Good Pages Go Bad • Having Problems • “I’ve changed my document, but when I reload the page in my browser, it looks exactly the same.” • It could be you didn’t save your HTML document before reloading or you saved it in a different directory. • “All the text on my page is HUGE!!!” • Did you start a heading tag and forget to close it? Make sure each tag you’ve used has its end tag. Also, make sure that each end tag has a slash (/). • “Half of my page has disappeared!” • This could happen if you are missing a closing bracket (>) or a quotation mark within a tag. This is a common error when writing HTML code by hand. • I put in a graphic using the <img> tag, but all that shows up is a broken-graphic icon. • The broken graphic could mean that the browser is not finding the graphic. Make sure the URL to the graphic is correct. Make sure the graphic is actually in the directory you’ve specified. If there, then make sure it’s in a format the browser can display (GIF, JPEG, or PNG) and it’s named with the proper suffix (.gif, .jpeg, or .png).
Let’s Try It Complete Exercise 6 part 7
Questions • What makes a container tag different from a standalone tag? • Write out the code for the basic skeleton of a web document.
Questions Mark whether each of these filenames is an acceptable name for a web page by circling “Yes” or “No”. If it is not acceptable, provide the reason why.
Questions • All of the following tags are incorrect. Describe what is wrong with each one, then write them correctly. • <img “birthday.jpg”> • <i>Congratulations!<i> • <a href=“file.html”>linked text</a href=“file.html”> • <p>This is a new paragraph<\p>