Module 2: XHTML Basics LESSON 1 Lesson Overview In this lesson, you will learn to: Write XHTML code using a text editor application such as Notepad. View Web pages created with XHTML code. Create a comment within an XHTML document. Format text within a Web page. Creates tags with attributes.
Module 2: XHTML Basics LESSON 1 Guiding Questions for Lesson 1 How do Web designers create Web pages? What tools are needed to create a Web page or site? How is a Web page viewed from the browser?
Module 2: XHTML Basics LESSON 1 Web Page Structure XHTML is an example of a publishing language for the Internet XExtensible HHyper TText MMarkup LLanguage
Module 2: XHTML Basics LESSON 1 Viewing Web Sites Web browsers Internet Explorer Mozilla Firefox Netscape Navigator Apple Safari And others Web sites may appear differently when viewed in different browsers
Module 2: XHTML Basics LESSON 1 Copy this code into a Notepad document: Tags and Attributes It’s time to learn how XHTML tags are used to create Web pages. All XHTML pages begin with the html (the html must be included inside the brackets) tag and end with the /html (the /html must be included inside the brackets). Considering the huge amount of information on the Internet, Web pages are created from a surprisingly small number of tags, and you will find that they are easy to learn and use. The HEAD element (delineated by the head and /head tags) comes next and serves as a box or container that can hold a variety of other elements, including the TITLE element. The TITLE element contains the words that appear on the title bar or page tab in the browser window. In this example, “Tags and Attributes” is the title.
Module 2: XHTML Basics LESSON 1 Create an XHTML file Save the code that you just created as “tags.html” The extension.html designates a file to be opened by a browser Access the file and open it
Module 2: XHTML Basics LESSON 1 Does your work look like this:
Module 2: XHTML Basics LESSON 1 How will the following examples of text be displayed by a Web browser? How would this text look different? bolded text Does this look any different? strong or bolded text How would this text be displayed? italicized text Same as italicized? italicized text This tag might be useful for titles. underlined text (deprecated) How would this tag change things? text color would be red
Module 2: XHTML Basics LESSON 1 Text size Text size can be altered by the use of tags This tag creates large text Creates a slightly smaller text Is smaller yet, but still large Starts getting smaller Now the text is getting small And finally, this is the smallest
Module 2: XHTML Basics LESSON 1 Creating a Break Browsers ignore the use of the “enter” key To force the browser to place text on the next line use the “break” tag Try placing a break tag in your work after the phrase “easy to learn and use.” View your Web page again. How did it change?
Module 2: XHTML Basics LESSON 1 Creating a Paragraph vs. … places the text on the next line … creates a block or paragraph of text Remove the tag in our work that you just added Place an opening paragraph tag after the tag Place a closing paragraph tab after the phrase “easy to learn and use.” Refresh your Web page and look at the difference.
Module 2: XHTML Basics LESSON 1 Creating a Comment Why would a Web designer what to use a comment? Comments can be created using code Comments do not show in the Web page when viewed
Module 2: XHTML Basics LESSON 1 Lesson Review Explain how to write the code for each of the following situations: Bold Underlining Italics What is the tag for the largest size and smallest size text? What does a comment code look like? Explain the difference between and …
Module 2: XHTML Basics LESSON 1 Practice: XHTML Basics Create the following changes in your “Tags and Attributes” Web page: Add the text “Tags and Attributes” at the beginning of the body. Make the “Tags and Attributes” be displayed as h1 in size. Make the “Tags and Attributes” be display as bolded text. Make the “Tags and Attributes” be display as underlined. Make the rest of the document display as h4 in size. Italicize all the words that are all caps. (Hint: There are five words in all caps.) Add a comment for your name and the date.