<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Lucas Anselmo Moraes Da Silva </title>
    <description>The latest articles on DEV Community by Lucas Anselmo Moraes Da Silva  (@lucas_anselmo).</description>
    <link>https://dev.to/lucas_anselmo</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F787372%2F8a7d4359-074b-48d3-9c25-6bc8c4197cf5.jpg</url>
      <title>DEV Community: Lucas Anselmo Moraes Da Silva </title>
      <link>https://dev.to/lucas_anselmo</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/lucas_anselmo"/>
    <language>en</language>
    <item>
      <title>Desenvolvimento Orientado a Testes</title>
      <dc:creator>Lucas Anselmo Moraes Da Silva </dc:creator>
      <pubDate>Mon, 18 Dec 2023 15:59:47 +0000</pubDate>
      <link>https://dev.to/lucas_anselmo/desenvolvimento-orientado-a-testes-1mib</link>
      <guid>https://dev.to/lucas_anselmo/desenvolvimento-orientado-a-testes-1mib</guid>
      <description>&lt;p&gt;Durante o desenvolvimento de um &lt;em&gt;software&lt;/em&gt;, é essencial entregar um &lt;em&gt;software&lt;/em&gt; que funcione corretamente, com qualidade e no prazo estabelecido. Para garantir estes pontos, é importante testarmos nossos &lt;em&gt;softwares&lt;/em&gt; com o intuito de encontrar possíveis falhas. E com essas possíveis falhas encontradas, poderemos corrigir esses problemas antes de chegar ao usuário final.&lt;/p&gt;

&lt;p&gt;Mas, testar um &lt;em&gt;software&lt;/em&gt; corretamente não é algo tão simples como pode parecer. Por isso, existem diversas metodologias que visam testar os diferentes componentes de uma solução de software de maneira correta. Algumas destas metodologias visam testar a integração entre os componentes de um &lt;em&gt;software&lt;/em&gt;, enquanto outras visam testar cada um dos componentes de maneira isolada.&lt;/p&gt;

&lt;p&gt;Uma das metodologias que mais estou utilizando no desenvolvimento dos meus projetos é o &lt;strong&gt;TDD&lt;/strong&gt;. No &lt;strong&gt;TDD&lt;/strong&gt;, você codifica o teste antes mesmo do código existir.&lt;/p&gt;

&lt;h2&gt;
  
  
  O que é a sigla TDD?
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;TDD&lt;/strong&gt; é uma sigla para &lt;em&gt;&lt;strong&gt;Test Driven Development&lt;/strong&gt;&lt;/em&gt;, ou &lt;em&gt;Desenvolvimento Orientado a Testes&lt;/em&gt;. &lt;br&gt;
A ideia do &lt;strong&gt;TDD&lt;/strong&gt; é que você trabalhe em ciclos. Estes ciclos ocorrem na seguinte ordem:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Primeiro, escreva um teste unitário que inicialmente irá falhar, tendo em vista que o código ainda não foi implementado;&lt;/li&gt;
&lt;li&gt;Crie o código que satisfaça esse teste, ou seja: implemente a funcionalidade em questão. Essa primeira implementação deverá satisfazer imediatamente o teste escrito no ciclo anterior;&lt;/li&gt;
&lt;li&gt;Quando o código estiver implementado e o teste satisfeito, refatore o código para melhorar pontos como legibilidade. Logo após, execute o teste novamente. A nova versão do código também deverá passar sem que seja necessário modificar o teste escrito inicialmente.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;em&gt;Vale ressaltar que &lt;strong&gt;TDD&lt;/strong&gt; não é uma forma de escrever teste: ele é uma metodologia para desenvolvimento e escrita código.&lt;/em&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Ciclo do TDD
&lt;/h3&gt;

&lt;p&gt;A representação mais clara sobre como funciona o &lt;strong&gt;TDD&lt;/strong&gt;, pode ser visualizada na imagem abaixo:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--i-l7buy4--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/v5ml6y9h56d293bqaxwy.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--i-l7buy4--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/v5ml6y9h56d293bqaxwy.png" alt="Image description" width="529" height="527"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Perceba a existência dos três ciclos:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;em&gt;&lt;strong&gt;Red:&lt;/strong&gt;&lt;/em&gt; escreva um pequeno teste automatizado que, ao ser executado, irá falhar;&lt;/li&gt;
&lt;li&gt;
&lt;em&gt;&lt;strong&gt;Green:&lt;/strong&gt;&lt;/em&gt; implemente um código que seja suficiente para ser aprovado no teste recém-escrito;&lt;/li&gt;
&lt;li&gt;
&lt;em&gt;&lt;strong&gt;Refactor:&lt;/strong&gt;&lt;/em&gt; refatore o código, a fim dele ser melhorado, deixando-o mais funcional e mais limpo.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Para realizar o teste em cada funcionalidade do seu código, você sempre irá seguir estes ciclos. Estes ciclos são comumente referenciados como &lt;em&gt;&lt;strong&gt;red-green-refactor&lt;/strong&gt;&lt;/em&gt; ou &lt;em&gt;&lt;strong&gt;red-green-blue&lt;/strong&gt;&lt;/em&gt;.&lt;/p&gt;

&lt;p&gt;A ideia é que você utilize estes ciclos para &lt;strong&gt;testes unitários&lt;/strong&gt; ⇾ testes estes que visam avaliar o comportamento de classes e métodos em específico. Você irá identificar quais são os comportamentos esperados dos métodos a serem desenvolvidos. Ao invés de implementar o código inicialmente, você irá criar o código de teste ligado a essas classes e métodos que você deseja implementar. &lt;br&gt;
Como esse código ainda não estará devidamente implementado, o teste irá falhar (&lt;em&gt;&lt;strong&gt;red&lt;/strong&gt;&lt;/em&gt;), para que em seguida você faça a implementação dessa funcionalidade. Com a implementação, é esperado que esse teste passe (&lt;em&gt;&lt;strong&gt;green&lt;/strong&gt;&lt;/em&gt;). No final, você pode melhorar esse código, evitando duplicidade e trechos de código desnecessários (&lt;em&gt;&lt;strong&gt;refactor&lt;/strong&gt;&lt;/em&gt;) e irá fazer o teste novamente, onde ele deve passar. Assim você terá um código funcional e já devidamente testado.&lt;/p&gt;

&lt;h3&gt;
  
  
  Quais os benefícios?
&lt;/h3&gt;

&lt;p&gt;Existem diversos benefícios ao escrevermos os testes antes mesmo de realizar uma implementação. Um dos benefícios é que, como você vai saber o que o código precisa fazer antecipadamente, você acaba evitando escrever código demasiadamente complexo ou que não siga os pré-requisitos de negócio.&lt;/p&gt;

&lt;p&gt;Além disso, se você for deixar para testar as funcionalidades do seu código depois, você pode acabar não realizando os testes como deveria. Isso aumenta o risco de, por exemplo, realizarmos alterações no código por conta de testes que não passaram, aumentando substancialmente a possibilidade de introduzirmos problemas com estas alterações. Escrevendo os testes na etapa inicial, pode até parecer que acabamos tendo uma tarefa a mais a ser desempenhada; porém, no fim, seu software terá menos possibilidade de falhas, além de você acabar desenvolvendo código com mais qualidade.&lt;/p&gt;

&lt;h3&gt;
  
  
  Ferramenta para escrita dos testes de unidade
&lt;/h3&gt;

&lt;p&gt;Para as principais linguagens e bibliotecas de programação, cada uma possuem sua própria ferramenta para escrita dos cenários de teste de unidade, onde se utiliza a metodologia &lt;strong&gt;TDD&lt;/strong&gt; de forma prática. Abaixo, é listado alguns exemplos:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;.NET&lt;/strong&gt; - &lt;a href="https://nunit.org/"&gt;NUnit&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;PHP&lt;/strong&gt; - &lt;a href="https://phpunit.de/"&gt;PHPUnit&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Node&lt;/strong&gt; (JavaScript) - &lt;a href="https://jasmine.github.io/"&gt;Jasmine&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Java&lt;/strong&gt; - &lt;a href="https://junit.org/junit5/"&gt;JUnit&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Python&lt;/strong&gt; - &lt;a href="https://wiki.python.org/moin/PyUnit"&gt;PyUnit&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;React&lt;/strong&gt; - &lt;a href="https://jestjs.io/pt-BR/"&gt;Jest&lt;/a&gt;, &lt;a href="https://testing-library.com/"&gt;Testing-Library&lt;/a&gt;, &lt;a href="https://vitest.dev/"&gt;Vitest&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>testing</category>
      <category>programming</category>
      <category>productivity</category>
      <category>webdev</category>
    </item>
    <item>
      <title>HTML Best practices 2 - The continuation on how to put best practices in your HTML code</title>
      <dc:creator>Lucas Anselmo Moraes Da Silva </dc:creator>
      <pubDate>Fri, 18 Feb 2022 19:40:25 +0000</pubDate>
      <link>https://dev.to/lucas_anselmo/html-best-practices-2-the-continuation-on-how-to-put-best-practices-in-your-html-code-fmj</link>
      <guid>https://dev.to/lucas_anselmo/html-best-practices-2-the-continuation-on-how-to-put-best-practices-in-your-html-code-fmj</guid>
      <description>&lt;p&gt;As mentioned in the previous post, HTML is the basis of any web application, it is the backbone of development, and because it is one of the main elements of our website, it is important that we develop this structure with the best practices of writing in code.&lt;/p&gt;

&lt;p&gt;So in this post, we will continue the good practices or writing in HTML.&lt;/p&gt;

&lt;p&gt;Let's go  🏃‍♂️&lt;/p&gt;

&lt;p&gt;&lt;em&gt;In case you haven't read the previous post where we mentioned the first 3 practices, just &lt;a href="https://dev.to/lucas_anselmo/html-best-practices-acorrect-way-to-build-an-html-based-website-9l9"&gt;click here to read&lt;/a&gt;.&lt;/em&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  4 - Don't use divs for creating footers and headers
&lt;/h3&gt;

&lt;p&gt;Using &lt;code&gt;&amp;lt;div&amp;gt;&lt;/code&gt; to create footers and headers is not good practice. The recommended elements for creating this are semantic HTML elements that mark the structure of a document most significantly on a web page. We soon concluded that it is a good practices to use these semantic elements for the proper assembly of the web page.&lt;/p&gt;

&lt;p&gt;The semantics to use instead of divs are tags:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight html"&gt;&lt;code&gt;&lt;span class="nt"&gt;&amp;lt;header&amp;gt;&lt;/span&gt; - header

&lt;span class="nt"&gt;&amp;lt;footer&amp;gt;&lt;/span&gt; - footer  
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The &lt;code&gt;&amp;lt;header&amp;gt;&lt;/code&gt; element shows the navigation or opening part of the web page.&lt;/p&gt;

&lt;p&gt;The &lt;code&gt;&amp;lt;footer&amp;gt;&lt;/code&gt; element displays copyright information or application navigation links.&lt;/p&gt;

&lt;p&gt;Therefore, we conclude that it is not recommended to do this ⬇️:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight html"&gt;&lt;code&gt;&lt;span class="nt"&gt;&amp;lt;div&lt;/span&gt; &lt;span class="na"&gt;class=&lt;/span&gt;&lt;span class="s"&gt;"header"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
  &lt;span class="nt"&gt;&amp;lt;a&lt;/span&gt; &lt;span class="na"&gt;href=&lt;/span&gt;&lt;span class="s"&gt;"index.html"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;Home&lt;span class="nt"&gt;&amp;lt;/a&amp;gt;&lt;/span&gt;
  &lt;span class="nt"&gt;&amp;lt;a&lt;/span&gt; &lt;span class="na"&gt;href=&lt;/span&gt;&lt;span class="s"&gt;"about.html"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;About&lt;span class="nt"&gt;&amp;lt;/a&amp;gt;&lt;/span&gt;
  &lt;span class="nt"&gt;&amp;lt;a&lt;/span&gt; &lt;span class="na"&gt;href=&lt;/span&gt;&lt;span class="s"&gt;"contact.html"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;Contatc&lt;span class="nt"&gt;&amp;lt;/a&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;/div&amp;gt;&lt;/span&gt;  

&lt;span class="nt"&gt;&amp;lt;div&lt;/span&gt; &lt;span class="na"&gt;class=&lt;/span&gt;&lt;span class="s"&gt;"footer"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
  &lt;span class="nt"&gt;&amp;lt;a&lt;/span&gt; &lt;span class="na"&gt;href=&lt;/span&gt;&lt;span class="s"&gt;"index.html"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;Home&lt;span class="nt"&gt;&amp;lt;/a&amp;gt;&lt;/span&gt;
  &lt;span class="nt"&gt;&amp;lt;a&lt;/span&gt; &lt;span class="na"&gt;href=&lt;/span&gt;&lt;span class="s"&gt;"about.html"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;About&lt;span class="nt"&gt;&amp;lt;/a&amp;gt;&lt;/span&gt;
  &lt;span class="nt"&gt;&amp;lt;a&lt;/span&gt; &lt;span class="na"&gt;href=&lt;/span&gt;&lt;span class="s"&gt;"contact.html"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;Contatc&lt;span class="nt"&gt;&amp;lt;/a&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;/div&amp;gt;&lt;/span&gt; 
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;In this example, we use the &lt;code&gt;&amp;lt;div&amp;gt;&lt;/code&gt; tags as a container to represent our &lt;code&gt;&amp;lt;header&amp;gt;&lt;/code&gt; and &lt;code&gt;&amp;lt;footer&amp;gt;&lt;/code&gt;. Doing it this way will work, but it won't achieve the goal, which is the best code writing.&lt;/p&gt;

&lt;p&gt;So the correct thing to do is to do it this ⬇️:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight html"&gt;&lt;code&gt;&lt;span class="nt"&gt;&amp;lt;header&amp;gt;&lt;/span&gt;
  &lt;span class="nt"&gt;&amp;lt;a&lt;/span&gt; &lt;span class="na"&gt;href=&lt;/span&gt;&lt;span class="s"&gt;"index.html"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;Home&lt;span class="nt"&gt;&amp;lt;/a&amp;gt;&lt;/span&gt;
  &lt;span class="nt"&gt;&amp;lt;a&lt;/span&gt; &lt;span class="na"&gt;href=&lt;/span&gt;&lt;span class="s"&gt;"about.html"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;About&lt;span class="nt"&gt;&amp;lt;/a&amp;gt;&lt;/span&gt;
  &lt;span class="nt"&gt;&amp;lt;a&lt;/span&gt; &lt;span class="na"&gt;href=&lt;/span&gt;&lt;span class="s"&gt;"contact.html"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;Contatc&lt;span class="nt"&gt;&amp;lt;/a&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;/header&amp;gt;&lt;/span&gt;  

&lt;span class="nt"&gt;&amp;lt;footer&amp;gt;&lt;/span&gt;
  &lt;span class="nt"&gt;&amp;lt;a&lt;/span&gt; &lt;span class="na"&gt;href=&lt;/span&gt;&lt;span class="s"&gt;"index.html"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;Home&lt;span class="nt"&gt;&amp;lt;/a&amp;gt;&lt;/span&gt;
  &lt;span class="nt"&gt;&amp;lt;a&lt;/span&gt; &lt;span class="na"&gt;href=&lt;/span&gt;&lt;span class="s"&gt;"about.html"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;About&lt;span class="nt"&gt;&amp;lt;/a&amp;gt;&lt;/span&gt;
  &lt;span class="nt"&gt;&amp;lt;a&lt;/span&gt; &lt;span class="na"&gt;href=&lt;/span&gt;&lt;span class="s"&gt;"contact.html"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;Contatc&lt;span class="nt"&gt;&amp;lt;/a&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;/footer&amp;gt;&lt;/span&gt; 
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The importance of adding &lt;code&gt;&amp;lt;header&amp;gt;&lt;/code&gt; and &lt;code&gt;&amp;lt;footer&amp;gt;&lt;/code&gt;, is that these semantic elements are responsible for:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Makes your code easier to read.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Provides a better user experience for web visitors. It will be easier for web visitors who use screen readers to understand the content of your web page.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  5 - Avoid using 'b' and 'i' tags for bold and italicized text
&lt;/h3&gt;

&lt;p&gt;The &lt;code&gt;&amp;lt;b&amp;gt;&lt;/code&gt; and &lt;code&gt;&amp;lt;i&amp;gt;&lt;/code&gt; tags are known as the bold and italic tag. They are used to highlight words in text on a web page.&lt;/p&gt;

&lt;p&gt;We shouldn't use these tags because they don't have a semantic meaning. Start using the &lt;code&gt;font-weight&lt;/code&gt; CSS property or use the &lt;code&gt;&amp;lt;strong&amp;gt;&lt;/code&gt; / &lt;code&gt;&amp;lt;em&amp;gt;&lt;/code&gt; tags.&lt;/p&gt;

&lt;p&gt;Use the &lt;code&gt;&amp;lt;strong&amp;gt;&lt;/code&gt; tag makes text imortant on a web page. It highilights the bold in a page text. The &lt;code&gt;&amp;lt;em&amp;gt;&lt;/code&gt; tag emphasizes the text on your page. It also displays text in iatlics as the &lt;code&gt;&amp;lt;i&amp;gt;&lt;/code&gt; tag.&lt;/p&gt;

&lt;p&gt;So we shouldn't do that ⬇️:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight html"&gt;&lt;code&gt;&lt;span class="nt"&gt;&amp;lt;p&amp;gt;&amp;lt;i&amp;gt;&lt;/span&gt;Incorrect way to make text italic&lt;span class="nt"&gt;&amp;lt;/i&amp;gt;&amp;lt;/p&amp;gt;&lt;/span&gt;

&lt;span class="nt"&gt;&amp;lt;p&amp;gt;&amp;lt;b&amp;gt;&lt;/span&gt;Incorrect way to make text bold&lt;span class="nt"&gt;&amp;lt;/b&amp;gt;&amp;lt;/p&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;These displayed texts will be italicized and bold in the example above. It will not matter to the web user using a screen reader. It has no semantic meaning.&lt;/p&gt;

&lt;p&gt;The HTML5 specification says that the &lt;code&gt;&amp;lt;b&amp;gt;&lt;/code&gt; and &lt;code&gt;&amp;lt;i&amp;gt;&lt;/code&gt; tags should only be used as a last resort, and if possible, avoided as much as possible.&lt;/p&gt;

&lt;p&gt;Som the right thing to do is to do it this way ⬇️:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight html"&gt;&lt;code&gt;&lt;span class="nt"&gt;&amp;lt;p&amp;gt;&amp;lt;strong&amp;gt;&lt;/span&gt;Correct way to make text bold&lt;span class="nt"&gt;&amp;lt;/strong&amp;gt;&amp;lt;/p&amp;gt;&lt;/span&gt;

&lt;span class="nt"&gt;&amp;lt;p&amp;gt;&amp;lt;em&amp;gt;&lt;/span&gt;Correct way to make the text italic (highlighted)&lt;span class="nt"&gt;&amp;lt;/em&amp;gt;&amp;lt;/p&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  6 - Don't put block-level elements inside inline elements
&lt;/h3&gt;

&lt;p&gt;Block-level elements start on a new line on a web page. They extend from the beginning to the end of the line on a web page. Therefore, we will not be able to add more inline content to a block element without using some styling (CSS).&lt;/p&gt;

&lt;p&gt;These block elements that we mentioned, taking 3 as examples, are:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;code&gt;&amp;lt;p&amp;gt;&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;&amp;lt;h1&amp;gt; - &amp;lt;h6&amp;gt;&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;&amp;lt;div&amp;gt;&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The inline element covers the smallest area on a web page. They don't start on a new line on the page.&lt;/p&gt;

&lt;p&gt;The &lt;code&gt;&amp;lt;span&amp;gt;&lt;/code&gt;, &lt;code&gt;&amp;lt;em&amp;gt;&lt;/code&gt; and &lt;code&gt;&amp;lt;a&amp;gt;&lt;/code&gt; elements are some examples of inline elements.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;We shouldn't put block elements inside inline elements&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;So it's bad practice to do that ⬇️:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight html"&gt;&lt;code&gt;&lt;span class="nt"&gt;&amp;lt;a&lt;/span&gt; &lt;span class="na"&gt;href=&lt;/span&gt;&lt;span class="s"&gt;"#"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
  &lt;span class="nt"&gt;&amp;lt;p&amp;gt;&lt;/span&gt;Visit our purchase page to see our offers&lt;span class="nt"&gt;&amp;lt;/p&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;/a&amp;gt;&lt;/span&gt;  
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;No&lt;/strong&gt; you must wrap &lt;code&gt;&amp;lt;p&amp;gt;&lt;/code&gt; inside a &lt;code&gt;&amp;lt;a&amp;gt;&lt;/code&gt; element because &lt;code&gt;&amp;lt;p&amp;gt;&lt;/code&gt; is a block-level element and &lt;code&gt;&amp;lt;a&amp;gt;&lt;/code&gt; is an inline element.&lt;/p&gt;

&lt;p&gt;So, the correct way is to do it as follows ⬇️:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight html"&gt;&lt;code&gt;&lt;span class="nt"&gt;&amp;lt;p&amp;gt;&lt;/span&gt;
  Visit &lt;span class="nt"&gt;&amp;lt;a&lt;/span&gt; &lt;span class="na"&gt;href=&lt;/span&gt;&lt;span class="s"&gt;"https://buy.html"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;our purchase page&lt;span class="nt"&gt;&amp;lt;/a&amp;gt;&lt;/span&gt; to buy see our offers
&lt;span class="nt"&gt;&amp;lt;/p&amp;gt;&lt;/span&gt;    
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The example above is the best way to align inline elements within a block-level element.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;It is important to note that:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Block-level element cannot be nested inside an inline element.&lt;/li&gt;
&lt;li&gt;Inline element can be nested inside a block-level element.&lt;/li&gt;
&lt;li&gt;The inline and block-level element can be nested inside the block-level element.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Conclusion on good practices
&lt;/h2&gt;

&lt;p&gt;I hope that this post, along with the &lt;a href="https://dev.to/lucas_anselmo/html-best-practices-acorrect-way-to-build-an-html-based-website-9l9"&gt;previous post&lt;/a&gt;, has helped you understand how HTML is important for our applications, and the advantages we gain by writing a structure with good practices, correct writing and respecting the rules of HTML.&lt;/p&gt;

&lt;p&gt;And I leave here a mission for you reader, which is to start putting these good manners in your code and day-to-day development.&lt;/p&gt;




&lt;p&gt;Thanks for reading 💙 &amp;amp; take the opportunity to comment below, what other good HTML practice do you know that was not mentioned here.&lt;/p&gt;

&lt;p&gt;And take the opportunity to follow me on: &lt;a href="https://twitter.com/LucasAnselmo202"&gt;Twitter&lt;/a&gt; and &lt;a href="https://www.linkedin.com/in/lucas-anselmo-moraes-da-silva-543636161/"&gt;LinkedIn&lt;/a&gt; - let's network 🤝&lt;/p&gt;

</description>
      <category>javascript</category>
      <category>webdev</category>
      <category>html</category>
      <category>beginners</category>
    </item>
    <item>
      <title>HTML Best practices - Acorrect way to build an HTML based website</title>
      <dc:creator>Lucas Anselmo Moraes Da Silva </dc:creator>
      <pubDate>Tue, 15 Feb 2022 19:13:44 +0000</pubDate>
      <link>https://dev.to/lucas_anselmo/html-best-practices-acorrect-way-to-build-an-html-based-website-9l9</link>
      <guid>https://dev.to/lucas_anselmo/html-best-practices-acorrect-way-to-build-an-html-based-website-9l9</guid>
      <description>&lt;p&gt;HTML is the basis of any web application existing on the internet today, without it, websites would not exist.&lt;br&gt;
As development depends on HTML, it is important to follow good practices throughout development, in order to create a good experience for the user who is browsing your site.&lt;/p&gt;

&lt;p&gt;In this post, we're going to talk about the best practices you should start implementing in your coding.&lt;/p&gt;

&lt;p&gt;Let's go  🏃‍♂️&lt;/p&gt;
&lt;h2&gt;
  
  
  HTML coding best practices
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;These practices that we are going to recommend in this post&lt;/strong&gt; are fundamental rules that will help you create websites that are easy to maintain with a pleasant and easy-to-read structure.&lt;/p&gt;
&lt;h3&gt;
  
  
  1 - Use only one &lt;code&gt;&amp;lt;h1&amp;gt;&lt;/code&gt; element for a code page
&lt;/h3&gt;

&lt;p&gt;There are six header tags (titles) in HTML, from &lt;code&gt;&amp;lt;h1&amp;gt; to &amp;lt;h6&amp;gt;&lt;/code&gt; with &lt;code&gt;&amp;lt;h1&amp;gt;&lt;/code&gt; being the main title of the page and decreasing the degree of importance to the end, which is the &lt;code&gt;&amp;lt;h6&amp;gt;&lt;/code&gt; tag.&lt;/p&gt;

&lt;p&gt;The order of values of these tags is drawn as follows ⬇️:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight html"&gt;&lt;code&gt;
&lt;span class="nt"&gt;&amp;lt;h1&amp;gt;&lt;/span&gt; &amp;gt; &lt;span class="nt"&gt;&amp;lt;h2&amp;gt;&lt;/span&gt; &amp;gt; &lt;span class="nt"&gt;&amp;lt;h3&amp;gt;&lt;/span&gt; &amp;gt; &lt;span class="nt"&gt;&amp;lt;h4&amp;gt;&lt;/span&gt; &amp;gt; &lt;span class="nt"&gt;&amp;lt;h5&amp;gt;&lt;/span&gt; &amp;gt; &lt;span class="nt"&gt;&amp;lt;h6&amp;gt;&lt;/span&gt;

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;It is important to point out that it is necessary to avoid as much as possible the use of more than one &lt;code&gt;&amp;lt;h1&amp;gt;&lt;/code&gt; element for a code page, that is, a bad practice is to develop HTML in this way ⬇️:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight html"&gt;&lt;code&gt;
&lt;span class="nt"&gt;&amp;lt;main&amp;gt;&lt;/span&gt;
  &lt;span class="nt"&gt;&amp;lt;div&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;h1&amp;gt;&lt;/span&gt;Main title of this element&lt;span class="nt"&gt;&amp;lt;/h1&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;p&amp;gt;&lt;/span&gt;Paragraph text&lt;span class="nt"&gt;&amp;lt;/p&amp;gt;&lt;/span&gt;
  &lt;span class="nt"&gt;&amp;lt;/div&amp;gt;&lt;/span&gt;  

  &lt;span class="nt"&gt;&amp;lt;div&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;h1&amp;gt;&lt;/span&gt;Main title of this element&lt;span class="nt"&gt;&amp;lt;/h1&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;p&amp;gt;&lt;/span&gt;Paragraph text&lt;span class="nt"&gt;&amp;lt;/p&amp;gt;&lt;/span&gt;
  &lt;span class="nt"&gt;&amp;lt;/div&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;/main&amp;gt;&lt;/span&gt;

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;In this example above, we use two &lt;code&gt;&amp;lt;h1&amp;gt;&lt;/code&gt; tags. Coding this way will work your code as expected, but this is not the best practice related to good manners.&lt;/p&gt;

&lt;p&gt;To conform to best practices, do it this way ⬇️:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight html"&gt;&lt;code&gt;
&lt;span class="nt"&gt;&amp;lt;main&amp;gt;&lt;/span&gt;
  &lt;span class="nt"&gt;&amp;lt;div&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;h1&amp;gt;&lt;/span&gt;Main title of this element&lt;span class="nt"&gt;&amp;lt;/h1&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;p&amp;gt;&lt;/span&gt;Paragraph text&lt;span class="nt"&gt;&amp;lt;/p&amp;gt;&lt;/span&gt;
  &lt;span class="nt"&gt;&amp;lt;/div&amp;gt;&lt;/span&gt;  

  &lt;span class="nt"&gt;&amp;lt;div&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;h2&amp;gt;&lt;/span&gt;Main title of this element&lt;span class="nt"&gt;&amp;lt;/h2&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;p&amp;gt;&lt;/span&gt;Paragraph text&lt;span class="nt"&gt;&amp;lt;/p&amp;gt;&lt;/span&gt;
  &lt;span class="nt"&gt;&amp;lt;/div&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;/main&amp;gt;&lt;/span&gt;

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Using just one &lt;code&gt;&amp;lt;h1&amp;gt;&lt;/code&gt; element on a web page is vital for SEO - Search Engine Optimization. It helps search engines understand what a web page is and built on best practices.&lt;/p&gt;

&lt;h3&gt;
  
  
  2 - Don't skip title levels in HTML
&lt;/h3&gt;

&lt;p&gt;When using header tags, it is important to continue the ascending sequence of tags:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;&amp;lt;h1&amp;gt; - &amp;lt;h2&amp;gt; - &amp;lt;h3&amp;gt; - &amp;lt;h4&amp;gt; - &amp;lt;h5&amp;gt; - &amp;lt;h6&amp;gt;&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;When using &lt;code&gt;&amp;lt;h1&amp;gt;&lt;/code&gt;, don't jump straight to &lt;code&gt;&amp;lt;h3&amp;gt;&lt;/code&gt; when working with header tags. It is important to avois this mistake, as it is difficult for web visitors using a screen reader to understand the content of your web page when you skip through the title levels.&lt;/p&gt;

&lt;p&gt;Therefore, it is bad practice to write the code this way ⬇️:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight html"&gt;&lt;code&gt;&lt;span class="nt"&gt;&amp;lt;h1&amp;gt;&lt;/span&gt;First title&lt;span class="nt"&gt;&amp;lt;h1/&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;h3&amp;gt;&lt;/span&gt;Second title&lt;span class="nt"&gt;&amp;lt;/h3&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;h5&amp;gt;&lt;/span&gt;Third title&lt;span class="nt"&gt;&amp;lt;/h5&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;And it should be written as follows ⬇️:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight html"&gt;&lt;code&gt;&lt;span class="nt"&gt;&amp;lt;h1&amp;gt;&lt;/span&gt;First title&lt;span class="nt"&gt;&amp;lt;h1/&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;h2&amp;gt;&lt;/span&gt;Second title&lt;span class="nt"&gt;&amp;lt;/h2&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;h3&amp;gt;&lt;/span&gt;Third title&lt;span class="nt"&gt;&amp;lt;/h3&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  3 - Use the &lt;code&gt;&amp;lt;figure&amp;gt;&lt;/code&gt; element to add caption to your images
&lt;/h3&gt;

&lt;p&gt;It is recommended to use the &lt;code&gt;&amp;lt;figure&amp;gt;&lt;/code&gt; element to add captions to your images. And you also need to use the &lt;code&gt;&amp;lt;figcaption&amp;gt;&lt;/code&gt; element together with the &lt;code&gt;&amp;lt;figure&amp;gt;&lt;/code&gt; element, for it to work.&lt;/p&gt;

&lt;p&gt;So don't do it ⬇️:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight html"&gt;&lt;code&gt;&lt;span class="nt"&gt;&amp;lt;div&amp;gt;&lt;/span&gt;
  &lt;span class="nt"&gt;&amp;lt;img&lt;/span&gt; &lt;span class="na"&gt;src=&lt;/span&gt;&lt;span class="s"&gt;"image.png"&lt;/span&gt; &lt;span class="na"&gt;alt=&lt;/span&gt;&lt;span class="s"&gt;"Image of a computer on a table"&lt;/span&gt; &lt;span class="nt"&gt;/&amp;gt;&lt;/span&gt;
  &lt;span class="nt"&gt;&amp;lt;p&amp;gt;&lt;/span&gt;This is an incorrect way to put captions on your images.&lt;span class="nt"&gt;&amp;lt;/p&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;/div&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This example above will work as you expect, but it's not the best way to do it. In an everyday situation, the image may not load, so you will have the &lt;code&gt;alt&lt;/code&gt; text and the &lt;code&gt;&amp;lt;p&amp;gt;&lt;/code&gt; tag text displayed on the screen. Thus, it will be difficult for a web visitor using a screen reader to tell the difference between &lt;code&gt;alt&lt;/code&gt; and &lt;code&gt;&amp;lt;p&amp;gt;&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Always keep in mind that even if your code works, it doesn't mean you're following best practices.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;So do it ⬇️:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight html"&gt;&lt;code&gt;&lt;span class="nt"&gt;&amp;lt;figure&amp;gt;&lt;/span&gt;
  &lt;span class="nt"&gt;&amp;lt;img&lt;/span&gt; &lt;span class="na"&gt;src=&lt;/span&gt;&lt;span class="s"&gt;"image.png"&lt;/span&gt; &lt;span class="na"&gt;alt=&lt;/span&gt;&lt;span class="s"&gt;"Image of a computer on a table"&lt;/span&gt; &lt;span class="nt"&gt;/&amp;gt;&lt;/span&gt;
  &lt;span class="nt"&gt;&amp;lt;figcaption&amp;gt;&lt;/span&gt;This is a correct way to put captions on your images.&lt;span class="nt"&gt;&amp;lt;/figcaption&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;/figure&amp;gt;&lt;/span&gt;  
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This example above is the correct way to add captions to your images.&lt;/p&gt;

&lt;p&gt;It is very important to add captions to your images for the following reason:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Search Engine Optimization - It's easier to find your images in search engines.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;It's easier for web visitors who use screen readers to understand the content of your web page.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;




&lt;p&gt;I hope this article was important to you. Enjoy and follow me on &lt;a href="https://twitter.com/LucasAnselmo202"&gt;Twitter&lt;/a&gt;&lt;/p&gt;

</description>
      <category>javascript</category>
      <category>webdev</category>
      <category>html</category>
      <category>programming</category>
    </item>
    <item>
      <title>Enhacing your applications's front-end performance with lazy loading</title>
      <dc:creator>Lucas Anselmo Moraes Da Silva </dc:creator>
      <pubDate>Fri, 04 Feb 2022 17:14:19 +0000</pubDate>
      <link>https://dev.to/lucas_anselmo/enhacing-your-applicationss-front-end-pergormance-with-lazy-loading-2ofb</link>
      <guid>https://dev.to/lucas_anselmo/enhacing-your-applicationss-front-end-pergormance-with-lazy-loading-2ofb</guid>
      <description>&lt;p&gt;The &lt;code&gt;&amp;lt;img /&amp;gt;&lt;/code&gt; tag, responsible for allowing the inserction of images on your site, sometimes it many saem like a harmless tag to the front-end of the site, but this tag, in most cases, sometimes it may be &lt;strong&gt;responsible for the long loading delay of your apllication.&lt;/strong&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  But why this happen?
&lt;/h2&gt;

&lt;p&gt;This happens because the moment someone accesses your page, the browser reads your HTML code and them starts making requests to download the images you are using.&lt;/p&gt;

&lt;p&gt;So, the result is that the user stays here, with the page loading, until all the images you use on the page are downloaded.&lt;/p&gt;

&lt;h2&gt;
  
  
  But what's the problem with the user waiting for the site to load?
&lt;/h2&gt;

&lt;p&gt;The problem is that in addition to harming SEO, the user does not have much patience to wait for the site to load, that is, the chances of it closing the site before loading is very high.&lt;/p&gt;

&lt;h2&gt;
  
  
  Ok, but how to solve this?
&lt;/h2&gt;

&lt;p&gt;One of the best ways to solve this problem is to &lt;strong&gt;allow loading of images is done on demand&lt;/strong&gt;, as the user scrolls down the page, the browser will download only the images that the user will see!!&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;We call this &lt;code&gt;lazy loading&lt;/code&gt;&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;In this case, if there is a very heavy image (file size) in the footer of the site, and the user does not scroll to the end, that image will never be downloaded!!&lt;/p&gt;

&lt;h2&gt;
  
  
  How to add this lazy loading attribute in my applications?
&lt;/h2&gt;

&lt;p&gt;You need to add the &lt;strong&gt;loading&lt;/strong&gt; attribute to the &lt;code&gt;img&lt;/code&gt; tags, like this:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--kp34VlQh--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/yp8jsjmmtmrnhrutzgqd.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--kp34VlQh--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/yp8jsjmmtmrnhrutzgqd.png" alt="Image description" width="800" height="213"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;After adding this attribute to the image, the browser will only download it when it is close to appearing on the screen, which means that even loading the image on demand, when it comes time for it to appear, it will have already been loaded!!&lt;/p&gt;

&lt;h2&gt;
  
  
  Conclusion on using this attribute
&lt;/h2&gt;

&lt;p&gt;We can conclude that with the use of this attribute, in addition to gaining performance in our application, we do not harm the site's SEO and avoid loading all the images on our site at once.&lt;/p&gt;

</description>
      <category>webdev</category>
      <category>html</category>
      <category>javascript</category>
      <category>programming</category>
    </item>
    <item>
      <title>Snippets Css</title>
      <dc:creator>Lucas Anselmo Moraes Da Silva </dc:creator>
      <pubDate>Tue, 01 Feb 2022 13:39:11 +0000</pubDate>
      <link>https://dev.to/lucas_anselmo/snippets-css-2bbj</link>
      <guid>https://dev.to/lucas_anselmo/snippets-css-2bbj</guid>
      <description>&lt;p&gt;One of the advantages of having a snippets is avoiding the repetition of writing the same block code, this in addition to generating a small delay in relation to the duration of the development of the code you are writing, it may happen that we copy a block of code from another project and not changing the variables and not realizing this, our code at the time of executation or compilation would end up failing.&lt;/p&gt;

&lt;p&gt;With the intention of ending this problem of always repeating the same structure of the code block, we can generate a custom snippet, from which it would be enough to type just one word and our code block will already be built for us!!&lt;/p&gt;

&lt;p&gt;This generates a greater time gain, since it is no longer necessary to copy and paste the same structure.&lt;/p&gt;

&lt;p&gt;The snippet that we are going to create will be useful in the CSS language, as it will be responsible for creating a structure for resetting the styles for the HTML tags.&lt;/p&gt;

&lt;p&gt;And to generate this snippet is very easy, just follow the steps below and your snippet will be working!!&lt;/p&gt;

&lt;h2&gt;
  
  
  How to create our snippet
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;Click on the &lt;code&gt;File&lt;/code&gt; option from the top menu of VSCode.&lt;/li&gt;
&lt;li&gt;Among the options suggested by &lt;code&gt;File&lt;/code&gt;, click on &lt;code&gt;Preferences&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;In the &lt;code&gt;Preferences&lt;/code&gt; options click on &lt;code&gt;User Snippets&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;After clicking on &lt;code&gt;User Snippets&lt;/code&gt; a block will appear with options to create a snippet or select an existing snippet.&lt;/li&gt;
&lt;li&gt;A list of several programming languages will also appear, as you can create a snippet for a specific language (which is what we are going to do) or you can also create a global snippet that will work regardless of the language you are coding.&lt;/li&gt;
&lt;li&gt;In the input field, type &lt;code&gt;css&lt;/code&gt; and click on the &lt;code&gt;css.json (CSS)&lt;/code&gt; option.&lt;/li&gt;
&lt;li&gt;After clicking this option, a &lt;code&gt;css.json&lt;/code&gt; file will open in your editor.&lt;/li&gt;
&lt;li&gt;In this file, just copy and paste the content below in your &lt;code&gt;css.json&lt;/code&gt; file.
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight json"&gt;&lt;code&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="err"&gt;//&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="err"&gt;Place&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="err"&gt;your&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="err"&gt;snippets&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="err"&gt;for&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="err"&gt;css&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="err"&gt;here.&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="err"&gt;Each&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="err"&gt;snippet&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="err"&gt;is&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="err"&gt;defined&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="err"&gt;under&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="err"&gt;a&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="err"&gt;snippet&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="err"&gt;name&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="err"&gt;and&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="err"&gt;has&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="err"&gt;a&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="err"&gt;prefix&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="err"&gt;body&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="err"&gt;and&lt;/span&gt;&lt;span class="w"&gt; 
    &lt;/span&gt;&lt;span class="err"&gt;//&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="err"&gt;description.&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="err"&gt;The&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="err"&gt;prefix&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="err"&gt;is&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="err"&gt;what&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="err"&gt;is&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="err"&gt;used&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="err"&gt;to&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="err"&gt;trigger&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="err"&gt;the&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="err"&gt;snippet&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="err"&gt;and&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="err"&gt;the&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="err"&gt;body&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="err"&gt;will&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="err"&gt;be&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="err"&gt;expanded&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="err"&gt;and&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="err"&gt;inserted.&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="err"&gt;Possible&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="err"&gt;variables&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="err"&gt;are:&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="err"&gt;//&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="err"&gt;$&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="err"&gt;$&lt;/span&gt;&lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="err"&gt;for&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="err"&gt;tab&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="err"&gt;stops&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="err"&gt;$&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="err"&gt;for&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="err"&gt;the&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="err"&gt;final&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="err"&gt;cursor&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="err"&gt;position&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="err"&gt;and&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="err"&gt;$&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="err"&gt;:label&lt;/span&gt;&lt;span class="p"&gt;},&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="err"&gt;$&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="err"&gt;:another&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="err"&gt;for&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="err"&gt;placeholders.&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="err"&gt;Placeholders&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="err"&gt;with&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="err"&gt;the&lt;/span&gt;&lt;span class="w"&gt; 
    &lt;/span&gt;&lt;span class="err"&gt;//&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="err"&gt;same&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="err"&gt;ids&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="err"&gt;are&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="err"&gt;connected.&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="err"&gt;//&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="err"&gt;Example:&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="err"&gt;//&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nl"&gt;"Print to console"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="err"&gt;//&lt;/span&gt;&lt;span class="w"&gt;  &lt;/span&gt;&lt;span class="nl"&gt;"prefix"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"log"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="err"&gt;//&lt;/span&gt;&lt;span class="w"&gt;  &lt;/span&gt;&lt;span class="nl"&gt;"body"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="err"&gt;//&lt;/span&gt;&lt;span class="w"&gt;      &lt;/span&gt;&lt;span class="s2"&gt;"console.log('$1');"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="err"&gt;//&lt;/span&gt;&lt;span class="w"&gt;      &lt;/span&gt;&lt;span class="s2"&gt;"$2"&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="err"&gt;//&lt;/span&gt;&lt;span class="w"&gt;  &lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="err"&gt;//&lt;/span&gt;&lt;span class="w"&gt;  &lt;/span&gt;&lt;span class="nl"&gt;"description"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"Log output to console"&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="err"&gt;//&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="nl"&gt;"Reset Css"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
        &lt;/span&gt;&lt;span class="nl"&gt;"prefix"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"reset-css"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
        &lt;/span&gt;&lt;span class="nl"&gt;"body"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="w"&gt;
            &lt;/span&gt;&lt;span class="s2"&gt;"* {"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
                &lt;/span&gt;&lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="se"&gt;\t&lt;/span&gt;&lt;span class="s2"&gt;margin: 0;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
                &lt;/span&gt;&lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="se"&gt;\t&lt;/span&gt;&lt;span class="s2"&gt;padding: 0;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
                &lt;/span&gt;&lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="se"&gt;\t&lt;/span&gt;&lt;span class="s2"&gt;box-sizing: border-box;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
            &lt;/span&gt;&lt;span class="s2"&gt;"}"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;

            &lt;/span&gt;&lt;span class="s2"&gt;""&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;

            &lt;/span&gt;&lt;span class="s2"&gt;"body {"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
                &lt;/span&gt;&lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="se"&gt;\t&lt;/span&gt;&lt;span class="s2"&gt;font: 400 1rem '$1', sans-serif;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
            &lt;/span&gt;&lt;span class="s2"&gt;"}"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;

            &lt;/span&gt;&lt;span class="s2"&gt;""&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;

            &lt;/span&gt;&lt;span class="s2"&gt;"ul,"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
            &lt;/span&gt;&lt;span class="s2"&gt;"li {"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
                &lt;/span&gt;&lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="se"&gt;\t&lt;/span&gt;&lt;span class="s2"&gt;list-style: none;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
            &lt;/span&gt;&lt;span class="s2"&gt;"}"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;

            &lt;/span&gt;&lt;span class="s2"&gt;""&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;

            &lt;/span&gt;&lt;span class="s2"&gt;"a {"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
                &lt;/span&gt;&lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="se"&gt;\t&lt;/span&gt;&lt;span class="s2"&gt;text-decoration: none;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
            &lt;/span&gt;&lt;span class="s2"&gt;"}"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;

            &lt;/span&gt;&lt;span class="s2"&gt;""&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;

            &lt;/span&gt;&lt;span class="s2"&gt;"img {"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
                &lt;/span&gt;&lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="se"&gt;\t&lt;/span&gt;&lt;span class="s2"&gt;display: block;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
                &lt;/span&gt;&lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="se"&gt;\t&lt;/span&gt;&lt;span class="s2"&gt;max-width: 100%;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
            &lt;/span&gt;&lt;span class="s2"&gt;"}"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
        &lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt;&lt;span class="w"&gt;
        &lt;/span&gt;&lt;span class="nl"&gt;"description"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"Create a structure to reset the styling of html tags"&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="p"&gt;},&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ol&gt;
&lt;li&gt;After copying and pasting this content in the &lt;code&gt;css.json&lt;/code&gt; file, just save it, and create a file with &lt;code&gt;.css&lt;/code&gt; extension.&lt;/li&gt;
&lt;li&gt;After creating this file, just type &lt;code&gt;reset-css&lt;/code&gt; and press "enter" and that's it, your snippet is already working.&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  Explaining the snippet structure
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;In the part that says &lt;code&gt;"Reset Css"&lt;/code&gt; is just the title of your snippets (this is not the title that appears when you type in the .css file)&lt;/li&gt;
&lt;li&gt;prefix: This is the title references for you to type in the .css files that will be responsible for generating the structure of you snippets.&lt;/li&gt;
&lt;li&gt;body: Structure you want to generate.&lt;/li&gt;
&lt;li&gt;description: Description of what your snippets do.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;"\t"&lt;/code&gt; -  Creates a space for indentation.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;""&lt;/code&gt; - Quote alone is responsible for generating a line break (skips a line).&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;$1&lt;/code&gt; - Responsible for indicating to the mouse cursor where to appear to start typing.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Comments
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;Since we generated the snippet in the &lt;code&gt;css.json&lt;/code&gt; file, this snippet will only work on files with the &lt;code&gt;.css&lt;/code&gt; extension. If you want this snippet to be global, for all languages, just click on the &lt;code&gt;New Global Snippets file&lt;/code&gt; option instead of typing &lt;code&gt;css&lt;/code&gt; in step 6 of the tutorial.&lt;/li&gt;
&lt;li&gt;The names of the structures that form the snippets (prefix, body, description) must not be changed.&lt;/li&gt;
&lt;/ol&gt;

</description>
      <category>javascript</category>
      <category>webdev</category>
      <category>beginners</category>
      <category>programming</category>
    </item>
  </channel>
</rss>
