The heaven for Technology Learner

Author - Baboolal Yadav
02 July. 2 min read

WHAT IS HTML


COMMENTS IN HTML


HISTORY OF HTML


TAGS

  1. HTML tags are surrounded by the two characters < and > (They are called angle bracket).
  2. The tag name can either start from an alphabet or an underscore(_).
  3. The text between the start and end tags is the element content.
  4. Tags with an opening and closing can have any number of tags within itself.
  5. HTML tags are not case sensitive, p means the P.
  6. HTML tags normally comes in pairs(container tags), i.e. both opening and closing(it is same, just the name of the tag with character '/ ' in the beginning) tag.
  7. Eg: and is a tag.
  8. Eg: br does not have a closing tag.

Description of tags used

DOCTYPE

HTML ELEMENTS

Basic Syntax of HTML

        <!DOCTYPE html>
        <html>
        <head>
        </head>
        <body>
            <h1>This is a h1 tag</h1>
            <P>This is a paragraph tag</p>
        </body>
        </html>
    

Paragraphs

        <P>This is a paragraph tag</p>
    

Headings

        <h1>This is a h1 heading tag</h1>
        <h2>This is a h2 heading tag</h2>
        <h3>This is a h3 heading tag</h3>
        <h4>This is a h4 heading tag</h4>
        <h5>This is a h5 heading tag</h5>
        <h6>This is a h6 heading tag</h6>
    

BR Tag

        <br>This is a br tag</br>
    

LIST

Unordered Lists

  1. type="disc" - sets the list item marker to a bullet (default).
  2. ype="circle" - sets the list item marker to a circle.
  3. type="square" - sets the list item marker to a squar.
  4. type="none" - the lists items will not be marked.

        <ul type="disc">
            <li>Item 1</li>
            <li>Item 2</li>
            <li>Item 3</li>
        </ul>
    

Ordered List

  1. type="1" - The list items will be numbered with numbers(default).
  2. type="A" - The list items will be numbered with uppercase letters.
  3. type="a" - The list items will be numbered with lowercas letters.
  4. type="I" - The list items will be numbered with uppercase roman numbers.
  5. type="i" - The list items will be numbered with lowercase roman numbers.

        <ol type="A">
            <li>Item 1</li>
            <li>Item 2</li>
            <li>Item 3</li>
        </ol>
    

Description Lists

        <dl>
            <dt>Term 1</dt>
                <dd>Description 1</dd>
            <dt>Term 2</dt>
                <dd>Description 2</dd>
            <dt>Term 3</dt>
                <dd>Description 3</dd>
        </dl>
    

NESTING ELEMENT

        <div>
            <h1>Main Heading</h1>
            <p>Paragraph 1</p>
            
            <div>
                <h2>Sub Heading</h2>
                <p>Paragraph 2</p>
            </div>
            
            <p>Paragraph 3</p>
        </div>
    

IMAGES IN HTML

  1. tag is a self closing tag which means that it doesn't contain the closing tag.
  2. The src tag can contain both relative and absolute paths, as well as internet image links.
        <img src="image.jpg" alt="Image Description" width="300" height="200">
        

The ALT Attribute

Height and Width

ATTRIBUTES

  1. Attributes always come in name/value pairs like this: attribute_name="value".
  2. Attributes are always added to the start tag of an HTML element.
  3. Attribute values should always be enclosed in quotes. Double style quotes (“ ”) are the most common, but single style quotes (‘ ’) are also allowed.
  4. In some rare situations, like when the attribute value itself contains quotes, it is necessary to use single quotes: name='John "ShotGun" Nelson' and vice-versa.

ANCHOR TAG

  1. An unvisited link is underlined and blue.
  2. A visited link is underlined and purple.
  3. An active link is underlined and red.
        <a href="https://example.com" target="_blank" class="link" id="link-1">Click here</a>
        

href Attribute

Relative and Absolute Linking

  1. File is present in the same folder - In this case, the name of the file is provided. Eg: a href="relativeFile.html">Click Me /a>, will look for the file inside the same
  2. File is present in the subfolder - In this case, the name of the file provided is preceded with the folder names according to hierarchy. Eg: a href="subfolder/down/relativeFile.html">Click Me /a>, will move to the 'subfolder' folder, then to 'down' folder and look
  3. File is present somewhere in the parent folder - In this case, to move one folder above use '../'. Eg: a href="../relativeFile.html">Click Me /a>, will move to the parent folder and look
  4. File is present in another subfolder of parent folder - This case covers above two cases. Eg: a href="../subfolder/relativeFile.html">Click Me /a>, will move to the parent folder, then to folder named 'subfolder' and look for the file inside it.

target Attribut

  1. _self: load the URL into the current tab itself. This is the default.
  2. _blank: load the URL into a new tab or browser window.
  3. _parent: load the URL into the parent browsing context. If there is no parent, this behaves same as _self.
  4. _top: load the URL into the top-level browsing context. If there is no parent, this behaves same as _self.

HTML Audio

        <audio src="audio.mp3" controls>
            Your browser does not support the audio element.
        </audio>
        

HTML Video

        <video src="video.mp4" controls width="640" height="360">
            Your browser does not support the video element.
        </video>
        

People who read this also read

article

Learn more about Java

Author Name
07 January | 6 min read
article

Learn more about Python

Author Name
07 January | 6 min read
article

Learn more about Machine Learning techniques in India by joining this channel

Author Name
07 January | 6 min read