Results 1 to 2 of 2

Thread: What is the key difference between HTML Elements and Tags?

  1. #1
    Join Date
    Jul 2022
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default What is the key difference between HTML Elements and Tags?

    What is the key difference between HTML Elements and Tags?

  2. #2
    Join Date
    Nov 2006
    Location
    chertsey, a small town 25 miles south west of london, england.
    Posts
    2,349
    Thanks
    4
    Thanked 289 Times in 282 Posts

    Default

    Hi there komalimam,

    HTML elements are a list of available elements for the HTML coder...

    MDN - HTML elements reference

    HTML tags are the way the HTML coder writes the code,

    For example the root element of an HTML document is the html element
    itself and as it contains content it has an opening and a closing tag...

    Code:
    <html lang="en">
    
    </html>


    In this case lang="eng" is it's attribute.

    The next HTML element of the HTML document is the meta element which
    does not contain content and would be coded like this...

    Code:
    <meta charset="utf-8">
    In this case charset="utf-8" is it's attribute.

    A basic HTML document would look like this...

    Code:
    <!DOCTYPE HTML>
    <html lang="en">
    <head>
    
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width,height=device-height,initial-scale=1">
    
    <title>The title of the document</title>
    
    <link rel="stylesheet" href="screen.css" media="screen">
    
    </head>
    <body>
       
    
    </body>
    </html>

    coothead
    ~ the original bald headed old fart ~

Similar Threads

  1. Replies: 7
    Last Post: 08-08-2008, 04:21 PM
  2. Replies: 1
    Last Post: 05-31-2005, 12:12 PM

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
  •