Documente Academic
Documente Profesional
Documente Cultură
HTML
HTML (Hyper Text Markup Language) is a language used to create web documents. It defines the syntax and placement of the element that make up of the structure of a web document. All web page elements are identified by special tags.
Tag
It is a command that tells the browser what to do. A tag consists of element name and option list attributes. The element and the attributes appear between angled bracket <>. There are two types of tags. 1. Container tags: Have start and end tags. Example: <b></b>, to make a text bold. 2. Stand alone tags: Have start tag only. Example: <hr> horizontal line
Attributes
Are added with in a tag to extend or modify the tag action. Always go in start tag Can have more than on attribute in a tag, separated in space. Syntax: <Tag name Attribute1 name=Value attribte2 name=value> Example: <body bgcolor=red text=#dfcdfa> Example: Assume you have a tag whose element name is I, and assume a tag is a container. Enclose the text Internet programming by this tag. Also we can nest tags with in inside of other tags. Example: <b><i> Text here</i></b>
Note: color can be either in name or in hexadecimal value for (R-G-B). <HTML> <head> <title> </title </head <body bgcolor=#fdca23 text=blue> Document content here </body> </HTML> Note: when you use background and bgcolor properties at the same times priority is given for the back ground, and hence using them together is inadvisable. Text Formatting 1. Paragraphs and heading: a. Paragraphs <p>.</p> tag is used. Denotes the beginning and end of paragraph. Have properties like Align=center, left, right Example: <p align=center> Text here</p> <blockquote>..</blockquote> to add indent from left and right. b. Heading They are block level elements They are from<h1>..</h1> to <h6>.</h6> 2. Text Appearance They are inline elements. Example: o <b></b> to make a text bold o <i></i> to make a text italic o <u></u> to make a text underline o <s></s> to make strike through o <sup>.</sup>- to make super script o <sub>..</sup> to make subscript
Exercise:: List more text appearance tags. 3. Spacing and positioning Example: o <br> - insert line break or new line o <center>----</center> to make the text at the center o <pre>----</pre> the text appear as it was in its format when edited in text editor. o <nobr>---</nobr> the text will appear in one line only, and the browser creates horizontal scroll bar. Exercise:: 1. develop html code that display the following Name Henok Dave Zelalem ID 676 545 232 Dept IT TVET EEng
2. What is the output of the following code <HTML> <head> <title> </title </head <body> A <br> B C <br> D </body>
4. Lists: In html there are three basic list styles. a. Unordered Lists: o They are bulleted style o Use <li></li> tag o Produced by <ul>---</ul> tag b. Ordered Lists: o They are numbered style o Use <li></li> tag o Produced by <ol>---</ol> tag c. Definition lists: o Lists enclosed by <dl></dl> tag and have: o Terms which are created by <dt></dt> o Definition which are created by <dd>---</dd> Note: It is possible to use type attribute to change the bulleting and numbering style. For unordered type=disc/ circle/ square/ but the default is disk For ordered type= 1/I/ I / A / a but default is 1 Exercise:: Write html code that display the following Computer Electronic machine RAM Random Access Memory TCP/IP Transmission protocol
Asia
1. Africa a. Ethiopia i. Adama ii. Addis Abeba b. Kenya 2. Asia a. China b. Japan
5.
..®
Exercise:s: 1. List more character entity reference 2. Develop the following html tag out put <B> <i> <U> To make bold To make italic to make underline
Creating Links
The anchor <a> tag is used to create links in html, which identifies a string or image which serve as a link. <a href=URL path>Displayed text</a> The anchor<a> tag has target attribute which shows where to open the document either in new window or parent. That is <a href=# target=_blank></a> The URL can be absolute of relative. Absolute addressing:
Example: 1. Create a link to z.html in both cases for the following directory. Assume you are in y.html file. C:\ A B Z.html Exercise:: Read more about advantages of relative addressing and absolute addressing. Adding Images <Img>> tag insert an image in to the document text flow. This tag is stand alone tag. <img src=URL path> Also use can use image as a link in <a> tag. <a href=URL path> <img src=URL Path></a> Some attributes of <img> tag Alt used to supply alternative text if the image not displayed. Width=number specify width of image Height=number specify height of image Align=bottom/ middle/ top and Left, Right X.html y.html
Horizontal Rule
<hr> tag is used to add horizontal line. May be the line is larger or smaller then the text. Attributes of <Hr> tag Size=thickness of line Width=length of line in number of pixel NB: pixel is the minimum dot that a computer can draw.
</tr> </table> </body> </HTML> <th> tag can be used for heading, and similarly act as <td> tag. The only difference in the <th> tag the text are bold. <caption> tag used to add description for a table.
10
Devision Regular
Monthly
225 125
Affecting appearance of a table The followings are some of the attributes that use for affecting display of a table. Border: affect the display of a boarder of around and with in a table. o Syntax: <table border=value>
11
12
Frames
Frames are methods of dividing the browser window in to smaller sub windows, each displaying a different HTML document. To divide a window Frameset documents are fundamentally different from other html documents in that they use the <frame> tag instead of <body> tag. Establishing rows and columns Rows and cols attributes of < frameset> tag are used to set the rows and columns respectively. Example: <html> <head> <title>Frame example</title> </head> <frameset cols=*, *> <frame src=1.html> <frame src=2.html> </frameset> </html> NB: the row and column number can be written in percent(%) like 20%.
13
5.
1.
2. 4. 7.
3. 5. 8.
6. 9.
14
Forms
A from allow us to accept input from the user. There are varieties of elements that can be used for gathering information. Elements in a form tag are enclosed by <form> ..</form> tag. The following are some of the attributes o Name name of the form o ID identifies uniquely the form o Action URL of an application that process the data in the form. o Method used to submit the form. Have get/ post value. Form elements 1. Input controls: Created using <input> tag. Type attribute specifies the type of the control. Text/ password/ checkbox/ radio/ submit/ reset/ file/ button are possible values of type attribute. 2. Text Area: Multi line text box. Created <textarea></textarea> tag Have cols and rows attribute in the <textarea> tag. 3. Menus: Commonly used menus are drop down menu and list box. Created using <select> .</select>tag Size attribute in <select> tag is used to indicate number of lines displayed under the drop menu. <Option> . </option> tag is used to indicate the list of items. Example: simple login form <form name=login> Username <input type=text name=login> <br> Password<input type=password name=pswd> <br> <input type=submit name=submit value=login>
15
Register
Clear
16