Presentation is loading. Please wait.

Presentation is loading. Please wait.

Lecture Note 2: About HTML.  Getting Started  Getting Started Firstly, HTML works by applying tags to text and page elements, so that the browser.

Similar presentations


Presentation on theme: "Lecture Note 2: About HTML.  Getting Started  Getting Started Firstly, HTML works by applying tags to text and page elements, so that the browser."— Presentation transcript:

1 Lecture Note 2: About HTML

2  Getting Started  Getting Started Firstly, HTML works by applying tags to text and page elements, so that the browser can understand how to render the page correctly. These tags appear thus: You'll also need to know the file referencing scheme used in HTML. You can either link to files relatively:../index.html The above means to go back one directory relative to the current document, and use the file index.html. /index.html The above means to use the file, index.html in the root directory. or you can link to files absolutely: http://www.ncku.edu.tw/aspcourse/html/ The above uses the HTTP protocol to reference a URL on the World Wide Web. This method is most commonly used for external linking to other sites.

3 The Basics The Basics –The basics cover the tags you need in order for the page "to exist". This doesn't include what goes in the page; it includes only what you need in order for the browser to recognize that it truly is a Web page. – This is the basic tag for every page. It tells the browser that the file being loaded is a HTML document. Look at the basic layout of any Web page to see how it's used. – This defines the head of your page. Incorporates the tag. – This allows you to define the body arguments. They can include: BACKGROUND="file.gif" sets an image file to be tiled as the backdrop to the page elements. BGCOLOR="#rgbcode" Sets the background color. TEXT="#rgbcode" - sets the text color LINK="#rgbcode" - sets the link color VLINK="#rgbcode" - sets the visited links color TOPMARGIN=x - defines the top margin for the body LEFTMARGIN=x - defines the left margin for the body RIGHTMARGIN=x - defines the right margin for the body RIGHTMARGIN=x - defines the right margin for the body

4 } 標題設定區 } 標題設定區 } HTML 網頁本文區 } HTML 網頁本文區

5 – This allows you to display a title at the top of the browser. (less than 20 words) – This allows the owner to display certain information to the browser without the page seeing it. Here are some examples: Describes your page's contents Enters keywords for your page Reloads the page after 10 seconds to index2.html

6 Text Control Text Control This allows you to change the size of letters or words. Includes H1 - H6, H1 being the biggest and H6 being the smallest. This allows you to display the text in the center of the page. This formats certain text as a quote. This makes the text bigger than the rest. This makes the text smaller than the rest. This allows you to make the text look like this. This gives a superscript effect to your text. This abbreviates certain text.

7 歡迎光臨 ASP Class 歡迎光臨 ASP Class << 介紹 HTML>> << 介紹 HTML>> lovely 俊安 lovely 俊安 from Alice from Alice Class 2003 NCKU SNME &nbsp 推薦 Class 2003 NCKU SNME &nbsp 推薦 Teacher Prof. Joe Yang Teacher Prof. Joe Yang

8 Text Control Text Control This allows you to control different aspects of the text. Includes: SIZE=x (x = +1 to +5 or -1 to -5) COLOR=#rgbcode defines the color, FACE="name" defines the font face This makes a word or group of words bold. This is the same as bold. This italicizes a word or group of words. This is the same as italics. This underlines a word or group of words. This makes a fixed width font. This indents the left and right-hand sides of the text.

9 歡迎光臨 ASP Class 歡迎光臨 ASP Class 綠色 size=5 的標楷體字體 綠色 size=5 的標楷體字體 標籤 ~ 粗體文字 標籤 ~ 粗體文字 標籤 ~ 加底線文字 標籤 ~ 加底線文字 標籤 ~ 斜體文字 標籤 ~ 斜體文字 Sup 標籤 ~ 數學公式 Sup 標籤 ~ 數學公式 2X 2 +4X 5 =50 2X 2 +4X 5 =50 Sub 標籤 ~ 化學公式 Sub 標籤 ~ 化學公式 2H 2 +1/2O 2 =H 2 O 2H 2 +1/2O 2 =H 2 O Teacher Prof. Joe Yang Teacher Prof. Joe Yang

10 Text Control Text Control This is another italics tag. This is another fixed width font tag. This allows you to embolden or italicize a word or group of words. This allows the text to appear in the browser in the same format (layout) as it does in a text editor, such as Notepad, for example. This is a small fixed-width font tag - somewhat similar to that spaces everything out.

11 歡迎光臨 ASP Class 歡迎光臨 ASP Class Hello ASP Class Student Hello ASP Class Student This is a test text for the ASP class 2006 This is a test text for the ASP class 2006 Best regards, Best regards, Joe Yang Joe Yang

12 歡迎光臨 ASP Class 歡迎光臨 ASP Class Hello ASP Class Student Hello ASP Class Student This is a test text for the ASP class 2006 This is a test text for the ASP class 2006 Best regards, Best regards, Joe Yang Joe Yang

13 Lists Lists This defines the list items within a descriptive list. This defines the topic of the descriptive list. This defines the indented item to be displayed in the descriptive list. This is a way to group items into a numbered list. It uses the tags to list the items. This defines the list items with a number or a dot. Includes the following: START="x" TYPE="A/a/I/i" for upper or lower case and Roman numerals. This is another way to list items. Also uses the tags to define the list items with a bullet instead of a number. Includes the following options: TYPE="disc/circle/square"

14 歡迎光臨 ASP Class 歡迎光臨 ASP Class Hello ASP Class Student Hello ASP Class Student This is a test text for the ASP class 2006 This is a test text for the ASP class 2006 Hello Again Hello Again test test

15 歡迎光臨 ASP Class 歡迎光臨 ASP Class OK books OK books Office books Office books Office 2000 books 4. Office 2000 books Office 2000 books 4. Office 2000 books Word 2000 books 5. Word 2000 books Word 2000 books 5. Word 2000 books FrontPage 2000 books 6. FrontPage 2000 books FrontPage 2000 books 6. FrontPage 2000 books Internet books Internet books Internet IE5.0 i. Internet IE5.0 Internet IE5.0 i. Internet IE5.0 Internet IE4.0 ii. Internet IE4.0 Internet IE4.0 ii. Internet IE4.0 >

16 Page Breaks and Lines Page Breaks and Lines This allows you to divide a page with a line. Includes the following options: WIDTH=x (x = pixels/percentage) ALIGN=x (x = left/right/center) SIZE=xM NOSHADE takes away the shading. This allows the text to break without a full paragraph. The options are: CLEAR="x" (x = left/right/all) This allows the text to continue indefinitely without breaking.

17 Tables, Frames, and Forms Tables, Frames, and Forms These allow you to insert tables. It has the following options: ·WIDTH="x" ·HEIGHT="x" ·BORDER="x" ·CELLPADDING="x" ·CELLSPACING="x" It also includes the following tags with their associated options: · ·ALIGN=left/middle/right ·VALIGN=top/middle/bottom ·COLOR=#rgbcode ·COLSPAN="x" ·ROWSPAN="x"

18 Tables, Frames, and Forms Tables, Frames, and Forms This allows you to set up frames on your page. Includes the following: ·ROWS="x" (x = pixels/percentage) ·COLS="x" (x = pixels/percentage) ·FRAMEBORDER="x" ·FRAMEWIDTH="x" ·MARGINHEIGHT="x" ·MARGINWIDTH="x" Requires the frame tag to establish content. These include: ·MARGINHEIGHT="x" ·MARGINWIDTH="x" ·NAME="name" ·NORESIZE ·SRC="file.html/file.gif/file.jpg" ·SCROLLING="x" (x = yes/no/auto) Don't forget the tag for those browsers who can't handle frames.

19 Tables, Frames, and Forms Tables, Frames, and Forms This establishes content. Its attributes include: ·MARGINHEIGHT="x" ·MARGINWIDTH="x" ·NAME="name" ·NORESIZE ·SRC="x" ·SCROLLING="x" ( x = yes/no/auto)

20 Tables, Frames, and Forms Tables, Frames, and Forms This allows you to insert forms in your page. It includes the following options: ·METHOD="POST/GET" ·ACTION="file/script" You can also add checkboxes, text boxes and more. For example: <INPUT TYPE="text/hidden/checkbox/radio/submit/reset“ SIZE="n" MAXLENGTH="x" NAME="name" VALUE="presettext"> Value1 <TEXTAREA NAME="name" ROWS="x" COLS="x“ VALUE="preset text" WRAP="virtual">

21 Images and Links Images and Links This allows you to make certain text or picture a link to another page or graphic not on the page. It can include the following options: ·TARGET="framename" ·HREF="path/to/a/file" - reference to the linked file ·NAME="name" - sets a marker within a document so that a specific section of a page may be linked to via "#sectionnamehere" with the HREF attribute This allows you to insert an image into your Web page. It has the following options: ·SRC="file.gif"/src="file.jpg" ·HEIGHT="x" ·WIDTH="x," ·LOWSRC="file.gif" - allows a low resolution image to be displayed while a higher resolution image loads ·ALT="text for older browsers" ·USEMAP=#mapname ·ISMAP ·ALIGN="x" - sets the image alignment on the page (x = left/right/middle /bottom/top/absmiddle/textop/absbottom) ·BORDER="x“ This defines the areas and coordinates of an image map.

22 Java Applets, JavaScript, and Miscellaneous Tags Java Applets, JavaScript, and Miscellaneous Tags This allows you to insert a Java applet directly into your page. It includes: ·CODE="java.class" ·CODEBASE="/dir/to/applet" ·HEIGHT="x" ·WIDTH="x" Javascript allows a script to run within the page. This tag usually appears in the part of the document, but can also appear within the tag. Allows text to appear invisible on the page. This is used if you would like to write comments on the page but not have them load in the browser. For example:

23 The Response Object The Response Object The Write method of the ASP Response Object is used to send content to the browser. For example, the following statement sends the text "Hello World" to the browser:

24  VBScript  VBScript You may use different scripting languages in ASP files. However, the default scripting language is VBScript: The example above writes "Hello World!" into the body of the document.

25  JavaScript  JavaScript To set JavaScript as the default scripting language for a particular page you must insert a language specification at the top of the page: Note: Unlike VBScript - JavaScript is case sensitive. You will have to write your ASP code with uppercase letters and lowercase letters when the language requires it. Note: Unlike VBScript - JavaScript is case sensitive. You will have to write your ASP code with uppercase letters and lowercase letters when the language requires it.

26  Other Scripting Languages  Other Scripting Languages ASP is shipped with VBScript and JScript (Microsoft's implementation of JavaScript). If you want to script in another language, like PERL, REXX, or Python, you will have to install script engines for them.


Download ppt "Lecture Note 2: About HTML.  Getting Started  Getting Started Firstly, HTML works by applying tags to text and page elements, so that the browser."

Similar presentations


Ads by Google