I'm new to this, how can i write a HTML code?


The new file button doesn't let me write and just make a new Hello World HTML program

3 Answers

5 months ago by

You should be able to navigate to https://onecompiler.com/html directly where you get 3 files by default. One for HTML one for CSS and one for JS.
You can erase the content and write HTML there.

I'm not sure what you mean by "Hello World HTML program".
HTML is a markup language not a programming language, thus it is not designed to create programs a C++ as JavaScript could.

5 months ago by petr

  1. Open a text editor: You can use any text editor like Notepad (Windows), TextEdit (Mac), or Sublime Text.
  2. Create a new file: Save the file with an .html extension, for example, myfirstwebpage.html.
  3. Write basic HTML structure: Copy and paste the following code:
<html> <head> <title>My First Webpage</title> </head> <body bgcolor="yellow" text="red"> </html> ```

Understanding the Code

  • <html>: The root element of the HTML document.
  • <head>: Contains metadata about the document, such as the title.
  • <title>: Sets the title of the webpage, which appears in the browser's title bar.
  • <body>: Contains the content of the HTML document.

Adding Content

  1. Headings: Use <h1>, <h2>, <h3>, etc. to create headings.
<h1>Welcome to My First Webpage</h1>
  1. Paragraphs: Use <p> to create paragraphs.
<p>This is my first webpage, and I'm excited to learn more about HTML!</p>
 *Links*: Use `<a>` to create hyperlinks.


 *Images*: Use `<img>` to add images.

<img src="image name.jpg" > ``` Saving and Viewing 1. *Save the file*: Save your HTML file with the changes you've made. 2. *Open the file in a browser*: Double-click the file to open it in your default web browser.

Congratulations! You've just created your first HTML webpage!

Keep practicing, and soon you'll become proficient in HTML.

5 months ago by Abhigyan Pandey

index.html

<!DOCTYPE HTML
5 months ago by Kajal Rajput