payment by upi: sinhamit@icici or payment by bank account name: amit kumar sinha, account number: 2646728782 IFSC code: KKBK0005660 SWIFT: KKBKINBB

Please support if you like my work by payment through upi: sinhamit@icici or payment by bank

account name: Amit Kumar Sinha,
account number: 2646728782
IFSC code: KKBK0005660
SWIFT: KKBKINBB


Comments & Opening and Closing Tags   in Category: HTML   by amit

🕙 Posted on 2023-04-03 at 08:20:31     Read in Hindi ...


<!-- Comments in HTML -->

    Comments in any programming or scripting language, means that they will not be visible to general public at large. However, comments are written to describe internal and back-end usage of codes. Comments help programmers, developers and designers to understand what is the purpose of a block / group of codes.

    When you will work on large amount of CODES, after learning HTML, CSS, JavaScript, PHP, Python, MySQL, etc., these comments already written by you, or your colleague or associate, or any other programmer, RECALL your memory, to understand what below-mentioned CODES are for.

    Comments in HTML are written within <!-- and -->, that is, with ! (exclamation symbol) and two dashes just after < symbol, and two dashes just before > symbol. There must not be any space between symbols, otherwise all contents written will either not be commented (in case of first tag), or remained commented (in case of second tag).

Comments in Other Languages

    It should be worth mentioning of writing COMMENTS in other scripting and programming languages, because they will oftenly be used. In PHP and JavaScript, comments are written in following two ways:

1) Single Line Comments

// single line comment are written with two forward-slash
// you should not write anything after the single line comment
// You should use new line with Enter or Return key from your keyboard
// (not line-break HTML tag as explained below).

2) Multi-Line or Inline Comments

/* multi-line or inline comments are written in PHP, JavaScript and CSS (within a block of code) like this,
that is starting with forward-slash and asterik symbols;
and ending with asterik and forward-slash symbols
Anything written within the pair of starting and ending symbols are not interpreted by the WEB-Browser, Server, or Console. */

3) Single Line Comment in Python

# Single Line Comment in Python is written with hash symbol (press Shift 3 keys)
# hash symbol is also used to comment in PHP (less common)

Opening and Closing TAGs

    The first tag of a pair of HTML same tags, is called as OPENING tag. The second tag of the pair of same HTML tags, is called as CLOSING tag. Some HTML elements consist of single tag, having no attributes inside them. Those are called EMPTY HTML elements, for example <br> (to insert a line-break) and <hr> (to insert a horizontal line). <meta > and <link > tags are also single HTML tag, but they have attributes inside them.

    <link href=""> is used to import external file, such as EXTERNAL STYLESHEET, CSS into the web-browser (see next page). There is another HTML element <a href="https://ribhuacademy.com/"> Go to Another Web Page </a>, which is known as anchor tag. Both HTML elements have same href attribute. This comparable study of different TAGs / Elements / attributes and even two or more programming languages, will help you to differentiate them clearly.

    In some programming languages, frameworks, and applications, it is insisted that you must close these single HTML tags with / (forward-slash symbol), that is, <br /> <hr /> <meta /> <link />. Therefore, you should grow good programming practices in CODING though HTML is a forgiving and case-insensitive language. When you write any HTML tag, attribute or values inside some attributes, they are generally treated as correct HTML elements, and the WEB BROWSER tries to load them as much as possible. You have also seen this, when some HTML tags are written in Introduction page, but in web-browser, additional HTML tags are automatically added as shown in image below.

<illustration> some text </illustration><p><mark>Hello <strong>NEW</strong> World.</mark></p>


    However, you should use lowercase (ENGLISH) letters to write HTML tags, attributes, and maintain decorum so that web-browser can load the web-page correctly.


Leave a Comment: