Introduction to HTML

What is Html?

Text Editor

File Extensions

As diffferent application software has different extention like

To save html file we have to type .html as extention to run it on browser.

HTML basic tags

Format of HTML

<!DOCTYPE html>
<html>
<head>
</head>
<body>
</body>
</html>

Mojor Parts

A tag name has three major parts:

-Opening tag

-content

-Closing tag

Element without closing tags

Page 1

Start tag Element content End tag
<h1> My First Heading </h1>
<p> My First paragraph </p>

Other Tags

HTML Headings

HTML Paragraph

Example

Fonts and Formating

Font Size

Font Color

Page 2

Font face

Other Font Formatting Tags

Tags and Attributes

Attribute

Title attribute

Page 3

Align Attribute

Note-Attribute Defaults

Generic Attribute

Attribute Options Function
align right,left,center Horizontally align tags
bgcolor numeric, RGB values numeric, hexidecimal, RCB values
background URL places an background image behind an element
width Numeric Value Specifies the width of tables, images, or table cells
height Numeric Value Specifies the height of tables, images, or table cells
title User Defined "Pop-up" title for your elements.
class User Defined Classifies an element for use with cascading style sheets.

Comments in HTML

<!--comment here -->

HTML Chracter Entities(Symbols)

Page 4

1. Ordered List(OL)

2. Unordered list

3. Defination Terms lists

Linking

The <a> tag

1: Linking another Document

Attributes

2: Bookmark inside document

Page 6

Using file "html links.asp"

  1. Label: This label is called name anchor.
  2. <a name="label">Text to be displaced</a>
  3. Bookmark: A hyperlink to the label section WITHIN the file "html_links.asp" will look like this:
  4. <a href="#label">Jump to the label section</a>

3: Open Mail client

Directory Structure

Inserting Images

HTML <img> tag

Images Tag Attribute

SRG

Align

  • Left and Right
  • Specifies how to align the image Departed use styles insted
  • Border

    Height

    Hspace

    Page 7

    Vspace

    device-width

    Alt

    Placing floating images

    Images as link

    Inserting Pictures

    HTML <picture> tag

    Example
    <picture>
    <source srcset="img_food.jpg">
    <source srcset="img_car.jpg">
    <source srcset="img_girl.jpg">
    </picture>

    When to use the Picture Element

    Media Attribute

    <picture>
    <source media="(min-width:650px)" srcset="img_food.jpg">
    <source media="(min-width:650px)" srcset="img_car.jpg">
    <source src="img_girl.jpg">
    </picture>

    Page 8

    Tables

    Table(Basic tags)

    <table border="1">
    <tr>
    <td>row1, cell 1</td>
    <td>row 1, cell 2</td>
    </tr>
    <tr>
    <td>row 2, cell 1</td>
    <td>row 2, cell 2</td>
    </td>
    </table>

    Heading in a Table

    TABLE ATTRIBUTE

    create a table with

    Rowspan

    <tr>
    <th rowspan="2"></th>
    <td>55577854</td>
    </tr>
    <tr>
    <td>55577854</td>
    </tr>

    Page 9

    Colspan

    <tr>
    <th>Telephone</th>
    </tr>
    <tr>
    <td>55577854</td>
    <td>55577855</td>
    </tr>

    Border attribute

    create a table with

    Create a table with

    <table border="6">
    <caption>My Caption</cpation>
    <tr>
    <td>100</td>
    </tr>
    </border>

    Create table with

    Forms

    What are Forms

    Form tag Attributes

    1. Action:- Specifies the name of the file to send the content to
    2. Method:- The "post" and "get" methods are two different methods for submitting data.

    Form Elements

    1. TEXT FIELD:-

    Text fields allow the user to input text in a single line.

    Attribute:

    1. type= 'text':- Set the input field
    2. size = '20':- Sets the width of the field
    3. maxlength = '30':- sets the maximum length of the field
    4. name:- Sets an internal name of the field
    5. value:- Defines intial value in the field

    2. TEXT AREA:-

    ATTRIBUTES

    1. Rows:- no. of rows to be merged in text area.
    2. Cols:- no. of columns to be merged in text area.
    3. Name:- adds an internal name to the field.

    <textarea cols="30" rows="10">
    Everything written between these tags will be presented in the textarea box.
    </textarea>

    3. Select Element:-

    To make drop-down menus serve the same purpose radio buttons cone selection
    only or check boxes, is that it takes up less space.

    Vehicle: <select name="vehicles">
    <option value="bike">Bike</option>
    <option value="car">car </option>
    <option value="cycle">cycle</option>
    </select>

    ATTRIBUTES for select

    1. Name:- Adds an internal name of the field
    2. Multiply:- Allows multiple choices if yes.
    3. Option:- Individual items in the menu.
    4. Size:- Use the size attribute to specify the number of visible values.

    ATTRIBUTES FOR OPTIONS

    1. Selected:- Default select the item
    2. Value:- Value to send if selected

    Page 11

    4.<fieldset> and <legend> Elements:-

    5. <datalist> Element


    <from action="/action_page.php">
    <input list="browsers">
    <datalist name="browsers">
    <option value="browser">
    <option value ="Internet Explorer">
    <option value="Firefox">
    <option value="Chrome">
    <option value="Opera">
    <option value="Safari">
    </datalist>
    </form>

    6. <button> Element:-

    The <button> element defines a clickable button

    <button type="button" oneclick="alert('Hello World!')">Click Me!</button>

    Input Types

    1. PASSWORD:-

    Password fields are similar to text fields. They show dots on the screen to prevent others
    from reading the password you type.


    <form method="post" action="mailto:info@intuiteducation.org">
    Name:<input type="text" size="10" maxlength="40" name="name">
    <br/>
    Password:<input type="password" size="10" maxlength="10" name="password">
    </form≫

    2. RADIO:-

    Radio Buttons are used to let the user select one and only one option of a limited number of
    choices.

    ATTRIBUTES

    <input class="radio" name="sex" value="male">Male
    <input class="radio" name="sex" value="female">Female

    3. CHECKBOXES:-

    Checkboxes are used to let user select one or more options of limited number of
    choices.

    <form>
    I have a bike: <input type="checkbox" name="vehicle" value="Bike">
    I have a car: <input type="checkbox" name="vehicle" value="Car">
    I have a Airplane: <input type="checkbox" name="vehicle" value="Airplane">
    </form>

    4. SUBMIT:-

    Allows the user to submit the information.
    1. Name:- Name of the button
    2. Value:- Text written on the button

    5. RESET:-

    Allows the user to reset the values entered in the form to the default values.

    6.Color:-Used for input field that should a color.

    7.Date:-Used for input fields that contain a date ,min and max attributes to add restriotions to dates.

    8.Datetime-local:-specifies a date and time input field,with no time zone.

    9.Email:-Used for input fields that should contain an email address

    10.File:-Defines a select field and a "Browser" button for file uploads.

    11.Month:-allows the user to selecr a yesr or month.

    12.Number:-Defines a numeric input field. You can also set restrictions on what number are accepted by
    using max and min attribute.

    13.Range:-Defines a control for entering a number whose exact value is not important (like a slider control)

    14.Tel:-Used for input fields that should contain a telephone number.

    15.Url:-Input type Url.

    What are frames?

    Attribute Description
    checked Specifies that an input field should be pre-selected when the page loads.
    max Specifies the maximum value for an input field
    maxlength Specifies the maximum number of chracter for an input field
    min Specifies the minimum value for an input field
    pattern Specifies a regular expression to check the input value aginst
    autofocus Specifies that field should automatically get focus where the page
    loads.
    Attribute Description
    readonly Specifies that an input field is read only (cannot be changed)
    required Specifies that an input field is required (must be filled out)
    size Specifies the width (in chracters) of an input field
    step Specifies the legal number interval for an input field.
    value Specifies the default value for an input field.
    placeholder Specifies short a hint that describes the expected value of an input field.

    <html>
    <frameset cols="25%">
    <frame src="left.html">
    <frame src="right.html" name="display">
    </frameset>
    </html>