• Breaking News

    Business

    Saturday, March 28, 2015

    HTML Basics-General HTML Attributes and Attributes used with Body Tag

    HTML Basics-General HTML Attributes and Attributes used with Body Tag-HTML Attributes are used to change the properties of the tags. These attributes can be placed only in side the opening or the starting tag. Though some attributes do not require a value associated but generally a value is associated with each attribute. The attribute and value are separated by an equal to sign(=) and the value portion surrounded by quotation marks(Double inverted Commas). If the value portion contains spaces the quotation mark becomes a must. In practice the quotation marks are used always to avoid any chance of mistake. These are written like this - …text….
     
    HTML Basics-General HTML Attributes and Attributes used with Body Tag
    HTML Basics-General HTML Attributes and Attributes used with Body Tag

    General HTML Attributes


    ‘Align’ Attribute 


    The ‘Align attribute is used to set the alignment of HTML elements. The common value used are  (1) “Centre”(2) “Justify” (3) “Right” (4) “Left”. Please see this example –

    Main Heading
    The resultant display –

    Main Heading

    If we replace  “left” with “centre” the resultant display will change as –

    Main Heading

    ‘Color’ Attribute


    The color attribute is used to specify color. To specify a color we can give the color name such as ‘Blue’ or we can use hexadecimal code(The ‘#’ sign followed by 6 digits representing the primary colors ‘Red’, ‘Green’ and ‘Blue’ Popularly known as ‘RGB’) Examples –
                   (1)             Using Color name - Lucida

    (2)             Using Color Code - Lucida

    ‘Height’ Attribute and ‘Width’ Attribute


    The ‘height’ attribute and ‘width’ attributes are used to set the height and width of the element. We can use these attributes in two forms, (1) The absolute form and (2) The relative form. In absolute form we specify the absolute value such as “200”, “300” and in relative form it relates to the container such as ‘50%’, ‘60%’

    Example of absolute form -

    Example of relative form -

    HTML Attributes used with body Tag


    In HTML for the purpose of controlling the document as a whole, has some important attributes such as –
      
    (1)             Link – This attribute is used to specify the color of the link.
    (2)             Text – This attribute is used to specify the color of the text on the page.
    (3)             Vlink - This attribute is used to specify the color of the link visited earlier.
    (4)             Alink - This attribute is used to specify the color of a link active now.
    (5)             BGColor – This attribute is used to specify the background color of the document,
    (6)             Background – This attribute is used to set an image as back ground  of the page.

    The attributes explained above from serial no- 1 to Serial No-5  need color name such as “Blue”, “Red” or “Green” or Hexadecimal codes “#0000FF”, “#FF0000”, or “#008000” as value And the attribute ‘Background’ explained at serial No-6 will need an image URL as value.

    Example -   
    OR
                      

    When we use the attribute ‘background’ the attribute ‘bgcolor’ is overridden automatically and the background of the page will be formed by the image. In case the image could not be traced for any reason the attribute ‘bgcolor’ will work.

    Note – Some html attributes may work with some tags but may not work with others. For example ‘height’ and ‘width’ work good with but are meaningless if used with
    .







    No comments:

    Post a Comment

    Fashion

    Beauty

    Travel