Presentation is loading. Please wait.

Presentation is loading. Please wait.

Introduction to basic HTML

Similar presentations


Presentation on theme: "Introduction to basic HTML"— Presentation transcript:

1 Introduction to basic HTML
Exploring Computer Science – Lesson 3-2

2 Objectives The student will be able to: Navigate an html editor.
Create an html page with a title and a body. Create an html page with paragraph tags, headings, line breaks, horizontal lines and lists. Objectives

3 Web pages are just plain text
Web pages are just plain text. You can view or edit the source code using any text editor. "Tags" provide web browsers with instructions about the web page, such as where to display images, and how the document is structured. Tags are always enclosed in angle brackets: < >. HMTL

4 Tags are comprised of elements and attributes
Tags are comprised of elements and attributes. An element is an object on a page (such as a heading, paragraph, or image), and attributes are qualities that describe that element (such as width and height). Tags usually travel in pairs. An opening tag begins a section of page content, and a closing tag ends it. For example, to markup a section of text as a paragraph, you would open the paragraph with an opening paragraph tag <p> and close it with a closing paragraph tag </p> (closing tags always proceed the element with a /). HMTL

5 A few tags are called non-container tags, because they don't contain any content - they stand alone. Examples are images and line breaks. XHTML is more strict than HTML, and requires that all open tags must be closed, even if they're not container tags. Therefore, non-container tags end in />. For example, the tag for a line break is <br />. HTML does not have this same requirement, but it's a good habit to get into in case you ever need to code in XHTML. Tags in HTML are not case sensitive, but in XHTML all tags must be in lower case. Even when coding in HTML, you should get in the habit of writing tags in lower case. HMTL

6 White space is ignored by web browsers
White space is ignored by web browsers. So, if you hit the space bar multiple times within a document, only one of those spaces will actually be displayed by the browser. Tags can be nested. For example, <div><p>This paragraph is nested inside a division</p></div>. Note that the order of nested tags is important: The container tags surrounding any content should be symmetrical. HMTL

7 Notepad++ The editor we will be using for HTML code is Notepad++
It’s this icon on the screen. Once a file is saved as an HTML file (.html), Notepad will color code items to make things easier to debug. Notepad++

8 HTML Tags - Document Structure
Opening Tag Closing Tag Description <html> </html> Identifies the document as HTML. <head> </head> Identifies the header section of your document, which is used to provide information about the document for use primarily by search engines and browsers. <title> </title> The title of document. This element must be nested within the head elements. <body> </body> Contains all the visible content of a web page. HTML Tags - Document Structure

9 Create Your First Web Page
<html> <head> <title>First Web Page</title> </head> <body> Some text goes here. This will show on the screen </body> </html> Create Your First Web Page

10 Create Your First Web Page
Create a file with all the tags you see on the previous slide, In the body section of your web page create a heading and a paragraph on your topic. Save the file (make sure you add .html at the end of the file name. Open your web page in a browser Fix any problems you see! You have 5 minutes Create Your First Web Page End

11 Create Your First Web Page
Continue your web page. Add your other paragraph and your lists. Save the file and open it as a web page. How does it look? You have 5 minutes Create Your First Web Page End

12 HTML uses tags to control the layout on the page.
HTML TAGS

13 HTML Tags - Content (Container) Tags
Opening Tag Closing Tag Description <h1> to <h6> </h1>to</h6> Headings. <h1> is the main heading, <h2> is secondary, etc. <p> </p> New paragraph. <ol> </ol> Makes ordered lists. <ul> </ul> Makes unordered (or bulleted) lists. <li> </li> Marks items in either the ordered or unordered list. HTML Tags - Content (Container) Tags

14 Create Your First Web Page
<h1>Reflection</h1> <h2>Unit 2</h2> <p>This is where you include your first reflection. The reflection has to include either a ordered list or an unordered list. The questions that need to be addressed in the reflection are:</p> <ul> <li>What did you learn?</li> <li>How do you know you learned it?</li> </ul> <p> Reflections will be written at the end of each Unit and will be part of the index.html file. Reflections will be 10% of your grade.</p> Create Your First Web Page

15 Use the HTML tags to fix up your web page
Use the HTML tags to fix up your web page. Can you make it look as you expect? You have 10 minutes HTML TAGS End

16 HTML non-Container TAGS
There are some tags that you close at the same time as you open them. These are called non-container tags and the / is moved to the end. HTML non-Container TAGS

17 HTML Tags - Content (non-Container) Tags
Opening Tag Description <br /> Causes a line break. It may be repeated for multiple line breaks. <hr/> Defines a horizontal line (draws a line across the page) HTML Tags - Content (non-Container) Tags

18 Web Resource for HTML (and CSS)
A great resource for HTML and CSS is w3schools Look at - Bookmark this site! Web Resource for HTML (and CSS)

19 Rest of Today Complete coding the web page you drew last time.
Use all the HTML tags that you learned in class today. Print out your web page, staple it to you storyboard and turn in before you leave today. Rest of Today


Download ppt "Introduction to basic HTML"

Similar presentations


Ads by Google