Вы находитесь на странице: 1из 26

Introduction to HTML

Contents Getting Started.. What is HTML? How to create and View an HTML document? Basic HTML Document Format The HTML Basic tags

4/5/2012

MNNIT

What the following term mean:


Web server: a system on the internet containg one or more web site Web site: a collection of one or more web pages

Web pages: single disk file with a single file name


Home pages: first page in website

Think about the followings before working your Web pages.


Think about the sort of information(content) you want to put on the Web.

Set the goals for the Web site.


Organize your content into main topics. Come up with a general structure for pages and
4/5/2012

topics.

MNNIT

What is HTML?
Telling the browser what to do, and what props to use. A series of tags that are integrated into a text document. Tags are ; surrounded with angle brackets like this
<B> or <I>.

Most tags come in pairs


exceptions: <P>, <br>, <li> tags

The first tag turns the action on, and the second turns it off.

4/5/2012

MNNIT

The second tag(off switch) starts with a forward slash.


For example ,<B> text </B>

can embedded, for instance, to do this:


<HEAD><TITLE> Your text </HEAD></TITLE> it won't work. The correct order is <HEAD><TITLE> Your text </TITLE></HEAD>

not case sensitivity. Many tags have attributes.


For example, <P ALIGN=CENTER> centers the paragraph following it.

Some browsers don't support the some tags and some attributes.

4/5/2012

MNNIT

Basic HTML Document Format

<HTML> <HEAD> <TITLE>WENT'99</TITLE> </HEAD> <BODY> Went'99 </BODY> </HTML>

See what it looks like:

4/5/2012

MNNIT

How to Create and View an HTML document?


1.Use an text editor such as Editpad to write the document. 2.Save the file as filename.html on a PC. This is called the Document Source. 3.Open Netscape (or any browser) Off-Line 4.Switch to Netscape

5.Click on File, Open File and select the filename.html document that you just created. 6.Your HTML page should now appear just like any other Web page in Netscape.

4/5/2012

MNNIT

7.You may now switch back and forth between the Source and the HTML Document switch to Notepad with the Document Source make changes save the document again switch back to Netscape click on RELOAD and view the new HTML Document switch to Notepad with the Document Source......

4/5/2012

MNNIT

Tags in head
<HEAD>...</HEAD>-- contains information about the document <TITLE>...</TITLE>-- puts text on the browser's title bar.

4/5/2012

MNNIT

Tags in Body Let's talk Text Heading: <H1> </H1> Center:<Center> </Center> Line Break <P> ,<Br> Phrase Markups: <I></I> ,<B></B> Create a List Unordered list : <UL><li> Ordered list: <OL><li> Nested
4/5/2012 MNNIT 10

Add Images Use <IMG SRC=imagefilename> tags How to specify Relative pathnames Attributes of IMG tag
-width,height -Alt -Align -<Img src=my.gif width=50 height=50 align=right alt=My image>

4/5/2012

MNNIT

11

Add some Link Use <A href=filename|URL></a>tags How to specify Relative pathnames Kinds of URLs
-http://www.women.or.kr - ftp://ftp.foo.com/home/foo - gopher://gopher.myhost.com/ - news://news.nuri.net - mailto:skrhee@women.or.kr

4/5/2012

MNNIT

12

How to make colors changes? Hexadecimal number : Color names : <Font color=white> Changing the Background color
<BODY BGCOLOR=#19378a>

Changing Text color


<BODY BGCOLOR=#19378a TEXT=#ffffff LINK=#ffff66 VLINK=#66ffff>

Spot color
<FONT COLOR=#66ffcc>WENT'99</FONT>

Image Background

<BODY BACKGROUND=bgimg.gif >


4/5/2012 MNNIT 13

Tables
Tables are used for arranging the web layout of web page. Tag:<table>.</table> Syntax:<table align=. border=.. cell padding= cell spacing=
4/5/2012 MNNIT 14

Width= </table> Align: specifies alignment (left, right,centre) Border: specifies width to be drawn around the table.(values are 1,2,3.) Cell padding: the space bet/n content and insi de of a cell(values are 1,2,3.) Cell spacing: amount of space bet/n cells in a table.(values are 1,2,3..) Width: specify width of table.
4/5/2012 MNNIT 15

Tr: <tr></tr>(table row) To add row in a table. Bg color: used to set background color of the row. Td:<td>..</td> Stands for table data. Table sdata tags define each cell in a table. Attributes are: align-horizontal alignment of text. Colspan-width of cell in terms of rows.
4/5/2012 MNNIT 16

Rowspan-height of a cell in terms of no of Rows. Simple code for creating two rows and two Column. Example:

4/5/2012

MNNIT

17

Example
<html> <body> <table border="1" cell padding="6" cell spaci ng="6"> <tr bgcolor="cyan"> <td align="centre">name</td> <td align="centre">age</td> </tr>
4/5/2012 MNNIT 18

Conti..
<tr bgcolor="gray"> <td align="centre">gender</td> <td align="centre">phn no</td> </tr> </table> </body> </html> output:
4/5/2012 MNNIT 19

Caption: used for title. Th: used to design cell to be a header cell. Images: syntax-<img src=image file> Forms:The <form> tag is used to create an HTML form for user input. -form header -input fields 4/5/2012 MNNIT -action buttons

20

A form can contain input elements like textfields, checkboxes, radio-buttons, submit buttons and more. A forms can also contain select menus, text area, fieldset, and label elements. Forms are used to pass data to a server.
4/5/2012 MNNIT 21

form
Form header can be added to form by using <p>tag. Input elements are: text, button, checkbox, Image, password, radio, reset, submit,. Syntax: <input type= name= value= align= size=.. maxlength=..>
4/5/2012 MNNIT 22

Form attributes
Action: it informs the browser the location of server program to which the form input has to be submitted. Method: specifies how to sent form data. Enctype: specifies how form data should be encodeded before sending it to server. Selection list box: The <select> tag is used to create a select list (dro p-down list). The <option> tags inside the select element define 4/5/2012 available options in the list. MNNIT 23 the

Input elements Checkbox Radio button Text field Password field Hidden field Button Submit button Reset button

4/5/2012

MNNIT

24

CONTI.
<p>first name:<input type=text name=first name size=15><br> last name:<input type=text name=first name size=15></p> <p>message:<textarea name=textmessage Rows=5 cols=60></textarea> 5rows*60characters/rows <input type=submit value=submit> <input type=reset value=reset>
4/5/2012 MNNIT 25

Frames
Frame divide a page into number of rectangular windows of various sizes.. Frameset is the html tag used to create a framed page. <frameset rows=.or cols=.></frameset> <frame> this tag defined within frameset Container. specify what actually appear in the frameset.
4/5/2012 MNNIT 26

Вам также может понравиться