Advertisement
Guest User

Untitled

a guest
Feb 25th, 2018
75
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 17.93 KB | None | 0 0
  1. INTRODUCTION:
  2. HTML stands for Hyper Text Markup Language; which is the most widely used language on web to develop webpages. Web page contains text, graphics, animation, sound and interactive elements. It allows for download of text, picture, and so on.
  3. There are use of different tags use in HTML. It is used to describe the content of web pages. It has three sections: the tag name, attributes and value of attributes. There are two types of tags, they are:
  4.  Paired tags
  5. Paired tags has two parts: opening tags and closing tags.
  6.  Singular tags
  7.  
  8. Advantages:
  9. 1. It is widely used.
  10. 2. Every browser supports HTML language.
  11. 3. Easy to learn and use.
  12. 4. It is by default in every windows. So you should not need to purchase extra software.
  13. Disadvantages:
  14. 1. It is unable to create dynamic pages.
  15. 2. Need to write a lot of codes.
  16. 3. Security features aren’t good in HTML.
  17. 4. It produces complexity.
  18. Basic structure of HTML:
  19. Every HTML programs begins with <HTML> and end with </HTML> and has two sections-head section and body section as shown in figure below.
  20.  
  21.  
  22.  
  23.  
  24.  
  25.  
  26.  
  27.  
  28.  
  29.  HEAD SECTION:
  30. Head section is used to specify the title and information about web page (i.e. the head element contains information and tags describing the document, such as its title).The head section begins with < head>tag and end with </head>tag.
  31.  BODY SECTION:
  32. It contains the actual information that to be displayed by web page-in the form of tags and plain text. It start with <body> and end with </body>.
  33. Attributes of <body>tag with their values are:
  34. Attributes Values Description
  35. Bgcolor color name /color code to specify the background color of web page.
  36. Background url of image to specify image file background image of page.
  37. Text color name/color code to specify the color of text in a web page.
  38. link color name/color code to specify the color of hyperlink before click.
  39. Alink color name/color code to specify the color of active link.
  40. Vlink color name /color code to specify the color of visited link.
  41. Top margin number in pixel to specify top margin of page.
  42. Bottom margin number in pixel to specify bottom margin of page.
  43.  
  44. Example -1:
  45. <HTML>
  46. <HEAD>
  47. <TITLE>Frist webpage </TITLE>
  48. </HEAD>
  49. <BODY bgcolor=‘#ccfcc’>
  50. Frist webpage
  51. <BODY>
  52. </HTML>
  53.  
  54.  
  55. Character Formatting (Paragraph, Heading, Text format)
  56.  PARAGRAPH:
  57. The <P> tag is used to specify the paragraph. HTML will automatic add blank line before and after paragraph.
  58. Attribute of <paragraph tag with their value are:
  59. Attributes Values Description
  60. Align Left/right/center/ to specify the alignment of paragraph ,default is left
  61.  
  62. Example-2:
  63.  
  64. <HTML>
  65. <HEAD>
  66. <TITLE> FIRST WEBPAGE</TITLE>
  67. </HEAD>
  68. <BODY bgcolor=‘#ccfcc’>
  69. <P ALIGN = ‘RIGHT’>
  70. This is for right align.
  71. </P>
  72. <P>
  73. This is default align paragraph.
  74. </P>
  75. <P ALIGN= ‘CENTER’>
  76. This is center align paragraph.
  77. </P>
  78. </BODY>
  79. </HTML>
  80.  
  81.  HEADING:
  82. Headings are a simple form of text formatting that vary text size based on the headings level. The six heading elements (h1 to h6) are often used to delineate new section and subsection of a page. For making biggest heading we should put<h1> tag at beginning and a </h1>tag at the end of the text you wish to use it.
  83. Example-3:
  84. <HTML>
  85. <HEAD>
  86. <BODY bgcolor= ‘#ccffcc’ text = ‘red’>
  87. <h1>level 1 heading </h1>
  88. <h2>level 2 heading </h2>
  89. <h3>level 3 heading </h3>
  90. <h4>level 4 heading </h4>
  91. <h5>level 5 heading </h5>
  92. <h6>level 6 heading </h6>
  93. </BODY>
  94. </HTML>
  95.  
  96.  TEXT FORMATTING:
  97. HTML Citations, Quotations, and Definition Tags
  98. Tag description
  99. <b> defines bold text
  100. <i> defines italicized text
  101. <em> defines emphasized text
  102. <small> defines smaller text
  103. <strong> defines important text
  104. <sub> defines subscript
  105. <sup> defines superscript
  106. <u> defines underlined text
  107. <strike> defines a strike through text
  108. <tt> defines teletype text
  109. <small> defines font size one point smaller
  110. <big> defines font size one point bigger
  111.  
  112. Tag Description
  113. <abbr> Defines an abbreviate or acronym
  114. <q> Defines inline (short)quotation
  115. <blockquote> Defines a section that is quoted from another source
  116. <bdo> Defines the text direction.it has attribute dir with values rtl/ltr
  117. <dfn> Defines the definition term
  118. <cite> Defines citation
  119. <acronym> Define acronym
  120. <address> Defines an address element
  121.  
  122. FONT
  123. <Font>tag is used to specify the font color, size and name.
  124. Attributes of font tag are:
  125. Attributes Values Description
  126. Face Font name to specify the color of visited link font of text.
  127. Color Color name/color code to specify the color of text.
  128. Size 1 to 7 to specify the font size, default is 3.
  129.  
  130. HORIZONTAL RULER
  131. <HR>tag defines a horizontal ruler. It is an empty tag. Attributes of <HR>tags are:
  132. Attributes Values Description
  133. Size Number in pixels to specify the thickness of line
  134. width % or number in pixel to specify the width of line.
  135. Align Left/Right/Center to specify the alignment
  136. Color Color code/color name to specify the color of line
  137.  
  138. EXAMPLE-4:
  139. <html>
  140. <head>
  141. <title>sagar</title>
  142. </head>
  143. <body>
  144. <abbr title= ‘hyper text treansfer protocol’>
  145. HTTP
  146. </abbr>is a protocol for transferring hyper document.
  147. <hr color= ‘blue’ size=10 width=50%>
  148. <p>
  149. <bdo dir= ‘rtl’>from right to left</bdo>
  150. </p>
  151. <pre>
  152. Start preformatting…….
  153. <b>2H<sub>+O<sub>2</sub>=2H<sub>2</sub>O<b>
  154. Hello<sup> <font color= ‘red’>world</font></sup>from SAGAR.
  155. <i><u>this is underlined and italic text</u></i>
  156. <strike>SAGAR SILWAL</strike>
  157. End of performatting
  158. </pre>
  159. </body>
  160. </html>
  161.  
  162. MARQUEE:
  163. <Marquee>tag specifies the marquee. It is used to animate (scroll) text or image in different direction with different behaviors.
  164. Attributes of marquee are:
  165. Attributes Values Description
  166. direction Left/right/up/down To specify the directions of scroll.
  167. behavior Scroll/slide/alternate To specify the marquee behavior.
  168. scrollamount Number in pixel To specify scroll amount in pixels.
  169. bgcolor Color name/color code To specify background color for marquee.
  170. Loop Number or infinite To specify number of repeatation.
  171.  
  172.  
  173. EXAMPLE-5:
  174. <HTML>
  175. <HEAD>
  176. <TITLE>SAGAR SILWAL</TITLE>
  177. </HEAD>
  178. <BODY>
  179. <marquee direction='left' behavior='alternate' loop='infinite'scrollamount=50 bgcolor='#ccffcc'>
  180. CRISTANO RONALDO IS THE SKILLFULL PLAYER.
  181. </marquee>
  182. </body>
  183. </html>
  184.  
  185. LIST
  186. List are used to group related pieces of information together, so they are clearly associated with each other and easy to read. They make easy to maintain the document and provides more assessable.
  187. There are three types of list in HTML:
  188. a. Ordered list
  189. b. Unordered list
  190. c. Description list
  191.  
  192. ORDERED LIST:
  193. Ordered list is used to group a set of related items, in a specific order. It is defined by <ol>………</ol>tag. Every item in ordered list begins with sequence number.
  194.  
  195. Attributes of <ol>tag with their values are:
  196. Attributes Values Description
  197. type 1/i/I/a/A Type of numbered list.
  198. start numbers Starting values of number.
  199.  
  200. UNORDERED LIST:
  201. Unordered list is used to group a set of related items, in no particular order. I.e. Unordered lists are used when a set of items can be placed in any order. It is defined by <ul>…..</ul>tags, which creates a list in which every line begin with bullet mark.
  202. Attributes of <ul>tag with their values are:
  203. Attributes Values Description
  204. type Disc/circle/square Used to specify the type of bulleted list.
  205.  
  206.  
  207. DESCRIPTION LIST:
  208. Description list is used to display name/values pairs such term and their definitions, or times and events. I.e. description lists associate specific names and their values within a list. Description list are different from other kinds of list, as they use names and values instead of list items.it is define by <dl>……</dl>elements.
  209. Examples-6:
  210. <html>
  211. <head>
  212. <title>SAGAR SILWAL</title>
  213. </head>
  214. <body>
  215. <b>Top Football Players </b>
  216. <br>
  217. The top fives players are:
  218. <ul type='square'>
  219. <li>Cristano ronaldo</li>
  220. <li>Marcelo</li>
  221. <li>Neymar J.r.</li>
  222. <li>Pepe</li>
  223. <li>Sagar silwal</li>
  224. </ul>
  225. <b>Top five country on the football</b>
  226. <br>
  227. The top five country on the basis of football are:
  228. <ol type='I'>
  229. <li>Brazil</li>
  230. <li>Germany</li>
  231. <li>Protugal</li>
  232. <li>France</li>
  233. <li>Nepal</li>
  234. </ol>
  235. <b>Description of don with description list</b>
  236. <br>
  237. <DL>
  238. <DT>Baglung</DT>
  239. <DD>-Sandesh</DD>
  240. <DT>Gorkha</DT>
  241. <DD>-Roshan</DD>
  242. <DT>Kathmandu</DT>
  243. <DD>-Niroj</DD>
  244. <DT>Butwal</DT>
  245. <DD>-Abinash</DD>
  246. </DI>
  247. </BODY
  248. </HTML>
  249.  
  250. NESTED LIST:
  251. Nested list display information in outline form. A nested list is a list that appears in the bound of another list element. Nesting the new list inside the original indents the list one level and changes the number/bullet type of reflect the meaning.
  252. EXAMPLE-7:
  253. <html>
  254. <title>sagar</title>
  255. <body>
  256. <b>Classification of software </b>
  257. Software are classify into mainly three types,they are:
  258. <ol>
  259. <li>System Software</li>
  260. <ol type='i'>
  261. <li>Operating system</li>
  262. <li>Language processor</li>
  263. <ol type='a'>
  264. <li>Assembler </li>
  265. <li>Compiler </li>
  266. <li>Interpreter </li>
  267. </ol>
  268. <li>Utility software</li>
  269. </OL>
  270. <LI>Application Software</li>
  271. <ul type='circle'>
  272. <li>Tailored Software</li>
  273. <li>Packaged Software</li>
  274. </ul>
  275. </ol>
  276. </body>
  277. </html>
  278.  
  279. INSERT IMAGES AND OBJECTS:
  280. In A HTML images are inserted with<img>tag. The <img>tag is empty, which means that it contains attributes only, and has no closing tag. To display an image on a page , you need to use the Src attribute. Src stands for ‘source’.
  281. Attributes of <img>tag are:
  282. Attribute Value Description
  283. src url of the image To specify the image to be displayed.
  284. alt Test message(user defined) To specify an alternate text for an image, if the image cannot displayed.
  285. height Number in pixel To specify the height of an image.
  286. width Number in pixel To specify width of an image.
  287. vspace Number in pixel To specify white space on top and bottom of an image.
  288. hspace Number in pixel To specify white space on left and right slide of an image.
  289. align Top/bottom/middle/left/right To specify the alignment of an image according to surrounding elements.
  290. border Number in pixel To specify the width of the border around an image.
  291.  
  292. EXAMPLE-8:
  293.  
  294.  
  295.  
  296. <html>
  297. <head>
  298. <title>Sagar silwal</title>
  299. </head>
  300. <body>
  301. <h1>Inserting the image of Sagar silwal</h1>
  302. <img src='I:/image/C:\sagar silwal'height=300 width=200 alt='picture' border=2>
  303. </body>
  304. </html>
  305.  
  306.  
  307. CREATEING HYPERLINK:
  308. Hyperlink also called link is a component of web that is used to jump from one piece of information to another piece of information. The destination information can be on same page or on different web page (or web sites). A hyperlink can be a word, group of words, or image.
  309. Attributes of hyperlink are:
  310. Attributes Value Description
  311. href URL of web page or name of book mark
  312. To indicates the linked destination
  313. target _blank
  314. _parent
  315. _self
  316. ¬_top To specify where to open the linked document
  317. Name(or id) Section name For specifying specific point on a page.
  318.  
  319. DIFFERENT TYPES OF LINK
  320. External linked:
  321. External linked is a link that is used to different web pages or websites.
  322. EXAMPLE-9:
  323. <html>
  324. <head>
  325. <title>Sagar </title>
  326. </head>
  327. <body alink='green'link='red'vlink='brown'>
  328. <b>Sagar's favorites sites:</b>
  329. <ul>
  330. <li><A href='http://www.google.com'>www.google.com</li>
  331. <li><A href='http://www.youtube.com'>www.youtube.com</li>
  332. <li><A href='http://www.facebook.com'>www.facebook.com</li>
  333. </ul>
  334. </body>
  335. </html>
  336.  
  337.  
  338. INTERNAL LINK:
  339. Internal link is used to jump to specific location of page instead of being limited to linking to the top of page. Hence using internal link, one can jump from one part of page to another part of same page or to specific point of any pages.
  340. EXAMPLE-10:
  341. <html>
  342. <head>
  343. <title>laptop</title>
  344. </head>
  345. <body>
  346. <A name='movie'></A>
  347. <H1>SAGAR CLWAL favorites MOVIES</H1>
  348. <A href='#movie'>Click here to goto favorites Movies</a>
  349. <pre>
  350. INSTALLER
  351. PREM GEET
  352. DHOOM 2
  353. ICE AGE
  354. A MERO HJR 2
  355. SULTAN
  356. </pre>
  357. <A name='politician'></A>
  358. <H1>My favorites politician</H1>
  359. <A href='#politician'>Click here to goto favorites politician</a>
  360. <pre>
  361. K.P. Sharma Oli
  362. Phuspa kamal Dahal
  363. Sher bdr. Deuba
  364. Kamal Thapa
  365. </pre>
  366. </body>
  367. </html>
  368.  
  369. CREATE TABLE:
  370. Table is the dimensional structure with rows and columns. Rows are the horizontal component and columns are vertical components of table. Table organizes the data into rows and columns. <table>………</table>tags is used for defining table.
  371. The attributes for creating table are:
  372. Attributes Values Description
  373. border Number in pixels To specify the size of the table border,0 means the borderless table
  374. bordercolor Colorname or colorcode To specify the border color of table
  375. bgcolor Colorname or colorcode To specify the background color of table
  376. cellpadding Number in pixels Specifies the space between the cell wall and the cell content
  377. cellspacing Number in pixels Specifies the space between cells
  378. width % or pixels To specify the width of table
  379.  
  380. The <tr>tag define a row in HTML table. A<tr>element contains one or more <th>or <td> elements. Some attributes of <tr>tags are:
  381. Attributes Values Description
  382. Align Left/right/center/justify To align the content in a table row.
  383. bgcolor Colorname or colorcode To specify the background color of a table.
  384. valign Top/middle/bottom/baseline To vertical align the content in a table row.
  385.  
  386. Some important attributes of <td> and <th> tag are:
  387. Attributes Values Description
  388. Align Left/right/center/justify To align the content in a cell.
  389. bgcolor Colorname or colorcode To specify the background color of a cell.
  390. valign Top/middle/bottom/baseline To vertical align the content in a cell.
  391. rowspan number Sets the number of rows a cell should span
  392. colspan number Sets the number of columns a cell should span
  393. width % or pixels To specify the width of cell
  394.  
  395. Attribute of<caption>tag
  396. Attributes values Description
  397. Align Left/right/center/justify To align the caption of table.
  398.  
  399. EXAMPLE-12 A simple table with 4 rows and 3 columns:
  400. <html>
  401. <head>
  402. <title>Prince thapaliya</title>
  403. </head>
  404. <body>
  405. <table border=1 bordercolor='red' width=500 cellspacing=0>
  406. <caption align='top'>Student Detail</caption>
  407. <tr>
  408. <th>Roll</th>
  409. <th>Name</th>
  410. <th>Sex</th>
  411. </tr>
  412. <tr>
  413. <td>26</td>
  414. <td>Prince Thapaliya</td>
  415. <td>male</td>
  416. </tr>
  417. <tr>
  418. <td>27</td>
  419. <td>Bibek Uperti</td>
  420. <td>male</td>
  421. </tr>
  422. <tr>
  423. <td>28</td>
  424. <td>Suwash Rasili</td>
  425. <td>male</td>
  426. </tr>
  427. <tr>
  428. <td>29</td>
  429. <td>Sanzu Silwal</td>
  430. <td>female</td>
  431. </tr>
  432. <tr>
  433. <td>30</td>
  434. <td>Sapna Silwal</td>
  435. <td>female</td>
  436. </tr>
  437. <tr>
  438. <td>31</td>
  439. <td>Simple Basnet</td>
  440. <td>female</td>
  441. </tr>
  442. </table>
  443. </body>
  444. </html>
  445. EXAMPLE-13 A table with rowspan and colspan:
  446. <html>
  447. <head>
  448. <title>Prince thapaliya</title>
  449. </head>
  450. <body>
  451. <table border=3 width=600 cellspacing=4 cellpading=3 >
  452. <caption align='top'>Student result sheet</caption>
  453. <tr bgcolor='#ccffcc'>
  454. <th rowspan=2>Roll</th>
  455. <th rowspan=2>Name</th>
  456. <th rowspan=2>English</th>
  457. <th rowspan=2>Math</th>
  458. <th colspan=2>Computer</th>
  459. </tr>
  460. <tr>
  461. <th>theory</th><th>pratical</th>
  462. </tr>
  463. <tr>
  464. <td>27</td>
  465. <td>Bibek Uperti</td>
  466. <td>80</td>
  467. <td>88</td>
  468. <td>70</td>
  469. <td>25</td>
  470. </tr>
  471. <tr>
  472. <td>28</td>
  473. <td>Suwash Rasili</td>
  474. <td>90</td>
  475. <td>80</td>
  476. <td>70</td>
  477. <td>25</td>
  478. </tr>
  479. <tr>
  480. <td>29</td>
  481. <td>Sanzu Silwal</td>
  482. <td>99</td>
  483. <td>90</td>
  484. <td>75</td>
  485. <td>25</td>
  486. </tr>
  487. <tr>
  488. <td>30</td>
  489. <td>Sapna Silwal</td>
  490. <td>90</td>
  491. <td>89</td>
  492. <td>72</td>
  493. <td>25</td>
  494. </tr>
  495. </table>
  496. </body>
  497. </html>
  498.  
  499. Design frame and form
  500. Frame is used to divide the browser window into the number of rectangular pane so that different pages can be added to same window. Pages containing the frame do not use the<body>tag.
  501. Attributes of <frameset>tag are:
  502. Attribute Values Description
  503. rows % of each rows separated by comma. One can use * to specify the remaining area for row. To specify the height of each row relative to browser windows.
  504. cols % of each rows separated by comma. One can use * to specify the remaining area for column. To specify the width of each column relative to browser windows.
  505.  
  506. Attributes of <frame>tags are:
  507. Attribute Values Description
  508. urc url To specify url of web page to be loaded into frame.
  509. name text To specify the unique name of frame so that it can be targeted from other page.
  510. scrolling Yes/no/auto To specify the scrolling properties.
  511. NORESIZE Disable the frame resizing capability.
  512.  
  513. EXAMPLE-14:
  514. FORM:
  515. An HTML form is part of a web page that includes areas where users can enter information to be sent back to you, sent to another e-mail address that you specify, or sent to a database that you manage. Simply ,it is an interface for passing data to server. An html form can contain input elements like text fields, checkbox, radio-buttons, submit buttons and more.
  516.  
  517.  
  518.  
  519.  
  520.  
  521.  
  522.  
  523.  
  524.  
  525.  
  526.  
  527.  
  528.  
  529.  
  530.  
  531.  
  532.  
  533.  
  534.  
  535.  
  536.  
  537.  
  538.  
  539.  
  540.  
  541.  
  542.  
  543.  
  544.  
  545.  
  546.  
  547.  
  548.  
  549.  
  550. Example-15:
  551.  
  552. <html>
  553. <head>
  554. <title>Student Detail Form</title>
  555. </head>
  556. <body>
  557. <center>
  558. <h1>Rising Star College </h1>
  559. <b>Student Detail Form:</b>
  560. </center>
  561. <hr color='blue'>
  562. <form method='post'action='myserver.php'>
  563. <fieldset>
  564. <legend align='top'>Personal information </legend>
  565. <p>Name:<input type="text"size=15 name="txt_name" maxlength=25></p>
  566. <p>Address:<input type="text"size=25 name="txt_addr" maxlength=45></p>
  567. <p>Sex:<input type="radio" name="r1" value="male">Male<input type="radio" name="r1" value="female" checked>Female </p>
  568. </fieldset>
  569. <fieldset>
  570. <legend align='right'>Hobby & Education </legend>
  571. <p>hobbies:<input type="checkbox" name="chk1" value="Watching movies">Movies
  572. <input type="checkbox" name="chk2" value="Playing football" checked>Football
  573. <input type="checkbox" name="chk3" value="Reading Story">Story
  574. <input type="checkbox" name="chk4" value="Other">Others
  575. </p>
  576. <p>
  577. Education:<select>
  578. <option value='PHD'>PHD</option>
  579. <option value='Master'>Master</option>
  580. <option value='Bachelor'>Bachelor</option>
  581. <option value='Plus Two'>+2</option>
  582. <option value='SEE'>SEE</option>
  583. </select>
  584. </p>
  585. </fieldset>
  586. Few words:
  587. <br>
  588. <textarea rows=7 cols=50></textarea>
  589. <p>
  590. <input type="Submit"value="Send">
  591. <input type="Reset"value="Clear">
  592. </p>
  593. </form>
  594. </body>
  595. </Html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement