Saturday, 28 November 2015

TUTORIAL 2

USING TAGS

Include the following in the page

  1. <!DOCTYPE html>
  2. <html>
  3. <body>
  4.         WELCOME TO MY PAGE
  5. </body>
  6. </html>

<!DOCTYPE html>
  • specifies the type of webpage is html
  • it instructs the web browser which version of html is being used, html indicates HTML5
  • if document type declaration is not specified, browser may behave in a peculiar way
<html> the opening tag, denotes the beginning of the html document

</htmlthe closing tag, denotes the end of html document
  • whatever is written between will be considered as html document
<bodydenotes the beginig of the body of the html page

</bodydenotes the end of the body
  • So whatever you have typed now within the <body> and </body>, is the body 
  • WELCOME TO MY PAGE is the body here, and displayed in the browser window

  • </html </body> - closes the respective elements
  • All the tag do not have the closing tags. there are certain tags which do not have the closing tags
  • Tags which do hold any contents will close themselves. So they do not need a separate closing tag
eg<br> - denotes the line break

it doesnt wrap any content
this might also be written like <br/> 
it is a self closing tag. that mean, closing by itself.
generally used in xhtml coding
xhtml is another version of html based on another markup lanuage xml

  • Any tag which has content must be closed
  • Syntax : opening tag -> content -> closing tag
  • This makes the code easier to understand


No comments:

Post a Comment