An HTML page is the foundation of a website. It consists of essential elements wrapped in HTML tags that define the structure and layout of the content. Here's a quick breakdown of what a simple HTML page looks like:
Here's an example of a straightforward HTML layout:
<!DOCTYPE html>
<html>
<head>
<title>My First HTML Page</title>
</head>
<body>
<h1>Welcome to My Website</h1>
<p>This is a basic paragraph of text on a simple HTML page.</p>
</body>
</html>
HTML tags define different types of content on a web page. Here are a few basic HTML tags you'll frequently encounter:
These tags wrap around the content they affect, like so:
<h1>Page Title</h1>
<p>This is a paragraph.</p>
<img src="image.jpg" alt="Description of the image">
Styling Options: Inline Styles and External CSS
You can style HTML content either inline or through an external CSS file:
1. Inline Styling: Inline styles are applied directly within HTML tags using the style attribute. For example:
<p style="color:blue; font-size:20px;">This is a styled paragraph.</p>
While quick, inline styling is best used sparingly, as it can clutter HTML code and is harder to manage for larger websites.
2. CSS File: External CSS files allow you to apply consistent styles across multiple pages. By linking to a CSS file in the <head> section, you can control the look and feel of your site from one location, making updates easier. Example:
<head>
<link rel="stylesheet" href="styles.css">
</head>
Using basic HTML tags effectively lays the groundwork for a structured, accessible, and well-styled website. Whether you're adding headings, images, or paragraphs, understanding how to use these tags is essential for any beginner looking to build or edit a website.
Here is some additional information about HTML.