Breaking News

How to Use HTML: A Beginner’s Guide


If you’ve ever wondered how websites are built, the answer almost always starts with HTML. Short for HyperText Markup Language, HTML is the backbone of the web. It tells your browser what content to display and how it should be structured.

In this post, we’ll walk through the basics of HTML so you can start creating your own simple web pages.


1. What is HTML?

HTML is not a programming language—it’s a markup language. That means it uses tags to label and organize content. A browser reads these tags and translates them into text, images, links, and other elements you see on a page.

Example:

<p>This is a paragraph in HTML.</p>

Here, <p> is the opening tag, and </p> is the closing tag. Everything inside shows up as text on the page.


2. The Basic Structure of an HTML Page

Every HTML page follows a simple structure:

<!DOCTYPE html> <html> <head> <title>My First Web Page</title> </head> <body> <h1>Hello, World!</h1> <p>Welcome to my first HTML page.</p> </body> </html>
  • <!DOCTYPE html> tells the browser this is an HTML5 document.

  • <html> wraps all the content.

  • <head> contains metadata (like the title of the page).

  • <body> contains the visible content.


3. Common HTML Tags You’ll Use

Here are some of the most useful tags for beginners:

  • Headings: <h1> to <h6>

    <h1>Main Title</h1> <h2>Subtitle</h2>
  • Paragraphs: <p>

    <p>This is a paragraph of text.</p>
  • Links: <a>

    <a href="https://example.com">Visit Example</a>
  • Images: <img>

    <img src="image.jpg" alt="Description of image">
  • Lists:

    <ul> <li>First item</li> <li>Second item</li> </ul>

4. Saving and Opening Your First Web Page

  1. Open a text editor (like Notepad, VS Code, or Sublime Text).

  2. Copy and paste your HTML code.

  3. Save the file with a .html extension (for example: index.html).

  4. Double-click the file—you’ll see your first web page open in your browser!


5. Next Steps

Once you’ve mastered the basics of HTML, you’ll want to learn CSS (for styling your content) and JavaScript (for interactivity). Together, these three make up the foundation of web development.


Pro Tip: Start small. Experiment by changing text, adding images, and creating links. The more you play around with HTML, the faster you’ll understand how it works.



 

कोई टिप्पणी नहीं