Home » html

Category Archives: html

Java String Method charAt()

This method takes one integer argument and return a character specified at index position. For any string the index value starts from 0 to string length -1 position. If passed index value not in valid range then it throws IndexOutOfBoundsException.

For example string Hello Friends contains 13 characters starting from 0 to 12 H is first position with index value 0, F is in seventh position with index value 6 and s is in 13 position with index value 12.
Using numbre other then 0 to 12( 0 to length()-1) will result in IndexOutOfBountException

Signature:

public char charAt(int index)

Parameters:

index -Integer index value to get character at specified index position.

Return:

Character at passed index value.

Exception Throws:

IndexOutOfBoundsException If index value in not between 0 to String length()-1

Example

Result

Now Print all characters with its index value

Example

Result

HTML head tag

As we have already seen the structure of html document. The root of the document is html tag then there are two child tags head and body.
Head tag contains meta data of a web page like title, meta,link,base.

Syntax

Example

HTML Subscript and Superscript tags

To show data in subscript and in superscript format we use <sub>..</sub> and <sup>..</sup> tags.

Example:

Output:

X2+Y2
H2O

HTML Bold Italic & Underline Tags

For creating bold Itelic and Underline text we use following syntax.
We can also use nesting of tags

Example:

Output:

This is bold text
This is italic text
This text is underline
This is bold and italic text

HTML 5 Document Structure

General Synax of html5 is

<!DOCTYPE html> specifies that this document is html 5 document and you can use all html5 tags here.
<head> specifies that this portion contains heading information of page we can use many other tags here like <title> which is used to specify the title of page and may other.
<body> we put the contents which you would like to display on browser.
Inside body tag we use many different html tags to proper formatting the data.

HTML pre tag

The pre tag is used to display preformatted text in HTML document. pre tag preserves the content structure it can be used to show pre-formated data stored in the database and in another documents and to show computer codes programs to HTML document.

Syntax:

Example:

Result:

Pre tag can also be used to represent formatted computer codes like programing language code to show in HTML document like below

Example:

Result:

HTML br tag

The br tag is used to break the line.
It does not have closing tag.

Example:

Result:
Hello How are you.

Feeling well.

HTML hr tag

Hr is used to show horizontal line in html document.
When ever we have to give any horizontal row between two element we use this tag
Hr does not have any closing tag.

Syntax

Example:

Output:

Hello How are you


Whats going on

HTML List

In Html we can provide three types of list

  1. Ordered List
  2. Unordered List
  3. Definition List

Ordered List
This list are used to show information where order is important. for this we use ol tag.
inside <ol>..</ol> we use <li> tag.

Syntax

We can use type attribute to show list number type.

  1. <ol type=”1″ value=”1″> list start with number 1 and its type is numberic
  2. <ol type=”1″ value=”5″> list start with number 5 and its type is numberic
  3. <ol type=”A”>  list start with capital letter A
  4. <ol type=”A” value=”3″>  list start with capital letter C
  5. <ol type=”a”> list will start with small letter a
  6. <ol type=”I”> list will start with capital roman letter
  7. <ol type=”i”> list will start with small roman letter

Example:

Output:

Top 5 ranking of Student

  1. Mohan
  2. Ramesh
  3. Nitesh
  4. Nita
  5. Manish

Unordered List
This list are used to show information where order is not important. for this we use ul tag.
inside <ul>..</ul> we use <li> tag.

You can use type attribute for showing different list market type.
like <li type=”disc”>, <li type=”circle”> or <li type=”square”>

Example:

Output:

Student participation

  • Mohan
  • Ramesh
  • Nitesh
  • Nita
  • Manish

Definition List
To provide terms with definition we use definition list
for using definition list we use <dl>..</dl> tag.
Inside dt tag we use <dt>..</dt> for term to define
For definition(description) of term we use <dd>..</dd>

Example:

Output:

Keyboard
An input device
Monitor
An output device

We can also use nested list means list inside another list of any kind.

HTML Table rowspan and colspan

To span a row more than a single row we can use rowspan attribute.

Example:

Group 1 Manish Durg India 
Manoj Bhopal India 

Group 2 Rohit Banglore India 
Nitesh Bhopal India  

Output:

Group 1 Manish Durg India
Manoj Bhopal India
Group 2 Rohit Banglore India
Nitesh Bhopal India

To span a column more than a single column we can use colspan attribute.
Example:

Output:

Group 1
Manish Durg India
Manoj Bhopal India
Group 2
Rohit Banglore India
Nitesh Bhopal India
Managed by MochaHost - Fast & Easy WordPress Hosting