Showing posts with label HTML Basic. Show all posts
Showing posts with label HTML Basic. Show all posts

HTML Elements

  • HTML Elements 
    • An HTML element start with an Opening Tag and ends with a Closing Tag.
      Ex: <p>----</P>
    • Between the Opening tag & ending tag called Element Content
    • Some HTML elements which are called Empty Elements closed in the start tag.
      Ex: <img src = "myImage.jpg"  />
    • Most HTML elements can have additional information than the element whic are called Attributes
      Ex: <p align = "Center"> This is the Paragraph</p>
      • The <p> element defines a paragraph in the HTML Document
      • The element has a opening tag <p> and its enfing tag </p>
      • The element Content is "This is the Paragraph"
      • No case sensitive because you can define <p>..... </P> or <P>... </p>
      • The attribute of this element is align it describe the alignment of the paragraph.

HTML - Basics


HTML Basics


  • HTML Links
    HTML Links are defined with the <a> tag and the linked location specified to href attribute. 
    Ex:
    1. <a href = "http://programmingforbeginers.blogspot.com/"> This is a Link to our forum </a> 
    2. <a href = "#"> This is a link to same location </a>


  • HTML Images  
    HTML Images are defined with the <img> tag and defining the image path with "Src" attribute. 
    Ex:
    1. <img src = "myImage.jpg" /> This tag loads the image with its original size.
    2. 
    <img src = "myImage.jpg" width = "100" height = "100"/> This tag attributes change the image size.


  • HTML Elements
    • An HTML element start with an Opening Tag and ends with a Closing Tag.
      Ex: <p>----</P>
    • Between the Opening tag & ending tag called Element Content
    • Some HTML elements which are called Empty Elements closed in the start tag.
      Ex: <img src = "myImage.jpg"  />
    • Most HTML elements can have additional information than the element whic are called Attributes
      Ex: <p align = "Center"> --------</p>


  • Nested HTML Elements
    Most of the HTML elements can contain other HTML elements. This is calling nested elements.
    Ex:
    1.
    <html>
       <head>
          -----
          -----
       </head>
    </html>


  • HTML Attributes
    • Most HTML elements can have attributes.
    • Attributes provide further information about the element 
    • Always specified in the opening tag
    • Attributes come in name-value pairs.

HTML - Basics

HTML Basics


  • HTML Headings
    HTML Headings are defined with <h1> to <h6> tags.  <h1> is the largest font size for header & <h6> is the smallest font. All the opening tags of header tags closed
    Opening & Closing tag pairs can be
    either;
    <h1> </h1>  

    <h2> </h2>  

    <h3> </h3> 

    <h4> </h4> 

    <h5> </h5> 

    <h6> </h6>

    Or
    <h1>
    </h>  
    <h2> </h>  

    <h3> </h> 

    <h4> </h> 

    <h5> </h> 

    <h6> </h>

    sample code :
    <h1> Heading 1</h1>  
    <h2> Heading 2</h2>  

    <h3> Heading 3</h3> 

    <h4> Heading 4</h4> 

    <h5> Heading 5</h5> 

    <h6> Heading 6</h6>

     
  • HTML Paragraph
    HTML Paragraph defines with <p> & </p> tag pair.

    Sample Code :
    <p>This is 1st paragraph</p>
    <p>This is 2nd paragraph</p>

HTML - Basics

HTML Basic Tags

  • <html>
    The Text between <html> & </html> describes the HTML Document (Web Page). 
  • <body>
    The Text between <body> & </body> describes the visible page content of HTML Document.
  • <title>
    The text between <title> & </title> defines the title of the web browser.
  • <head>
    Header section of the HTML document consistes in between <head> & </head>.
How to write an HTML Document?
  1. Open a notepad
  2. Enter following Sample web page
  3. Save the notepad with ".html" or ".htm" extension.
  4. Open the document with a web browser (ex: Internet Explorer, Mozilla Firefox)

Sample Web Page
<html>
 <head>
  <title>Hello World</title>
 </head>
 <body>
Hi!... This is my First Web Page.
</body>
</html>