1 / 20

Web Programming

Web Programming. Basics of HTML. Basics of HTML. HTML stands for Hyper Text Mark-up Language A mark-up language is different than those that you have learned before in Computer Science. A mark-up language places what are called tags at the beginning and end of words that you want displayed.

gabby
Télécharger la présentation

Web Programming

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Web Programming Basics of HTML

  2. Basics of HTML • HTML stands for Hyper Text Mark-up Language • A mark-up language is different than those that you have learned before in Computer Science. A mark-up language places what are called tags at the beginning and end of words that you want displayed. • Tags are placed into what we will call carrots < >.

  3. Open internet Explorer and go to: http://jhhs.dist214.k12.il.us/ • Click on view…source • What do you see? • This is much more complicated than any page that you will do this semester.

  4. Lets start our first page • You should have two programs open right now. Internet Explorer and Notepad. • Maximize notepad • Click on file..new

  5. Type exactly what you see here: <html> <head> <title></title> </head> <body> </body> </html>

  6. HTML is not case sensitive. <title> is equivalent to <TITLE> or <TiTlE>. There are a few exceptions which we will talk later about. • The words you write are called source code. • If we wanted to make the word HELLO bold on a webpage, we need to know that the bold tag is <B>. When we use this tag, anything that follows will be bold. • What you would type in order to make the word “Hello” bold would be: <B>HELLO

  7. If I have a sentence to be displayed, but only want one word bold, I have to mark where to start making the text bold and where to end. Usually, but not always, the ending tag is the same as the start tag with a slash ( / ) before it. • The line: Who <b>Goes</b> There would print the words Who and There in normal font, but would make the word Goes bold on the screen

  8. You will write the source code for a web page in any text editor like: • Simple Text • Notepad • Any word processor ( as long as it is saved as text only) • The web browser (ie, Netscape, Internet Explorer) will read your source code and translate it into the way you want the words and pictures displayed. Note: There are differences in how web browsers show content

  9. Click file …. Save • Navigate to your file folder named Prog - 2 • Make sure you save the file as a text document. • Give the file the name BlankWebPage.htm • What we just did was to create a template for the web-pages that you will design. Use this to start each page.

  10. Lets begin our first page • Go back to notepad and make sure it says exactly what you see here: <html> <head> <title></title> </head> <body> </body> </html>

  11. Every page you write will begin with what you just typed. • Notice the first and last things are an opening tag and closing tag named html. This tells the web browser that you will be “speaking” HTML in the document. • Next is the opening head tag. Between the open and closing head tags is called the header. This is where you will be giving the page information about how it was created and when.

  12. In the header, you will see an opening and closing title tag. • Between them, type HELLO WORLD <title>Hello World</title> • Time to save. Click save as.. • Give the name of file and make sure it has an extension of .htm or .html or the browser will not read it. • Make sure it is in your file folder.

  13. We are now ready to view our first web page. Open Internet Explorer. Select file…open and navigate to where your file is saved. • Take a look at what you have created. Not much is it? Where did the Hello World get put? See the page: In Browser • If you want to see the source code click on view….source.

  14. As you saw, what you put in the title section of the header is placed at the top of the browser window. • If you want something to be displayed in the browser window, the code needs to be in the body section of the page. If you have not guessed by now, the body section is between the <body></body> tags. • Try putting Hello World in the main browser window! ( make sure you save and reload )

  15. Here are some of the common formatting tags to make words look different: Attributes for Font Types: • <hl></hl>Creates the largest headline • <h6></h6>Creates the smallest headline (headers 1-6 work) • <b></b>Creates bold text • <i></i>Creates italic text • <tt></tt>Creates teletype, or typewriter-style text • <strong></strong>Emphasizes a word (with italic or bold) • <font size=?></font>Sets size of font, from 1 to 7) • <font color=?></font>Sets font color, using name or hex value. Put the text in quotes. • <u></u>Underlines Words

  16. Create a new program and play. Type: <html> <head> <title>Test Page</title> </head> <body> <h1>HelloWorld</h1> </body> </html> • Click save, go to IE click refresh and see what happens. Do this with each of the tags on the last page.

  17. Here are some of the common formatting tags to make the page look different: Attributes for formatting: • <br>Begins a new line • <center></center> Centers text in the browser window • <p></p>Creates a new paragraph • <p align=?>Aligns a paragraph to the left, right, or center. Put the word in quotes. • <hr>Inserts a horizontal rule • <hr size=?>Sets size (height) of rule • <hr width=?>Sets width of rule, in percentage or absolute value • <hr noshade>Creates a rule without a shadow

  18. Create a new program and play. Type: <html> <head> <title>Test Page</title> </head> <body> Hello World<br> </body> </html> • Click save, go to IE click refresh and see what happens. Do this with each of the tags on the last page.

  19. Assignment • Create a web page that looks exactly like what you will see on the next page. When you are done, turn in the source code into the top bin. This is where you will turn in all assignments.

More Related