What is a markup language?

Published

Blog image

When we talk about markup languages ​​in programming, we don't mean that someone is trying to increase the price of something. A markup is not a price increase. It is a method of representing data using a specific scripting language.

This guide explains what markup languages ​​are, how they work, and when you can use markup languages. We will also analyze three different markup languages ​​and their use cases so that you can gain a solid understanding of how markup languages ​​work.

What is a markup language?

Markup languages ​​are languages ​​used by a computer to annotate a document. These languages ​​are human-readable, i.e. that is, they are usually written using standard words and not the terminology of a technical programming language.

Markup languages ​​define the style and structure of a document so that a computer knows what the document should look like.

One way to imagine this is that markup languages ​​work in the same way that teachers "mark up" or "mark up" their students' tests. A teacher writes on the test where the student made a mistake so he knows how to fix it next time. The term "markup languages" comes from typesetting, where the instructions for constructing a document were "marked" next to the document.

Markup languages ​​do not necessarily have to be their own language. The last two examples still use markup, but it is not a markup language. The difference between markup languages ​​and markup languages ​​is that markup languages ​​contain a set of rules for using that language. And they are usually interpreted by computers. Markup, on the other hand, has no defined structure.

The ML in web development

If you've ever developed a website, you've probably heard of ML. HTML and XML, for example, both end in ML. Have you ever wondered what that means? Well, ML stands for Markup Language.

Markup languages ​​are used extensively in web development. They are used to describe how a specific set of data should be presented in a web document.

HTML (HyperText Markup Language) describes the structure of a website. XML, on the other hand, describes a specific type of data.

How markup languages ​​work

All markup languages ​​have one common feature: they use tags to identify different types of content on the web page. These markup symbols are usually written in angle brackets (<>).

Markup languages ​​need a way to distinguish the text they want to represent from the instructions the computer needs to read. Any text that appears within markup tags is interpreted by the machine as an instruction.

Consider this example:

RemoteScout

This is a link to the Career Karma homepage. We have used an tag to define this link, and when our link is over we close it with an tag.

These tags tell our computer that we want to render a link, or an anchor (which is where the “a” comes from). These tags will not appear on our web page. They are instructions for our web browser to read, so they know how to show a particular web page.

Markup files are saved as plain text documents. This means you can open them using a standard text editor.

Markup Languages vs. Programming Languages

It’s true: markup languages sounds like they should be programming languages. We’re talking about languages after all! Just because these two terms sound the same, it does not mean that they are the same thing.

A programming language is a set of instructions given to a computer that produces various different types of output. Ruby, Python and Perl are all programming languages. Markup languages, on the other hand, are used to describe a document.

While you can run a Python or Ruby program, you cannot "run" a tagged document. HTML documents, for example, are not executed but rather rendered by the browser. XML documents are also not executed; they are read by a special data reader.

What markup languages ​​are there?

If you search, you will come across a whole range of markup languages. There is so much data that we need multiple languages ​​to cover all possible use cases. The most common are HTML, XML and XHTML.

HyperText Markup Language

HyperText Markup Language, or HTML for short, is the most important language for web development. Without them there would be no websites. It defines the structure of a website, e.g. B. which titles, images and texts should appear on a page. It also determines the order in which these elements should appear in the browser. Conversely, CSS (Cascading Style Sheets) are used to define the layout and appearance of pages in the browser.

HTML is one of the standard markup languages. In HTML, tags are used to define every element on a web page, from titles to images to forms.

The HTML language is managed by the international organization World Wide Web Consortium (W3C). HTML is so important to the way the Internet works that a set of international standards is required to write and process it consistently.

The latest version of HTML is HTML5, which includes a number of improvements over the previous version. However, most changes to HTML occur gradually because the language is so important to the web.

eXtensible markup language

XML, the eXtensible Markup Language, was developed for transporting and storing data. The language is self-descriptive.

That's because there are no limits to how you can name your XML tags. There are no predefined tags, so you can choose names that accurately describe each point of data in an XML document.

Let's say you create a markup document to manage your favorite books. In XML you could use the following structure:

How to win friends and influence people

Dale Carnegie

In this example, we created four tags: book, title, author and rating. The title, author and rating tags appear within our book tag. The book tag represents an entry in our XML file.

eXtensible HyperText Markup Language

XHTML is a version of HTML4 that conforms to the XML standard. It was largely replaced by HTML5 due to demands for a greater variety of features. However, it is still used in some areas of the Internet. Most websites that use XHTML were developed years ago and have not been updated for a long time.

XHTML and HTML are very similar, but there are a few differences you may notice. HTML attributes must have both a name and a value; standalone attributes cannot be used. Additionally, all XHTML tags are written in lowercase. In HTML you can use both uppercase and lowercase letters, although best practices recommend using lowercase letters.

conclusion

Markup languages ​​are used to define elements within a document. These languages, like HTML and XML, are designed to be read by humans. This makes it easy for you to understand what data the markup languages ​​represent.

In markup languages, the markup instructions are presented to the computer using tags. These tags are usually stored between angle brackets (<>).

Now you're ready to talk about markup languages ​​like a web development expert!

You might find this interesting