logo

Come scrivere HTML?

HTML è l'acronimo di Hyper Text Markup Language . Viene utilizzato per creare pagine Web e applicazioni Web. L'HTML è un linguaggio ampiamente utilizzato sul web. In questo articolo impareremo come scrivere HTML.

Qui, per prima cosa, mostriamo una procedura passo passo per creare una pagina HTML.

Passo 1 - Apri un editor di testo per scrivere il codice.

linguaggio informatico groovy

Sebbene esistano vari editor di testo che possono essere facilmente scaricati per un principiante, il migliore editor di testo è Blocco note (in Windows) e TextEdit (in Mac). In Windows, l'editor di testo predefinito è Bloc notes , mentre su Mac l'editor predefinito è TextEdit. In Windows possiamo aprire il file Bloc notes editor facendo clic su Start e digita Blocco note, come mostrato nello screenshot seguente:

Come scrivere HTML

Possiamo anche usare il Blocco note++ editor di testo in Windows per scrivere i programmi HTML. Dopo aver appreso le nozioni di base, possiamo utilizzare altri editor professionisti come Blocco note++, Testo sublime, Vim, eccetera.

Passo 2 - Ora inizia a scrivere programmi HTML nell'editor di testo. I tag HTML sono racchiusi tra tag aperti () e tag chiusi (). Supponiamo di dover creare un paragrafo, quindi in HTML il paragrafo viene creato digitando il tag open paragrafo

e quindi inserendo un tag di paragrafo chiuso

nuova riga in Python
.

Come scrivere HTML

Dopo aver scritto una riga di codice, puoi semplicemente premere accedere per andare alla riga successiva.

Passaggio 3: Salvare il file con .html o con .htm estensione, come mostrato nello screenshot qui sotto.

Come scrivere HTML

Passaggio 4: Ora puoi eseguire il tuo file .html. Per fare ciò, devi andare nella posizione in cui hai salvato il file. Quindi seleziona il file corrispondente, fai clic con il pulsante destro del mouse su di esso e seleziona il browser Web desiderato per eseguire il file. Può essere chiaro con la seguente schermata:

Come scrivere HTML

Dopo aver fatto clic sul browser, verrà visualizzata una pagina Web che mostra l'output del file.

Ora vediamo come iniziare con l'HTML o come scrivere programmi HTML.

Per qualsiasi documento HTML, in pratica possiamo iniziare il documento con il tipo di documento, ovvero the etichetta , UN tag e a etichetta. Dovremmo dover chiudere i tag E tag. Sarà scritto come segue:

stringa confronta con Java
 

Nel tag possiamo scrivere il nostro codice che verrà visualizzato sul browser web. Per creare il titolo della pagina web, possiamo includere il tag head come mostrato di seguito:

 <title < pre> <p>There are various tags in HTML for performing different tasks. There are six headings in HTML that are <a href="/html-heading"> <strong><h1>, <h2>, <h3>, <h4>, <h5>, and <h6></h6></h5></h4></h3></h2></h1></strong> </a> . These headings should be closed with their corresponding closing tags.</p> <p>There are various properties and rules to write HTML code. For more information, you can visit our <strong>HTML tutorial</strong> .</p> <p>We can create paragraphs in HTML by using the </p><p> tag , to create a hyperlink we can use the anchor tag, i.e.,  <a href=" ">  </a>, we can also add unordered and ordered lists by adding <ul> and <ol> tags . An image can be inserted by using the .</ol></ul></p> <p>To add the style to a specific html tag or to the group of the html tags, we can use the CSS. There are three ways to use CSS in HTML that are Inline CSS , Internal or embedded CSS, and using the External CSS . Let&apos;s see the brief description of these ways -</p> <p> <strong>Inline CSS -</strong> Inline CSS uses style attribute to style the HTML elements. It is used to apply style to a single element.</p> <p> <strong>Internal or Embedded CSS -</strong> It defines CSS using  <strong></strong> tag in the section. To use internal CSS, we can use id and class attributes.</p> <p> <strong>External CSS -</strong> It defines all CSS properties in a separate .css file. Then we have to include that file using the tag in the  section.</p> <p>So, for more information, one should visit our HTML tutorial, where you will find a detailed and easier description of <a href="/html-tags">HTML tags</a> .</p> <hr></title>