what is HTML how it works?

                                     HTML (Hypertext Markup Language)



Defination:

A text-based language called HTML (Hypertext Markup Language) is used to describe the organisation of content in an HTML file. This markup instructs a web browser on how to present text, pictures, and other multimedia on a webpage.


All of the major online browsers, including desktop and mobile web browsers, typically follow HTML, which is an official recommendation by the World Wide Web Consortium (W3C). The most recent specification is HTML 5.

How HTML operates

A text file marked as HTML should be interpreted as such by a computer and a web server since it follows specified syntax, file, and name conventions. A user can create and design a simple webpage and upload it to the internet by applying these HTML principles to a text file in almost any text editor.


The inclusion of a document type declaration at the start of the text file is the most fundamental HTML convention. As the part that explicitly tells a computer that this file is an HTML file, it always comes first in the document. Typically, the document heading looks like this:. Always write it in that format, without any text.


Doctypes can be used to create any SGML-based document, not just HTML-based ones (Standard Generalized Markup Language). A specific markup language is specified by the SGML standard. One of the markup languages to which SGML and doctype declarations are applicable is HTML.


The.html file extension is another essential prerequisite for producing an HTML file. The file extension communicates HTML to the computer from the outside of the file, as opposed to the doctype declaration, which communicates HTML from within the file. When a file has both, a computer may recognise it as an HTML file whether it is being read or not. The importance of this increases when uploading the files to the web.


HTML files that relate to the website's pages. As each page references the same file paths of the other pages, enabling links between them, it is crucial that the user uploads these files in the exact hierarchy that they saved them in. Links will break and pages will disappear if they are uploaded in a different order since the supplied file paths do not correspond to the pages.


HTML's basic elements:

A text file can be further marked up using HTML with text that specifies how it should be presented. A unique, distinctive HTML syntax is utilised to keep the markup distinct from the HTML file's real content. These unique elements are referred to as HTML tags. An HTML element is a piece of content that is contained within a tag and can contain name-value combinations known as attributes.


There are always starting tags, middle content, and closing tags for HTML elements. The opening tag contains attributes, which can provide the element further details. There are two ways to characterise an element:


1.The document's block-level elements begin on a new line and occupy their own space. These components include headers and paragraph tags, as examples.

2.In the document, inline items merely occupy the space that is required and do not begin on a new line. The contents of block-level components are typically formatted by these elements. Inline components include things like text format tags and hyperlinks.


Cons and benefits of HTML

Use of HTML has advantages, such as:


has a great number of resources and is widely used.

runs natively on all browsers.

Is rather simple to learn.

Has a tidy and reliable source code.

Is free to use and open source.

Is compatible with different backend programming languages, including PHP.


Consider the following drawbacks


Is mostly used for static web pages and has not very dynamic features.

Even though the components share identical elements, each one must be developed separately.

Unpredictable browser behaviour is possible. For instance, newer features might not work with outdated browsers.


HTML tags frequently used:

A page's overall structure and the way its elements are displayed in browsers are determined by HTML tags. Typical HTML tags include:


a top-level heading is described by the h1> tag.


h2>, a second-level heading description.


It denotes a paragraph (p).


a table that details tabular data


which refers to an organised list of data.


Information is listed in an unordered list using the tag ul>.


There are opening and closing tags around the content they are enhancing, as was already described. An starting tag has the following format: p. The same rules apply to closing tags, but they include a backslash to signify that the provided HTML element has ended. The closing tag is written as /p>.


How to utilise and apply HTML


Since HTML is entirely text-based, it is possible to modify an HTML file by simply opening it in a tool like Notepad++, Vi, or Emacs. An HTML file can be created or edited in any text editor, and as long as it has the.html file extension, any web browser, including Chrome or Firefox, can view the file as a webpage.

There are numerous WYSIWYG editors available for use by professional software developers to create webpages. WYSIWYG editors are offered as plugins or standard components by NetBeans, IntelliJ, Eclipse, and Microsoft's Visual Studio, making HTML incredibly simple to use and implement.


Although contemporary online browsers frequently come with web developer plugins that will show issues with HTML pages, such as a missing closing tag or syntax that does not produce well-formed HTML, these WYSIWYG editors also offer HTML debugging capabilities.


Both Chrome and Firefox come with HTML developer tools that let you view a webpage's entire HTML file right away, edit HTML while you're browsing, and update HTML while the browser is still open.


CSS, HTML, and JavaScript

Although it can be used to build webpages, HTML has several limitations when it comes to fully responsive elements. As a result, adding text components and organising them within a website should be the only uses for HTML. HTML can be used with JavaScript and CSS for features that are more complicated (JS).


An HTML file can have a link to a cascading style sheet or JS file, typically at the beginning of the document with a defined file path, that contains information on the rendering of HTML elements, including the colours and fonts to use. Additionally, JavaScript enables website designers to incorporate more dynamic features like pop-up windows and image sliders. HTML components are matched using tags referred to as class attributes.


For instance, a user can add code to the CSS file with a class attribute that makes text red if they want a specific amount of text to be that color. Then, they can add the corresponding class property to all of the text in the HTML sheet that they wish to be red. For JS sheets, the same fundamental approach is used, but with different functions.


Separation of concerns is a software development pattern and best practice that refers to separating information about how a page is constructed, or the function of HTML, from information about how a webpage appears when it is rendered in a browser.


The past and present

The sharing of academic papers and technical notes was made possible in the early days of the internet by simply adding HTML syntax to text-based publications. The demand for webpage formatting and interactivity increased as the internet spread outside of academic settings and into homes of the general public.


HTML 4.01 was introduced in 1999, before the internet had gained widespread recognition, and HTML5 wasn't standardised until 2014. HTML markup evolved during this period from merely describing the document structure of webpage content to also expressing how content should appear when a webpage is displayed.

As a result, HTML4-based webpages frequently contained information within a tag regarding the font to use when displaying text, the background colour to use, and the alignment of the content. It is regarded as an HTML antipattern to specify how an HTML element should be structured within an HTML tag when it is shown on a webpage. In general, HTML should explain how content is organised rather than how it will be stylized and shown in a browser. This task is better served by other markup languages.


One significant distinction between HTML4 and HTML5 is the stricter enforcement of the separation of concerns pattern in HTML5. The bold and italicise tags are no longer supported by HTML5. align is a paragraph tag attribute.


variations in HTML

The HTML versions and the years they were made are listed below. Each version has been issued in a number of variations over time. This list seeks to highlight noteworthy iterations.



When HTML 1.0 was published in 1992, it only supported about 20 elements and had very few features.


After its 1995 release, HTML 2.0 started to include components for math operations.


The math function initiative was completely abandoned in HTML 3.2, which was introduced in 1996. It also resolved overlap between several commercial extensions.


Three versions of HTML 4.0, each with a different limit on the amount of out-of-date elements, were made available after its 1997 release.


HTML 4.01, which was published in 1999, is essentially the same as 4.0.


The W3C, the group that created HTML, took a long pause from updating it before releasing HTML 5 in 2014. This was because W3C was concentrating on XHTML, a parallel language.

With new tags, HTML 5.1, which was published in 2016, sought to more readily support different types of media embedding.

Aiming to be equally comprehensible by humans and machines, HTML 5.2 was introduced in 2017.

W3C and WHATWG are working together to create HTML 5.3, which has not yet been released. The partnership started in 2019.


Attributes of HTML5

In order to improve interaction, multimedia capabilities, and semantic efficiency, HTML5 introduces a number of new components. Multimedia can be inserted directly into the HTML code rather than utilising plugins. These components consist of:


Graphics elements: canvas>, which generates a rectangular area that is empty and allows JavaScript to be used to draw in by site designers.

Scalable vector graphics are contained in the file format svg> (SVG).

Header, a semantic element that adds a header at the top of the page.

footer>, which adds a footer to the page's bottom.

<article>, which creates an area for independent content.

<section>, which defines sections and subsections such as chapters, or headers and footers when more than one are necessary.

<nav>, which creates a navigation menu.


HTML's audio> tag describes MP3, WAV, and OGG files as multimedia elements.

Describes MP4, WebM, and OGG video formats under "video"

Attributes that apply to the <form> element, which creates an area for user input on the web page. These include number, date, calendar and range.

Other main features of HTML5 include:


Elimination of outmoded or redundant attributes.

Offline editing.

The ability to drag and drop between HTML5 documents.

Messaging enhancements.

Detailed parsing MIME and protocol handler registration.

A common standard for storing data in SQL databases (Web SQL).

Application programme interfaces (API) for complex applications.

Accommodations for mobile device app development.

MathML for mathematical and scientific formulas.


While the inclusion of these capabilities shows a commitment to supporting multimedia embedding, modifications to the HTML standard show the community's desire for HTML to get back to its core function of specifying content structure. In essence, more structural features have been added, while a number of format-specific features have been phased out. Deprecated HTML tags will still be supported by web browsers for backward compatibility reasons, although eventually HTML will be primarily based on structure.


HTML syntax guidelines

There are two HTML components in the next HTML sample. The directional attribute dir is used by both elements, which share the same paragraph tag denoted by the letter p. However, the rtl and ltr HTML attribute name-value pairs have different attribute values.


The HTML tags influence how each HTML element is displayed on the page when this HTML snippet is rendered in a browser, but none of the HTML tags or attributes are displayed. HTML merely specifies how the content should be rendered. The final user never sees the HTML code itself.


A web browser requires well-formed HTML in order to show an HTML page without errors. Each HTML element needs to be enclosed with an opening tag in order to be well-formed —


— followed by a closing tag


Additionally, any new tags that are opened inside of other tags need to be closed before the parent tag is closed. Thus, for instance


perfect HTML


is properly formatted HTML, but


perfect HTML


is poorly formatted HTML.


One more syntactic regulation is


Maintaining consistency in the use of single and double quotations throughout all publications is the best piece of advise. To ensure uniform use across pages, HTML style-checkers can be utilized. Be aware that there are instances where using a single quotation is necessary, such as when an attribute value really contains a double quote character. The opposite is also accurate.


It's significant to remember that HTML only supports simple English. It's possible that non-English characters, such as Chinese, or special symbols, such as letters with accent marks, won't display properly on a website by default. Users must use an element that resembles this to indicate the character encoding in order to support unusual character sets: Meta character set is "utf-8." The character set in this instance is utf-8. HTML's standard English charset is Utf-8.




Comments

Popular posts from this blog

seven phases of system development life cycle

INTRODUCTION TO SQL AND SQL TOOL

what is digital marketing?