HTML Basics for Beginners
Sure! I can provide you with a beginner-friendly HTML tutorial that covers the basics along with theory explanations. Let's start with the fundamentals of HTML.
HTML stands for HyperText Markup Language. It is the standard markup language used to create the structure and content of webpages. HTML uses a series of tags to define the elements on a webpage. Tags are enclosed in angle brackets (<>) and come in pairs: an opening tag and a closing tag. The content between these tags defines the element.
Here's an example of a basic HTML structure:
```html
Welcome to My Webpage
This is a paragraph of text.
```
Let's break down this example:
- ``: This declaration specifies the HTML version being used, which in this case is HTML5.
- ``: This is the root element of an HTML page. It contains all other elements.
- ``: This element is used to define the header section of the webpage. It typically contains meta information, CSS stylesheets, JavaScript files, and the page title.
- ``: This element sets the title of the webpage, which appears in the browser's title bar or tab.
- ``: This element represents the main content of the webpage and contains all visible elements like headings, paragraphs, images, links, etc.
- ``: This is a heading element. HTML has six levels of headings, with `
`: This is a heading element. HTML has six levels of headings, with `` being the highest (most important) and `` being the lowest.
` being the lowest.
- `
`: This is a paragraph element. It is used to define a block of text.
To view the above HTML code in a web browser, save it with a `.html` file extension (e.g., `index.html`) and open it using any web browser. You'll see the heading "Welcome to My Webpage" and the paragraph "This is a paragraph of text."
Now let's explore some common HTML elements and their usage:
1. **Headings**: As mentioned earlier, HTML provides six levels of headings, `` to `
` to ``. Headings are used to give structure to your content and denote different levels of importance.
2. **Paragraphs**: Paragraphs are represented by the `
` element. They are used to define blocks of text.
3. **Links**: Links are created using the `` (anchor) element. The `href` attribute specifies the destination URL. Here's an example: `Visit Example.com`
4. **Images**: Images are inserted using the `` element. The `src` attribute specifies the path to the image file. Here's an example: ``
5. **Lists**: HTML offers two types of lists: ordered and unordered. Ordered lists use the `
- ` (ordered list) element, and unordered lists use the `
- ` (list item) element.
- ` (unordered list) element. List items are defined with the `
Here's an example of both types of lists:
```html
```
6. **Tables**: Tables are created using the `` element. They consist of rows
Comments
Post a Comment