affiliate marketing
Showing posts with label Basics of HTML. Show all posts
Showing posts with label Basics of HTML. Show all posts

Thursday, December 17, 2009

Body Tag

  • HTML document's body is defined by the Body element.   
  • The Body tag contains all the contents like text, graphics, images, colors, etc.,).   
  • It has some attributes. (bgcolor, for example)   
  • Example of Body Tag.

<html>

    <head>
        <title>Title goes here</title>
    </head>

    <body bgcolor="green">
        This is the body section of this HTML document.
    </body>

</html>  

The Basics of HTML

The Basics of HTML

Font Tag( <font> ) in HTML

Font Tag( <font> ) in HTML

  • The <font> tag defines size, face, color, etc., of the text inside them.
  • It has its own closing tag </font>
  • Example: <font face="Times New Roman" size="5" color="red"> Some text to format </font>

Source code


Output


<font face="Monotype Corsiva,Times New Roman,Verdana" size="6" color="green"> How is it? </font>

How is it?

Line Break Tag(<br />) in HTML

Line Break Tag(<br />) in HTML

  • The <br /> tag defines line break tag.
  • It gives a line break in the document
  • There is no closing tag for this.
  • Example: <br/>First <br />Second <br />Third

Source code


Output


<br/>First <br />Second <br />Third


First
Second
Third

Anchor Tag in HTML

Anchor Tag in HTML

  • The <a> tag defines an anchor.
  • href is an attribute that defines the URL to link
  • Example: <a href="http://www.google.com"> Click here to go to Google.com <a>

Image Tag in HTML

Image Tag in HTML

  • HTML uses <img> tag to put image in its document.
  • Example: <img src="imgname.gif" alt="some text" title="some text">
  • src is an attribute. It is the URL of image.
  • alt is an attribute that describes about image
  • The height and width of the image can be changed using the Height and Width attributes respectively.
  • The value for the Height and Width attibutes can be in pixel or percentage(%).

Heading Tags in HTML

Heading Tags in HTML

  • Headings are defined with the <h1> to <h6> tags. <h1> defines the biggest heading. <h6> defines the smallest heading.

Source code


Output


<H1>This is header 1</H1>

This is header 1


<H2>This is header 2</H2>

This is header 2


<H3>This is header 3</H3>

This is header 3


<H4>This is header 4</H4>

This is header 4


<H5>This is header 5</H5>

This is header 5

<H6>This is header 6</H6>

This is header 6

Basic HTML Tags

Basic HTML Tags


Source code


Output


<b>Bold text</b>

Bold text

<strong>This is strong</strong>

This is strong

<big>This is big</big>

This is big

<em>This is emphasized</em>

This is emphasized

<i>This is italic</i>

This is italic

<small>This is small</small>

This is small

This is<sub>subscript</sub>

This issubscript

This is<sup>superscript</sup>

This issuperscript

<p>The pre tag is good for displaying computer code:</p>


<pre>
for i = 1 to 10
 print i
next i
</pre>

The pre tag is good for displaying computer code:


for i = 1 to 10
 print i
next i

Wednesday, December 16, 2009

How to create an HTML file

How to create an HTML file

  • Open a text editor like notepad, wordpad, etc.,
  • Type or Copy, the code below into the text editor.
  • Choose File -> Save.
  • Type the name of the file with the extension of .html or .htm in the File name box(My_first_page.html, for example. Here My_first_page is the file name)
  • After saving complete, open the saved file with any one of your browser(Mozilla firefox, Opera, Internet Explorer, etc.,).
  • Note the title of the Browser, It will be "My first page"

<html>

 <head>
  <title>My first Page</title>
 </head>

 <body bgcolor="green">
  Wow! I created an HTML document
 </body>

</html>

Structure of an HTML document

Structure of an HTML document

  • HTML documents have two sections, the header and the body.
  • The body is the larger section than the header section of the document.
  • The header section of an HTML document contains the document's title
  • The body section contains everything else.
  • Example of HTML document Structure.

<html>

 <head>
  <title>Title goes here</title>
 </head>

 <body>
  Body goes here
 </body>

</html> 

HTML Attributes

HTML Attributes

  • Attributes help the tags to style up the contents
  • Attributes appear in the HTML document as <tag attribute="value">content</tag>
  • For example, <body bgcolor="green"></body>, here body is the tag, bgcolor is an attribute of body tag and green is the value for the bgcolor attribute.

HTML Tags

HTML Tags

  • The structure of an HTML document contains tags
  • Contents of an HTML document surrounded by tags(<html> for example).
  • A tag of an HTML document contains its own closing tag(</html> for example)
  • Even though some of the tags do not have their closing tag. The line break tag for example(<br />)
  • All you need to remember is simple that, every tag will appear like in the following format
  • Open tag -> Your content -> Closing tag(<b>Bold</b> for example, which makes the text inside <b> tag bold)

Monday, December 14, 2009

What is an HTML file?

What is an HTML file?

  • HTML stands for Hyper Text Markup Language.
  • HyperText is the method by which you use the web by clicking the special text called hyperlinks, which get you to the another page.
  • Markup is what HTML tags do to the text inside them. HTML Tags mark it as a type of text(Underlined text, for example).
  • An HTML file is a text file that contains small markup tags.
  • The markup tags instruct the Web browser how to show the page on the web.
  • You can create an HTML file using a Text Editior like Notepad.
  • It has the file extension of .htm or .html

An HTML file is a text file that contains HTML elements. Its elements are defined using HTML tags.