The hypertext markup language (HTML) is a computer language that is part of most web pages and online applications. A hypertext is a text that is used to link to other texts, while a markup language is a series of marks that tell web servers the structure and style of a document.
In this article, we’ll go over the basics of HTML, including how it works, its advantages and disadvantages, and its relationship to HTML. CSS Y javascript.
The most used HTML tags and elements
Currently, there are 142 HTML tags that allow us to . Although modern browsers no longer support some of these tags, learning the different elements available is still beneficial.
In this section we will talk about the most used HTML tags and two main elements: the block elements and the online items.
block elements
A block element occupies the full width of the page. It always starts a new line in the document. For example, an element of header will be on a separate line from an element of paragraph.
All HTML pages use these three tags:
- The label is the root element that defines the entire HTML document.
- The label contains meta information such as the title and character set of the page.
- The label encloses all the content that appears on the page.
Other popular block tags are:
- header tags. These range from
a where h1 is the largest size, decreasing as you go down to h6. - paragraph tags. All are enclosed using the tag .
- List tags. They have different variations. Use the tag
online elements
An inline element formats the internal content of block elements, for example by adding links and emphasized text. Inline elements are primarily used to format text without breaking the flow of the content.
For example, a label displays an element in bold, while the label displays it in italics. Hyperlinks are also inline elements that use a tag and an attribute href to indicate the destination of the link:
How does HTML work?
HTML is not considered a programming language, since it cannot create dynamic functionality. Instead, with HTML, web users can create and structure sections, paragraphs, and links using elements, tags, and attributes.
Here are some of the most common uses of HTML:
- Web development. Developers use HTML code to design the way a browser displays web page elements, such as text, hyperlinks, and media files.
- Web browsing. Visitors can easily navigate and follow links between related pages and websites, as HTML is largely used to embed hyperlinks.
- web documentation. HTML allows you to organize and format documents, similar to Microsoft Word.
HTML was invented by Tim Berners-Lee, a physicist at the CERN research institute in Switzerland. He came up with the idea of an Internet-based hypertext system and published the first version of HTML in 1991. Since then, each new version of the HTML language comes with new tags and attributes for markup.
It’s also worth noting that HTML is now considered an official web standard. He maintains and develops the HTML specifications, as well as providing regular updates.
A normal website includes several different HTML pages. For example, one homepagea Presentation page and one contact page they have different HTML files.
HTML documents are files that end with an extension .html either .htm. The web browser reads the HTML file and displays its content so that Internet users can view it.
All HTML pages have a series of HTML elementsmade up of a set of labels Y attributes. HTML elements are the building blocks of a web page. A tag tells the browser where an element begins and ends, while an attribute describes the characteristics of an element.
The three main parts of an element are:
- opening tag. Used to indicate where an item starts to take effect. This is wrapped with opening and closing brackets. For example, use the opening tag to create a paragraph.
- Contents. It is the result that other users see.
- closing tag. Same as opening, but with a forward slash before the element name. For example, to end a paragraph.
The combination of these three parts will create an HTML element:
This is how to add a paragraph in HTML.
Another fundamental part of an HTML element is its attributewhich has two sections: a Name and a attribute value. The name identifies the additional information that the user wants to add, while the attribute value gives more specifics.
For example, a style element that adds the color purple and typography verdana will look like this:
This is how to add a paragraph in HTML.
Another attribute, the class, is the most important for development and programming. The class attribute adds styling information that can work on different elements with the same class value.
For example, we will use the same style for a header
and a paragraph . The style includes the background color, text color, border, margin, and padding, under the class .important. To get the same style between Y to nothing class=’important’ after each opening tag:
This is a title.
This is a paragraph.
Most elements have an opening and closing tag, but some elements don’t need closing tags to work, like empty elements. These elements do not use a closing tag because they have no content:
This image tag has two attributes: an attribute srcthe image path, and an attribute alt, the descriptive text. However, it has no content or end tag.
Lastly, every HTML document must begin with a declaration to inform the browser about the document type. With HTML5, the public HTML doctype declaration will be:
HTML Evolution: What is the difference between HTML and HTML5?
The first version of HTML consisted of 18 tags. Since then, each new version brought new tags and attributes added to the markup. The most significant update to the language so far was the introduction of HTML5 in 2014.
The main one is that the latter supports new types of form controls. HTML5 also introduced various semantic tags that clearly describe content, such as
Advantages and disadvantages of HTML
Like any other computer language, HTML has its strengths and limitations.
Advantage:
- For starters. HTML has clean and consistent markup, as well as a fairly steep learning curve.
- Support. The language is widely used, with many resources and a large supportive community.
- Accessible. It is open source and completely free. HTML runs natively in all web browsers.
- Flexible. HTML is easily embeddable with backend languages like and .
Disadvantages:
- Static. This language is mainly used for static web pages. For dynamic functionality, it may be necessary to use JavaScript or a back-end language such as PHP.
- Standalone HTML Page. Users have to create individual web pages for HTML, even though the elements are the same.
- Browser Compatibility. Some browsers are slow to adopt new features. Sometimes older browsers don’t render the new tags.
How are HTML, CSS and JavaScript related?
HTML is used to add text elements and create the structure of the content. However, it is not enough to build a professional and fully responsive website. Therefore, HTML needs the help of and to create most of the content of the website.
The CSS is responsible for styles like the background, colors, layout, spacing, and animations. On the other hand, JavaScript adds dynamic features like sliders, pop-ups, and photo galleries. These three languages are the foundations of front-end development.
Understand HTML and improve your knowledge
It is a great first step for those who want to .
There’s a ton to learn how to code, but we’ve listed three of the best HTML course platforms:
- . It has resources, examples, and exercises to learn basic HTML the easy way. free. There is also a self-paced HTML tutorial that costs 95 dollars and provides an official certificate.
- . Offers introductory courses free with interactive tutorials. Codecademy uses a split screen that automatically displays the result of your code in an HTML file. Exclusive content is available by $19.99 per month.
- . It offers various courses with detailed explanations and real-life examples. The subscription price is $49 a month and there is one 7 day free trial to get started.
Without going any further, you can learn how to create an HTML website with our Academy video.
Subscribe for more educational videos!
academy
conclusion
HTML is the main markup language of the Internet. Each HTML page has a series of elements that create the structure of the content of a web page or application.
HTML is a beginner-friendly language with great support and is mainly used for static web pages. HTML works best in conjunction with CSS for styling and JavaScript for functionality.
We’ve also included some of the best courses available online that will help you improve your HTML skills and give you a basic understanding of the language.
Let us know in the comments section if you have any other favorite resources for learning HTML. Good luck!
Gustavo is passionate about creating websites. He focuses on the application of SEO strategies at for Spain and Latin America, as well as the creation of high-level content. When he is not applying new tricks in WordPress you can find him playing the guitar, traveling or taking an online course….