Thursday, August 23, 2012

how to add javascript in html

How to add javascript in html?
Javascript is not java language,but it is used to handle webpage at more
advanced level from client side,where as php is used to handle webpage from
server side.By using javascript we can totally control the webpage and its events
and many more graphics and userfriendly features.javascript can be added inside
head or body tags,makes no difference,but usually we follow to add it inside
head tags.
script tag is used to add javascript in webpage.
<script >....</script>
we can write functions inside javascript and can also handle total
webpage.

Example:
<html>
      <head>
       <h3>adding javascript to html page</h3>
      </head>
      <body>
      <script>
     document.write('<h5>hi i am inside javascript.....</h5>');
      </script>
     </body>
</html>

Output:

adding javascript to html page


hi i am inside javascript.....
Now you learnt how to add javascript in html.

Thank you for reading our blog...


adding table tags and adding table to html pages

Adding tables in html :
Tables in html language are very useful to represent some data with detailed and
structured information.We use table tags to display a table in html.
<table> ......</table>

table tag starts and ends as you know how other html tags starts and closes.
there are three things or additional tags in table tag ,they are
<tr> -------- used to create new row in a table
<td> or <th>-used to create new column in a table.(th tags displays text in heading style or bold text).

Structure of table:
<table>
   <tr> <td>|column 1</td><td>| column 2</td></tr> ---new row
                   |                               |
                   |                               |
               new column 1          new column 2
</table>

I think its abit confusing with tr and td tags.I will make you clear with this.
A table consists of major border,then next rows and in each row there are columns.
first you create table,how?by creating table tags

<table>
</table>

table is created ,now you need to create two rows for example.
<table>
<tr>row 1</tr>
<tr>row 2</tr>
</table>

rows are created ,now you need to create two columns in each row,so use td tag for creating columns.
<table>
<tr><td>row 1 column 1</td><td>row 1 column 2</td></tr>

<tr><td>row 2 column 1</td><td>row 2 column 2</td></tr>

</table>

so i think you are clear with the concept of tables in html.

<html>
        <head>
          <h3>creating tables in html</h3>
        </head>
        <body>
          <table>
         <tr><td>row 1 column 1</td><td>row 1 column 2</td></tr>

          <tr><td>row 2 column 1</td><td>row 2 column 2</td></tr>

          </table>

        </body>
</html>  

Output:

creating tables in html

row 1 column 1row 1 column 2
row 2 column 1row 2 column 2

now you are done with handling tables and html at basic level.

<<back         next>>




   

Adding image to html pages

Adding image to HTML pages:
We can add an image to a web page easily by using img tag
           <img src="location image" >write some text </image>
by using img tag we can add an image to a webpage and also some text to the image
by writing some text inside the img tags,if you dont need any text to be added dont write
anything in between <img> tags.

Example:
<html>
        <head>
          <h3>adding image to html page</h3>
         </head>
          <body>
           <p>adding image to a webpage is very easy using img tags.</p>
         <img src="http://www.orangesmile.com/hotel-fotos/fr/500/hotel-radisson-sas-nice.jpg" >
nice pics </img>
        </body>
</html>

Output:

adding image to html page

adding image to a webpage is very easy using img tags.
nice pics 

Now you are done with how to add image to a html page.

 <<back       next>>

Adding paragraphs in html

Adding paragraphs in html:
We can add paragraphs in html by using p tag <p>paragraph text here</p>.
Sometimes we need to write text with paragraphs and represent in such
a way to have a good look.
Example:
<html>
          <head>
           <h3>first heading</h3>
          </head>
          <body>
          <p>html is the language used for webpages and also 
for many styling purpose and data presenting on websites
</p>
          </body>
</html>

Output:

first heading

html is the language used for webpages and also for many styling purpose and data presenting on websites

here you are done with adding paragraphs in  html.
<<back    next>>

how to use font tags in html and how to change text size in html

How to add font tags in html?
In html we write text in body and head like this
<head> this is the first text </head>
                     or
<body> this is the first text </body>
In above case we cant add any style or change size of text,so to handle text
we use font tags <font> sample text</font> .this is how you should use font tags.

Example:
<html>
        <head>
        <font color="red"> some text here</font>
        </head>
        <body>
        <font size="10px">this is body of the text</font>
        </body>
</html>

we can add the color to the text we desired by using 'color' attribute ,
the valid color attributes are red,blue,green,black,yellow,pink,purple.for other
colors we use #ffccdd or #124356 hexadecimal color codes.

Text size can be altered by using 'size' attribute.
you can give the size to be in pixels by px ,or inch ,cm .

There are other heading tags starts from h1 to h5 with decreasing size of text.
<h1>head 1</h1>
<h2>heading h2</h2>
<h3>heading h3</h3>
<h4>heading h4</h4>
<h5>heading h5</h5>

output of above code:

head 1

heading h2

heading h3

heading h4

heading h5

Example:
<html>
        <head>
        <font color="red"> some text here</font>
        </head>
        <body>
        <font size="10px">this is body of the text</font>

       <h1>head 1</h1>
       <h2>heading h2</h2>
       <h3>heading h3</h3>
       <h4>heading h4</h4> 
       <h5>heading h5</h5>

        </body>
</html>

here you are done with learning how to add font tags and changing size of text in html.

<<back     next>>


how to add title tags in html

How to add title tags in html?
Title tags are used to represent the title of the page,when you take your mouse pointer on the tab
of the browser it will show some text about the webpage which is called as title.It is very important
for the sake of seo purpose of the website.

Adding title tags to html:
1.Title tags should be added in head tags.title tags starts and ends as you learnt previously

<title>Title of the webpage</title>

2.Adding in html ,below is the structure and code of html

<html>
         <head>
          <title>Title of the webpage </title>
         </head>
         <body>
         </body>
</html>

here you have done with learning how to do add title to a webpage.

<<back    next>>

Learn HTML-quick guide get it in 1 Hour

The present post is about learning HTML(Hyper Text Markup Language) at a basic level within very less
time.
What is HTML?
HTML means Hyper Text Markup Language,which is like common type of programming language.
HTML is easy to learn and work with.The browser handles the html code and displays the output
to the user using it.
Structure of HTML:
HTML has two parts HEAD and BODY.what ever code we write it will start with a tag and end with
a tag like this
<start_tag_name>  some text or any other thing </end_tag_name>

html start with <html> tag and ends with </html> tag.
head part starts with <head> and ends with </head>
now you have a guess the body will be like this
<body>   and ends with </body>

<html>
          <head>
                 some text here
          </head>
          <body>
              some text here
          </body>
</html>

above is the simple basic structure of html.

Do it in real !!!!
1.Create a sample.html file on your desktop or at any folder of your wish
2.Open the sample.html file and write the code below

<html>
<head>
this is head
</head>
<body>
this is body
</body>
</html>

after writing the code in sample.html ,save the file and open with firefox or internet explorer or any
other browser.After opening it will give the following output.
Outputs below:
-----------------------------------------
this is head                                           
this is body                                          
                                                           
                                                           
---------------------------------------


here you got the practical experience of how html outputs on a html page.

What more you have to learn ?
1.title tags in html.
2.font tags for text and size of text.
3.Adding paragraphs.
4.Adding images to html.
5.Adding table to html.
6.Adding Javascript to  html.