Results 1 to 2 of 2

Thread: HTML Tag Attributes and Values

  1. #1
    peshawarman's Avatar
    peshawarman is offline Senior Member+
    Last Online
    1st May 2018 @ 04:17 PM
    Join Date
    03 Mar 2012
    Location
    Gulbahar no 3 peshawar
    Age
    28
    Gender
    Male
    Posts
    476
    Threads
    79
    Credits
    15
    Thanked
    54

    Thumbs down HTML Tag Attributes and Values

    HTML Tutorial: HTML Tag Attributes and Values

    If you've followed this series from the beginning you've already learned what HTML tags are and the you've learned the basic HTML skeleton. Now I'll introduce a new tag, plus tag attributes and values. Tag attributes and values provide additional instructions to the browser. For example, suppose you want to put an image on your web page. An image tag is written as follows:
    <img />
    That's the basic image tag, but it doesn't tell the browser which image to display or where to find it. We give the browser that information by adding the source attribute and value.
    The source attribute is written as src, with the vowels removed from the word source. If the image you wanted to add was a picture of your new bicycle and the picture was saved as bike.jpg, and it was kept in the same folder as your HTML page, then the attribute and value you'd add to the image source tag is:

    src="bike.jpg"
    In that example, src is the attribute and bike.jpg is the value of the attribute. IN HTML, an attribute usually either indentifies a source or defines an element. In this case, the attribute identifies the image source.
    An example of an attribute defining an element would be adding the width and height attributes and values to the image.

    So then, an attribute defines or identifies an element, and the attribute has a value attached to it by the equal sign (=), with the actual value enclosed in quotation marks. The entire code then, would be written as:

    <img src="bike.jpg" />
    Note: Most HTML elements have a corresponding closing tag, but there isn't a closing tag for the image element. To make HTML tags that don't have a corresponding closing tag up to date, which means compliant with XHTML, a space and forward slash is added to the end of the tag, thereby making it a self-closed tag. This is optional, however, and coding an image without the trailing space/slash is perfectly valid at this time.

    If it seems complicated, relax. In the next step we'll have you make a simple web page in just minutes so you can see how easy it really is!

  2. #2
    RaheelSaudia's Avatar
    RaheelSaudia is offline Senior Member+
    Last Online
    18th January 2017 @ 06:49 AM
    Join Date
    11 Apr 2012
    Location
    jeddah Saudia arabia
    Age
    36
    Gender
    Male
    Posts
    33
    Threads
    3
    Credits
    0
    Thanked: 1

    Default nice shering

    nice shering

Similar Threads

  1. Basic HTML
    By peshawarman in forum English IT Zone
    Replies: 9
    Last Post: 8th April 2012, 04:11 PM
  2. cSS kIYA hota hai Kiya karta haii!
    By Rau7* in forum English IT Zone
    Replies: 5
    Last Post: 14th March 2009, 04:54 PM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •