What Are HTML and CSS and What Are They For?

What Are HTML and CSS and What Are They For?
Avatar author
ottounozero

del 01/12/2022

Here’s the Complete Guide

This guide contains the main concepts relating to CSS and HTML codes.

HTML and CSS: What Are They?

The acronym HTML stands for HyperText Markup Language. This code is not a programming language per se but, rather, a markup language.

Being a markup language means that HTML code is used in a series of ways to identify the specific elements of a web page. Therefore HTML code can’t be considered a programming language as it’s missing the elements useful for the very act of programming. The task of an actual programming language is making the binary system transforming into a series of actions, while there is no logic behind the markup model, which can thus accurately define the elements of a page.

Indeed, HTML code features tags used to identify the formatting of the content, which can be a chart, text, title or the presence of an object – like an image or audio file – in the page. The tag is usually defined using syntax like <tag name>.

CSS is the acronym for Cascading Style Sheet, a formatting language that not only allows us to separate the content of a page from its structure, but also to define properties which, up to that moment, were available only through HTML code.

HTML and CSS are powerful tools if used at the same time; while HTML defines the content layout in the structure, CSS models its browser or email visualisation.

Table of Contents

  1. How Does HTML Work?
  2. How Does CSS Work?
  3. HTML and CSS: a Single Tool

How Does HTML Work?

HTML is one of the most commonly-used codes and, as previously mentioned, is not a programming language per se but, rather, a formatting code. It doesn’t include elements typical of programming logic such as cycles, variables, etc.… As a result, every document is standard and must follow a specific structure, for example:

  • DTD (Document Type Definition) defines the set of rules and the tags used.
  • Tag <html> refers to everything contained in the browser.
  • Tag <head> defines the key information for a correct page visualisation
  • Tag <body> contains the body of the message.

The basic idea is that when you open a tag, you have to close it once you’ve entered the content. For example, if you want to insert a paragraph into the text, you must begin it with the opening tag <p>, insert the content and end it with the closing tag </p>.

Some tags, however, don’t need to be closed. For example, to insert an image we use <img> or the tag <br> that adds an empty line.

Defining the tag of the attributes that specify the content properties enables us to increase its formatting chances in a web page.

How Does CSS Work?

CSS, on the other hand, defines style sheets – that is, additional properties not present in HTML. There are three main methods to apply CSS to a document:

  • Externally – the sheet that contains the CSS information is an external file, attached with a <script> tag
  • Internally – all the CSS instructions are added to the website <head> with specific tags (<STYLE></STYLE>)
  • Inline – the CSS instructions are inserted as values of the STYLE attribute present in a specific tag. In this case, the CSS rule applies exclusively to the tag it’s inserted into and to any tag it may contain. For example, try to imagine a series of boxes, each one contained in a larger box. A CSS rule can be applied INLINE to the largest box and, if necessary, also make changes to the smaller boxes inside.

Two different application methods are used to develop emails:

  • If CSS is applied internally, it’s defined in the head with the <style> tag
  • Using the inline method means that it’s applied directly on the tag.

Instead, if CSS is applied internally, all the rules that manage the <body>, <table> and CTA visualisation are defined in the <style> tag. For example:

If you want to know what properties are contained in the <body> tag, just cite the name of the tag which, in this case, is just body. With the use of inline properties, the browser will be able to show all the content elements. This means that the text size will be 16px and the colour will be #0e0e0e. You can also define the class; in this case, the CTA and all its properties will apply only to the elements on which it’s already been defined, and we speak of inheritance. Depending on these approaches, all the properties applied to a parent element are inherited by the child elements; in this case, the CTA class inherits all the elements from the body to then go underwrite.

HTML and CSS: a Single Tool

HTML and CSS can be linked to create a powerful tool that enables you to separate the page content from the visualisation rules, which makes the code simpler, lighter and readable.

Using them together also enables you to make emails mobile-responsive as well as effective, and is suitable for all types of devices.

Any code and front-end enthusiast has to be familiar with HTML and CSS. At Epicode, no degree is required to take the classes that will teach you the right skills to enter the job market. All you need is a computer and reliable Wi-Fi to kick-start your future!


Altri articoli

What Is JavaScript and What’s It For? Here’s the Complete Guide

What Is JavaScript and What’s It For? Here’s the Complete Guide

JavaScript (Programming Language) The earliest version of JavaScript was devised in 1995, when Netscape decided to create a lightweight scripting language for its browser – a language that would allow web designers to interact with the various objects on the page such as images, forms, links, etc., and especially with the Java applets that ensured […]

Leggi di più
What Is Java and What’s It For? Here’s the Complete Guide

What Is Java and What’s It For? Here’s the Complete Guide

Java (Programming Language) Java is a general-purpose programming language used to develop web pages. It’s one of the most familiar and popular languages, especially for client-server web apps. Initially called “Oak”, Java was produced by Sun Microsystems in 1992. The name was later changed to Java for copyright reasons, as there was already a programming […]

Leggi di più
What Is Python and What’s It For?

What Is Python and What’s It For?

Python (Programming Language) Python was designed in 1989 by Dutch programmer Guido Van Rossum and first released in 1991. The name Python is a tribute to the comedy group Monty Python, of whom Van Rossum was a huge fan. One of the most common programming languages worldwide, Python is greatly in-demand among developers for its […]

Leggi di più

Scopri il corso di laurea di EPICODE Institute of Technology