You are on page 1of 18
HTML 1. HTML . Introduction to. HTML + Editing HTML document z HTML document structure + HTML comments +” HTML elements + HTML Tags P Attributes + Headings * Paragraph Element + HTML programs 1.1. Introduction HTML stands for Hyper Text Markup Language. HTML isa markup language that specifies the format of the text that is displayed in a web browser such as Internet Explorer or Mozilla Firefox. It allows to write formatting instructions for web pages. Web browsers interpret the formatting instructions specified for the web page and render the web page on the screen. HTML documents are written using HTML tags embedded in angular brackets. Even an average user can make use of these tags to create HTML documents. The set of tags that we can use to write HTML documents is defined by the World Wide web Consortium (\W3C), —$—$—$———— 3 Scanned with CamScanner e rtich phy HTML was developed by Tim Bemners Lee at CERN, the European Center for partich phy: was developed from SGML, the Standardized General Markup Language: Editing HTML HTML document can be created by typing them with either -html or and .htm file name extension. Computers called web servers running specialized software store HTML documents, Client; request specific resources such as the HTML documents from web servers. 1.2, HTML document structure Every HTML document starts with the tag. This tells browsers that it is the beginning ofthe HTML document. This tag is an embedded tag, so it must have the corresponding tag that is used to assign a title to the web page, which appears on the title bar of the browser's window. This section quite often, contains JavaScript code, Cascading Style Sheet codes, etc. ‘The body section contains text and other tags, which are rendered on the screen as specified when the user visits the web page. 1.2.1. HTML comments These are used to improve markup readability and describe the content of the document Comments do not cause the browser to perform any actin when the user loads the HTML document into the web browser to view it. HTML comments always start with . Comments can be placed anywhere in the document. : Example: 1.2.2, Elements ‘These are the fundamental building blocks of a web page. An element consists of a tag, is attributes and content. HTML documents delimit an element with start and end tags. Thes? elements are organized in a tree-like structure. The root element is , which contains 2 other elements. pa ae 4 Scanned with CamScanner HTML wlar brackets(< and >), The general format of the tag is + SRAM RG CoRTERT STA 2 Witte crag the pening tag. . WN SRE Is Te chosing ag, ag WRDIW these opening and closing tags is the tag's content. The content can be ay Sale Pent, ar other tags of even be empyy LQ Attributes Many seart Rags Dave attributes that provide additional information about an element. Browsers, ation to determine how to process the element. Each attribute has 2 2 into Valve soparatad dy an equals sign (=) Example: SRW "NY" helahee "> Where che is the tag, width and height are attributes of tag. 1.2.5, Headings HTML provides sit Revels of headings, BI through h6, called heading elements, for: specifying sherelative importance of information, The hl Reading has the largest and he has the smallest font size. Heading 31> hot Heading 60> 1.2.6, Paragraph element Paragraph element is denoted with sp> and

all the tags placed between the

and < P>tags form one paragraph, When the browser renders & paragraph, a blank line usually precedes and follows paragraph text, Example: > The internet is a global system that consists of millions ef publis, Private academic, business, = Scanned with CamScanner ch rt the computers connected to jt 4, and government networks of local to global scope. It allows exchange information with one another.

~ To make communication possible, com ' called protocols. The standard TCP/IP suite is used by the Internet to millio

1.2.7, Examples puters on the internet use a common set of rules, ns of users worldwide. First HTML program ‘Siz thisis fire HTML progam —> HTML comments Sle first html ~ > | shead> ‘This is first program<title> <head> <body> <p> Welcome to HTML<p> <body> | <html> Headsection Body. section. Output for the above program: Scanned with CamScanner HTML 1,2.8. Some important tags in HTML ar Opening tag Closing tag Description <html> </humls This tag contains all other html elements <tvend> ——<Mhead> This tag is used for indicating the head section of the html document title <hitle> The text within these tags is displayed in the browser's title ba. <body> </body> This tag is used for indicating the main content of the html document. <b> <> This tag makes the enclosed text bold. -<b>this text is bold</b> <> <li> This tag makes the enclosed text italic. <i>this texts italies/i> <u> <u> ‘This tag makes the enclosed text underlined. <w>this text is underlined</u> <b> </b> This tag is used to insert line break. <hr> <ihi> This tag is used to insert horizontal rules. <pre> </pre> “This tag is used for indicating pre-formatted text <sup> —</sup> This tag is used for defining subscript <sub>——</sub> This tag is used for defining superscript <em> </em> This is used for indicating emphasis. <cite> <cite> This tag is used for indicating a citation. <dfn> </dfn> This tag is used for indicating a definition. <kbd> —— </kbd> This tag is used for indicating the text to be entered b the user. <code> </code> This tag is used for indicating a piece of code. <samp> — </samp> This tag is used for indicating sample output from 2 computer program. It suggest the text is variable. <var> <War> ‘This tag is used for indicating stronger emphasis than the <em> <strong> <Istrong> tag. <big> —— </big> This tag is used for specifying large text, It increases the font size by 1 each time itis used.(maximum size is 7 and default size is 3) <small> — </small> This tag is used for specifying small text, The font size decreases by 1(default size is 3). This tag wanders tele type text. <p <i> <strike> __</strike> This tag is used to strike to middle of the text : 7 = Scanned with CamScanner Example: <le= tags.html > shiml> <head> <titleimportant tags in HTML ~ this text is bold
this text is italic this text is underlined
this text is bold this text is italic is text pe ’ # Computer| Protected Mode: Off Example 3: Stitle>tags in html Scanned with CamScanner HTML BVK COLLE DWARAKA NAGAR
VISAKHAPATNAM
ANDHRA PRADESH
INDIA
EARTH
old Rate Rs 1 000
new Rate Rs 900
X2+Y2=Z2
2H2+202 —-> 2H2O gt nl - Windows Internet Explore QO e le. cavientiendestoreampiephsiaiyiestint [4] x] [7 ting oy x Grerton Q J search| ‘He Fovorites «sy @) Suggened Stes + ge) Web Sti | Bein Be Bre Peer Sey Toke Oe” | tery © | | DWARAKA NAGAR VISAKHAPATNAM ————_————SBEEOO—vm['m'"n rrr Scanned with CamScanner Example: tags in html google.co.in
oftware web server Web server is a computer running S' which is connected with the internet. this tag is used for emphasis
this text has to be entered by the user
ASCII code for A is 65
‘When you select delete option you will be asked imp> click on yes
Are you sure Yes/Nox+=5
danger work in progress \UseA\Desktoplexamplellogicalstyles mt | it Favorites | sp @) Suggested Stes © @) Web Sice Gatey © «| Bepsin tint o » Bor Gh > Page Sslety~ Tooke Ov |] googlecoin _| web server Web serves is a computer runing software which is connected with the internet. || this tag is used for emphasis ee |] enso texe nao to be entered by ene user |] ASCII code for Ais 65 | |] When you select delete option you wil be asked aze you sure Yes/to cick oa yes danger work in progress Scanned with CamScanner HTML, ett eens ne Font tag This tag is used to change font of the text, The attributes that can be used are Face: this attribute is used t change style of the text. Color: this attribte is used to change the color of the text. Size: this attribute is used to change the size of the text. Example: WEB TECHNOLOGIES Hr tag This tag is used for creating a horizontal rule. Attributes are : Align : this attribute is used to align the horizontal rule. Options are left, right and center. Noshade: this is used to remove the usual shading effect Size: this used to specify the height of the horizontal rule. ‘Width: this is used to specify the width of the horizontal rule. Example: .


Review Questions 1. Explain about HTML in brief. 2. Write about HTML document structure. 3. How'is a comment shown in HTML? 4. What are HTML tags? How do the tags that switch a format on differ from those which switch it off? 5. How can the font size, colour and style be changed in HTML? ea Scanned with CamScanner [CHaPTER | HYPER LINKS . Introduction to Hyper Links ing + Ryperlinking 10 an E-mail address + Basic pes of links * Changing link colours * Internal linking + Linking 10 other web pages 2.1. Introduction One of the most important HTML feature is the hyperlink, which references(links) other ©. such as HTML documents and images. When a user clicks a hyperlink, the browse tries to execute an action associated with it. In HTML, both text and images can act as hyperlinks Web browsers underline text hyperlinks and color their text blue by default, so that users cas .yperlinks from plain text. distinguish 2.2. Linking Link otherwise known as Hyper Link. Anchoring tag: ... ~ This tag is an anchoring ti This tag is used to link to other web pages. Attributes of anchoring tag: Scanned with CamScanner Hypor Links 2 ef (Hyper text reference) - 1 ; ae YP Set naeee ~ This attribute of an anchoring tag. The value of href Be tute species the location of a linked resource, such as a webpage, a file or an e-mail address. Example: first + name : this attribute is used to make links jump to other sections within the same page. Example: First para + tabindex this attribute sets the order in the tabing index, for using the tab key to move to links ina page. third first second '3">third Andhra University Scanned with CamScanner 2 are relative to the current page, The ie site to another, . the path names that + Relative links : these link types of links are commonly used to link from one page in th 2.5 Changing link colours The general colour of text links is specified in the body tag. + Link : standard link to a page (standard colour is blue) + Viink : visited link to a page ( standard colour is purple) Alink: active link, the color of the link when the mouse is on it(standard colour is red) Example: 2.6 Internal linking Internal linking is a mechanism that enables the user to jump between locations in the sane document. Internal linking is useful for long documents that contain many sections. Example : HTML<Atitle> </head> 116633"> <body bgcolor="##fabcdt™ text= <font size=5><a name="top"></a> <a href="#basic_structure">basie structure </a><br/> <a href="fbasic_tags">basic tags </a><br/> '>comments</a><br/> <a href="#comments <a hrefe"#background">background </a><br/> <hr/> Scanned with CamScanner Links icture</b></a> <p>Every HTML document starts wi a s tells browsers that ‘arts with th g. this s that it is E sume he <html> tag. this tells browsers that it is This may appear anywhere in the document. this tag is an embedded tag.</p> <p><a href="stop">back to top</a></p> <hr/> <a name ="basic_tags"><b>basic tags</b></a> <p>these tags have simple functionality and are used to create simple HTML documents. <p> <p><a href="#top">back to top</a></p> <br/> <a name ="comments"><b>commnets</b></a> <p>An HTML comment is not really a tag. it starts with <I-- and ends with —>. Everything within these character sequences will be ignored by the browsers and will not be parsed. Comments are used to explain the purpose of critical tags in an HTML document. Comments can be placed anywhere in the document. </p> <p><a href="#top">back to top</a></p> <hr> <a name="background"><b>background</b></a> <p>The background of an HTML page is specified in the <body> tag. you may use pain color or an image as background. if'an image is uded, loading the page takes more time than when plian color is used. <Ip> <p><a href="#top">back to top</a></p> <br/> </font> Se Scanned with CamScanner Chapter 2 </body> <timl> avaiger tae See eames Aram M osicstostuce, a ssoments tokeood Nake strectere ony HIME dose sty yh the tg i es yer tha iti the gina of aw HTM, document Ths oy appear anytete ‘nthe document tus te ican embstd 98 tose Dank tags ‘these tags have simple fanctionality ond are use to cteate simple HTML doctments bates commects ‘An HTML comueat is not really ata. i stars with Everything within these character sequences willbe ignoted by the browsers and tall aot be parsed Coenen ae usd to explain the purpose of critical tags in an HTML document, Comments can be placed anywhere smite document el so eae : ea] bask tags hese taps have snp functionality and are wed to create simple HTML. doertents tad touce ‘An HTML ccament i ot really a tag i starts wu , Everything within theve chiacter sequeuces will be ugnoved b ‘pal oct be porved) Comucits ate used to explain the purpose of cttical tgs ivan HTML dssumeut. Comments an the document be owes an be placed auswbcte background The background of an HTM page is ypeciied an the ty yo the page taken more tune than whe pia coloe use pun color ovat nage as background, if an image ty do long 16 Scanned with CamScanner Linking to other web pages — <temain. html <html> _ <head> <title~main menus/title> </head> <body> <font size="+5">_—_ menu</br> <a href="first.html" tabinde: <a href="second, html" tabindex= <a href="third.html"tabindex="2" </font> <Ioody> <!--first.html--> oe <head> <title>this is first web pages/title> <shead> <body> <font size="+5"> first web pagesbi/> <a href="main.himl">Back</a> ~ </body> Hyper Links " accesskey="a">first</a><br/> accesskey="b">second</a><br/> accesskey="c">third</a><br/> Scanned with CamScanner a earn EN <!--second.html--> <html> <head> <title>this is second web page second web page
Back this is third web page third web page
Back yous @ ote menu Scanned with CamScanner yr Lin con first web page ‘ SEPISIO! o|Mlalao ye REST ss: | nd web page ESI Pol! o |W ilaale + comes third web page Back Scanned with CamScanner Chaptor 2 i ns Review Questions 1, Discuss the difference between relative and absolute paths in hyperlinks. 2. Explain about internal links. 3: Explain about external links. 4. Explain attributes of anchoring tag. 5. Explain hyperlinks in HTML. Scanned with CamScanner

You might also like