dcsimg
www.webdeveloper.com
Results 1 to 9 of 9

Thread: What is the difference between Html Tag and html attribute?

Hybrid View

  1. #1
    Join Date
    Jul 2013
    Posts
    45

    What is the difference between Html Tag and html attribute?

    Hello,
    Tell me the difference between Html Tag and html attribute.

  2. #2
    Join Date
    Nov 2006
    Location
    Springfield, MO
    Posts
    1,541
    Html tag is <html>, while html attribute is <html lang="en">

  3. #3
    Join Date
    Jul 2013
    Posts
    1
    HTML tags
    -----------

    Tags are used to mark up the start and end of an HTML element.

    ex : <p>

    HTML attributes
    ----------------

    An attribute defines a property for an element, consists of an attribute/value pair, and appears within the element’s start tag.

    ex : <img src="banner.gif" alt="banner">

    Here is the link that might be useful, E-commerce Website

  4. #4
    Join Date
    Jun 2013
    Posts
    11
    We write Html tag like: <html>,

    and html attribute write like : <html lang="en">

  5. #5
    Join Date
    Jul 2013
    Posts
    8
    A tag is a declaration of a HTML object whereas an Attribute is a property of an object.

  6. #6
    Join Date
    Jul 2013
    Posts
    45
    Thanks to everyone for this information.

  7. #7
    Join Date
    Nov 2002
    Location
    Baltimore, Maryland
    Posts
    12,279
    Actually, those answers are wrong. They have elements and tags mixed up. An HTML document is built up out of elements and attributes. The Elements are all nested with the HTML element being the outer level / root element. Now each element may also contain certain attributes. A P element might contain the text node "Hello, World!" and also a style attribute. Attributes are in key / value pairs so the style attribute would be set to some value.

    Tags create elements and attributes. The tag <html lang=en"> creates an HTML element with a lang attribute with a value of "en". By convention we would call that whole thing the HTML tag and it creates the HTML element and its attributes.

    To make matters worse, tags are not the only way to create elements. In HTML the HTML, HEAD and BODY elements are required but the tags are not. If you omit the tags then the element is there nonetheless.
    “The power of the Web is in its universality. Access by everyone regardless of disability is an essential aspect.”
    —Tim Berners-Lee, W3C Director and inventor of the World Wide Web

  8. #8
    Join Date
    Jul 2013
    Posts
    3
    Hi,
    The tags describe document content
    Attributes provide additional information about an element

  9. #9
    Join Date
    May 2013
    Posts
    13
    An attribute defines property for a HTML tag like

    <img src="xyz.png" alt="banner">

    Here we can see that <img> is a html tag and "alt" is attribute of the img tag with the value "banner".

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Tags for this Thread

Posting Permissions

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



Recent Articles