HTML elements and HTML tags are closely related but have distinct meanings:
1. **HTML Element:**
- An HTML element is a collection of opening tag, content, and closing tag that defines a specific part of a
webpage.
- It consists of the opening tag, the content (which can include other nested elements), and the closing tag.
- Example: `<p>This is a paragraph.</p>`, where `<p>` is the opening tag, `This is a paragraph.` is the
content, and `</p>` is the closing tag.
2. **HTML Tag:**
- An HTML tag is the markup syntax used to define elements within an HTML document.
- It consists of the opening tag, which marks the beginning of an element, and the closing tag, which marks
the end of an element.
- Example: In `<p>This is a paragraph.</p>`, `<p>` is the opening tag, and `</p>` is the closing tag.
In summary, HTML tags are used to mark the beginning and end of HTML elements, which contain the content
and structure of a webpage.
The `<span>` and `<div>` tags are both commonly used in HTML for grouping and styling purposes, but they
serve different purposes and have different default styling:
1. **`<span>`:**
- The `<span>` tag is an inline element.
- It is typically used to apply styles to a specific portion of text or to group inline elements together.
- It does not create a line break.
- Example: `<span style="color: red;">This text is red</span>`
2. **`<div>`:**
- The `<div>` tag is a block-level element.
- It is used to group larger sections of content together.
- It creates a line break before and after the element.
- It's commonly used for layout purposes or to apply styles to larger sections of content.
- Example: `<div style="border: 1px solid black;">Content inside a div</div>`
In summary, `<span>` is used for small inline styling or grouping, while `<div>` is used for larger content
grouping and layout purposes.
Active Links
An Active link is a hyperlink that is currently being interacted with the user. Whenever the user holds the mouse
button on the link and not released yet or if right clicked on it, it will change its color into red, this is when the
link will be in active state.
We can link one webpage to another by using an image as a link. This link is called a hyperlink.
We use the <img> tag to display an image. The <a> tag is used to create a hyperlink. Placing an <img> tag
inside an <a> tag displays a clickable image that leads to another page.
The <a> tag has an attribute, href. The href attribute's value specifies the location of the webpage we want to
link.
Syntax
<a href="#">
<img src="image.png">
</a>
The <a> tag encapsulates the <img> tag. This encapsulation applies the hyperlink to the image.
Both br and br/ produces the same result i.e line break. But br/ is preferred because it can be used with strict
rules as well(like while writing XHTML document) and the latter looks cleaner and readable
Global attributes
The global attributes are attributes that can be used with all HTML elements.
Event attributes
When a browser reacts on user action, then it is called as an event. For example, when you click on the
submit button, then if the browser displays an information box.
HTML has the ability to let events trigger actions in a browser, like starting a JavaScript when a user clicks on
an element.
An HTML Nested list refers to a list within another list. We can create a nested ordered list, a nested
unordered list, or a nested ordered list inside an unordered list.
The target attribute specifies where the linked page or form response will be opened. The target="_parent"
value opens the page in the parent frame (frame, tab, or window). If no parent frame can be detected, the
page will display in the current frame.
_parent causes the hyperlink to open in the parent window. With _top the linked document will be opened in a
whole window. With this option you can open the document in a defined iframe.
GET method - used to request data from a specified resource
POST method - used to send data to a server to update a resource
The GET Method
The HTML GET method is used to get a resource from the server. Has limits.
The POST method
The HTTP POST method is used to send data to the server for further processing. Has no limits.
The data sent is not easily visible to the user. However, we can check the sent data using special tools like the
browsers' dev tools.
Image map
https://www.w3schools.com/html/html_images_imagemap.asp
The ismap attribute is a boolean attribute.
When present, it specifies that the image is part of a server-side image map (an image map is an image with
clickable areas).
When clicking on a server-side image map, the click coordinates are sent to the server as a URL query string.
Note: The ismap attribute is allowed only if the <img> element is a descendant of an <a> element with a valid
href attribute.
The usemap attribute specifies an image (or an object) as an image map (an image map is an image with
clickable areas).
The usemap attribute is associated with a <map> element's name or id attribute, and creates a relationship
between the <img> and the <map>.
Note: The usemap attribute cannot be used if the <img> element is a descendant of an <a> or <button>
element.
Cell padding is the space between the cell edges and the cell content.
Cell spacing is the space between each cell.